summaryrefslogtreecommitdiffstats
path: root/Include/internal/pycore_bitutils.h
Commit message (Collapse)AuthorAgeFilesLines
* bpo-29882: Fix portability bug introduced in GH-30774 (#30794)Mark Dickinson2022-01-231-4/+14
|
* bpo-29882: _Py_popcount32() doesn't need 64x64 multiply (GH-30774)Victor Stinner2022-01-211-1/+1
| | | 32x32 bits multiply is enough for _Py_popcount32().
* bpo-41617: Add _Py__has_builtin() macro (GH-23260)Victor Stinner2020-11-131-9/+6
| | | | | | | | | | | Fix building pycore_bitutils.h internal header on old clang version without __builtin_bswap16() (ex: Xcode 4.6.3 on Mac OS X 10.7). Add a new private _Py__has_builtin() macro to check for availability of a preprocessor builtin function. Co-Authored-By: Joshua Root <jmr@macports.org> Co-authored-by: Joshua Root <jmr@macports.org>
* bpo-41617: Fix pycore_bitutils.h to support clang 3.0 (GH-22042)Victor Stinner2020-09-011-4/+6
| | | __builtin_bswap16() is not available in LLVM clang 3.0.
* bpo-29782: Consolidate _Py_Bit_Length() (GH-20739)Niklas Fiekas2020-06-151-4/+43
| | | | | | | | | | 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.
* bpo-29882: Add _Py_popcount32() function (GH-20518)Victor Stinner2020-06-081-0/+138
* Rename pycore_byteswap.h to pycore_bitutils.h. * Move popcount_digit() to pycore_bitutils.h as _Py_popcount32(). * _Py_popcount32() uses GCC and clang builtin function if available. * Add unit tests to _Py_popcount32().