mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
bpo-29782: Consolidate _Py_Bit_Length() (GH-20739)
In GH-2866, _Py_Bit_Length() was added to pymath.h for lack of a better location. GH-20518 added a more appropriate header file for bit utilities. It also shows how to properly use intrinsics. This allows reconsidering bpo-29782. * Move the function to the new header. * Changed return type to match __builtin_clzl() and reviewed usage. * Use intrinsics where available. * Pick a fallback implementation suitable for inlining.
This commit is contained in:
parent
25f38d7044
commit
794e7d1ab2
6 changed files with 100 additions and 36 deletions
|
|
@ -53,6 +53,7 @@ raised for division by zero and mod by zero.
|
|||
*/
|
||||
|
||||
#include "Python.h"
|
||||
#include "pycore_bitutils.h" // _Py_bit_length()
|
||||
#include "pycore_dtoa.h"
|
||||
#include "_math.h"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue