aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Fiekas <niklas.fiekas@backscattering.de>2020-06-15 14:33:48 +0200
committerGitHub <noreply@github.com>2020-06-15 14:33:48 +0200
commit794e7d1ab2d7afe70fe0dd87ca8174ac860413e4 (patch)
tree48ad4d0b5a06b4f80706b16e6ca069f660b25414 /Modules/mathmodule.c
parentbpo-40836: Add docstring to logging.fatal() and logging.Logger.fatal() (GH-20... (diff)
downloadcpython-794e7d1ab2d7afe70fe0dd87ca8174ac860413e4.tar.gz
cpython-794e7d1ab2d7afe70fe0dd87ca8174ac860413e4.tar.bz2
cpython-794e7d1ab2d7afe70fe0dd87ca8174ac860413e4.zip
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.
Diffstat (limited to 'Modules/mathmodule.c')
-rw-r--r--Modules/mathmodule.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index cb05ce7c509..4450ce18941 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -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"