-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
Count leading zero bits in one CPU tick #19633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). Recognized GitHub usernameWe couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames: This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supported on all architecture that Python support (https://www.python.org/download/other/)?
What about CPU that don't have this instruction or where this instruction is slower?
Also this would need to be compatible with all compilers supported by CPython.
Python runs on many different platforms and architectures. It's written (mostly) in standard C (specifically, C89, but with some C99 features permitted). It's okay to have platform-specific code when there's a good reason for it, but there will still need to be fallback code for platforms that don't have |
…() (python#19634) Co-Authored-By: Victor Stinner <vstinner@python.org>
* Add underscores to long numbers to improve readability * Use bigger dataset in the bootstrapping example * Convert single-server queue example to more useful multi-server queue
Icon author: Andrew Clover, bpo-1490384
…16480) It is possible to use either '-isysroot /some/path' (with a space) or '-isysroot/some/path' (no space in between). Support both forms in places where special handling of -isysroot is done, rather than just the first form. Co-authored-by: Ned Deily <nad@python.org>
…thonGH-19650) Previously, python.org macOS installers did not alter the Current version symlink in /Library/Frameworks/Python.framework/Versions when installing a version of Python 3.x, only when installing 2.x. Now that Python 2 is retired, it's time to change that. This should make it a bit easier to embed Python 3 into other macOS applications.
@hnarkaytis Thanks for the contribution. If you want to pursue this further, there are a couple of steps you need to take:
See the Python Developer's Guide for more detailed information and guidelines on contributing to core Python. |
@mdickinson let me take care of this. HHN.
|
See also https://bugs.python.org/issue29782 and PR #594. |
Fix the Windows implementation of os.waitpid() for exit code larger than "INT_MAX >> 8". The exit status is now interpreted as an unsigned number. os.waitstatus_to_exitcode() now accepts wait status larger than INT_MAX.
…9230) The constant values of future flags in the __future__ module is updated in order to prevent collision with compiler flags. Previously PyCF_ALLOW_TOP_LEVEL_AWAIT was clashing with CO_FUTURE_DIVISION.
…onGH-19774) After parsing is done in single statement mode, the tokenizer buffer has to be checked for additional lines and a `SyntaxError` must be raised, in case there are any. Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
@hnarkaytis, sorry but if you want anyone to review your suggestions, you need to follow our process as @mdickinson explained. And you need to redo this PR so it is against the current top of the master branch only, such that it only shows the actual changes you propose, not all the merges in 372 files. |
Yeah - I know. Just pushed code first. Will get the rest shortly. I converted pull request to draft, so it should not trigger anyone in review list. |
Count of leading bits was implemented as a CPU instructing 6 years ago. It doesn't make sense to have custom code for this.
https://en.wikipedia.org/wiki/Bit_Manipulation_Instruction_Sets#ABM_(Advanced_Bit_Manipulation)