cpython/Include
Niklas Fiekas 794e7d1ab2
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.
2020-06-15 14:33:48 +02:00
..
cpython bpo-40939: Remove the old parser (GH-20768) 2020-06-11 17:30:46 +01:00
internal bpo-29782: Consolidate _Py_Bit_Length() (GH-20739) 2020-06-15 14:33:48 +02:00
Python-ast.h bpo-40141: Add line and column information to ast.keyword nodes (GH-19283) 2020-04-02 00:47:39 +01:00
Python.h bpo-40421: Add Include/cpython/code.h header file (GH-19756) 2020-04-28 17:07:12 +02:00
abstract.h bpo-38600: Change the mark up of NULL in the C API documentation. (GH-16950) 2019-10-30 12:03:20 +02:00
asdl.h bpo-40528: Improve and clear several aspects of the ASDL definition code for the AST (GH-19952) 2020-05-06 15:29:32 +01:00
ast.h bpo-21120: Exclude Python-ast.h, ast.h and asdl.h from the limited API (#14634) 2019-09-12 10:27:14 +01:00
bitset.h bpo-36623: Clean parser headers and include files (GH-12253) 2019-04-13 17:05:14 +01:00
bltinmodule.h
boolobject.h bpo-39573: Add Py_IS_TYPE() function (GH-18488) 2020-02-13 18:37:17 +01:00
bytearrayobject.h bpo-39573: Add Py_IS_TYPE() function (GH-18488) 2020-02-13 18:37:17 +01:00
bytesobject.h bpo-39573: Add Py_IS_TYPE() function (GH-18488) 2020-02-13 18:37:17 +01:00
cellobject.h bpo-39573: Add Py_IS_TYPE() function (GH-18488) 2020-02-13 18:37:17 +01:00
ceval.h bpo-40421: Add pyframe.h header file (GH-19755) 2020-04-28 16:32:48 +02:00
classobject.h bpo-39573: PyXXX_Check() macros use Py_IS_TYPE() (GH-18508) 2020-02-14 08:48:12 +01:00
code.h bpo-40421: Add Include/cpython/code.h header file (GH-19756) 2020-04-28 17:07:12 +02:00
codecs.h
compile.h bpo-40421: Add Include/cpython/code.h header file (GH-19756) 2020-04-28 17:07:12 +02:00
complexobject.h bpo-39573: Add Py_IS_TYPE() function (GH-18488) 2020-02-13 18:37:17 +01:00
context.h bpo-40428: Remove PyTuple_ClearFreeList() function (GH-19769) 2020-04-29 02:29:20 +02:00
datetime.h bpo-39573: Add Py_IS_TYPE() function (GH-18488) 2020-02-13 18:37:17 +01:00
descrobject.h bpo-36974: separate vectorcall functions for each calling convention (GH-13781) 2019-07-05 14:48:24 +02:00
dictobject.h bpo-39573: Add Py_IS_TYPE() function (GH-18488) 2020-02-13 18:37:17 +01:00
dynamic_annotations.h
enumobject.h
errcode.h bpo-40593: Improve syntax errors for invalid characters in source code. (GH-20033) 2020-05-12 12:42:04 +03:00
eval.h
exports.h bpo-11410: Standardize and use symbol visibility attributes across POSIX and Windows. (GH-16347) 2019-10-15 08:26:12 +01:00
fileobject.h bpo-36842: Implement PEP 578 (GH-12613) 2019-05-23 08:45:22 -07:00
fileutils.h bpo-35134: Add Include/cpython/fileutils.h header file (GH-18493) 2020-02-12 23:55:09 +01:00
floatobject.h bpo-40428: Remove PyTuple_ClearFreeList() function (GH-19769) 2020-04-29 02:29:20 +02:00
frameobject.h bpo-40421: Add pyframe.h header file (GH-19755) 2020-04-28 16:32:48 +02:00
funcobject.h bpo-39573: Add Py_IS_TYPE() function (GH-18488) 2020-02-13 18:37:17 +01:00
genericaliasobject.h bpo-39481: Implementation for PEP 585 (#18239) 2020-04-07 09:50:06 -07:00
genobject.h bpo-40428: Remove PyTuple_ClearFreeList() function (GH-19769) 2020-04-29 02:29:20 +02:00
graminit.h
grammar.h fix warnings by adding more const (GH-12924) 2019-04-23 20:39:37 +09:00
import.h bpo-39372: Clean header files of declared interfaces with no implementations (GH-18037) 2020-01-18 03:14:59 +00:00
interpreteridobject.h
intrcheck.h PyOS_AfterFork_Child() uses PyStatus (GH-20596) 2020-06-02 15:51:37 +02:00
iterobject.h bpo-39573: Add Py_IS_TYPE() function (GH-18488) 2020-02-13 18:37:17 +01:00
listobject.h bpo-39573: Add Py_IS_TYPE() function (GH-18488) 2020-02-13 18:37:17 +01:00
longintrepr.h
longobject.h bpo-37999: No longer use __int__ in implicit integer conversions. (GH-15636) 2020-05-26 18:43:38 +03:00
marshal.h
memoryobject.h bpo-39573: Add Py_IS_TYPE() function (GH-18488) 2020-02-13 18:37:17 +01:00
methodobject.h bpo-38787: Add PyCFunction_CheckExact() macro for exact type checks (GH-20024) 2020-05-12 07:12:41 -07:00
modsupport.h bpo-40024: Add PyModule_AddType() helper function (GH-19088) 2020-03-22 17:17:34 +01:00
moduleobject.h bpo-39573: Add Py_IS_TYPE() function (GH-18488) 2020-02-13 18:37:17 +01:00
namespaceobject.h
node.h bpo-39702: Relax grammar restrictions on decorators (PEP 614) (GH-18570) 2020-03-03 14:25:44 -08:00
object.h bpo-39573: Convert Py_REFCNT and Py_SIZE to functions (GH-20429) 2020-05-27 14:55:10 +02:00
objimpl.h bpo-40241: Add PyObject_GC_IsTracked and PyObject_GC_IsFinalized to the public C-API (GH-19461) 2020-04-11 01:21:54 +01:00
odictobject.h bpo-39573: Add Py_IS_TYPE() function (GH-18488) 2020-02-13 18:37:17 +01:00
opcode.h bpo-39320: Handle unpacking of **values in compiler (GH-18141) 2020-01-27 09:57:45 +00:00
osdefs.h
osmodule.h
parsetok.h
patchlevel.h Python 3.10.0a0 (GH-20198) 2020-05-19 03:33:01 +01:00
picklebufobject.h bpo-39573: PyXXX_Check() macros use Py_IS_TYPE() (GH-18508) 2020-02-14 08:48:12 +01:00
py_curses.h bpo-39573: Finish converting to new Py_IS_TYPE() macro (GH-18601) 2020-03-04 14:15:20 +01:00
pyarena.h
pycapsule.h bpo-39573: Add Py_IS_TYPE() function (GH-18488) 2020-02-13 18:37:17 +01:00
pyctype.h
pydebug.h bpo-40520: Remove redundant comment in pydebug.h (GH-19931) 2020-05-05 08:20:38 -07:00
pydtrace.d bpo-36842: Implement PEP 578 (GH-12613) 2019-05-23 08:45:22 -07:00
pydtrace.h bpo-36842: Implement PEP 578 (GH-12613) 2019-05-23 08:45:22 -07:00
pyerrors.h bpo-39882: Py_FatalError() logs the function name (GH-18819) 2020-03-07 00:54:20 +01:00
pyexpat.h
pyfpe.h bpo-38835: Exclude PyFPE macros from the stable API (GH-17228) 2019-11-20 12:17:09 +01:00
pyframe.h bpo-40421: Add PyFrame_GetCode() function (GH-19757) 2020-04-28 19:01:31 +02:00
pyhash.h bpo-40602: Add _Py_HashPointerRaw() function (GH-20056) 2020-05-12 18:46:20 +02:00
pylifecycle.h bpo-36763: Make Py_BytesMain() public (GH-15532) 2019-08-27 00:45:45 +02:00
pymacconfig.h
pymacro.h bpo-38249: Expand Py_UNREACHABLE() to __builtin_unreachable() in the release mode. (GH-16329) 2020-03-09 20:49:52 +02:00
pymath.h bpo-29782: Consolidate _Py_Bit_Length() (GH-20739) 2020-06-15 14:33:48 +02:00
pymem.h bpo-39542: Make _Py_NewReference() opaque in C API (GH-18346) 2020-02-05 01:11:10 +01:00
pyport.h bpo-40943: Replace PY_FORMAT_SIZE_T with "z" (GH-20781) 2020-06-10 18:38:05 +02:00
pystate.h Update code comment re: location of struct _is. (GH-20067) 2020-05-14 19:11:00 -07:00
pystrcmp.h
pystrhex.h bpo-22385: Support output separators in hex methods. (#13578) 2019-05-29 11:46:58 -07:00
pystrtod.h
pythonrun.h bpo-37189: Export old PyRun_XXX() functions (#14142) 2019-06-18 00:15:13 +02:00
pythread.h bpo-40089: Add _at_fork_reinit() method to locks (GH-19195) 2020-04-07 23:11:49 +02:00
pytime.h Fix _PyTime_MIN/MAX values (GH-15384) 2019-08-23 16:39:09 +01:00
rangeobject.h bpo-39573: Add Py_IS_TYPE() function (GH-18488) 2020-02-13 18:37:17 +01:00
setobject.h bpo-40428: Remove PyTuple_ClearFreeList() function (GH-19769) 2020-04-29 02:29:20 +02:00
sliceobject.h bpo-39573: Add Py_IS_TYPE() function (GH-18488) 2020-02-13 18:37:17 +01:00
structmember.h
structseq.h bpo-38650: Constify PyStructSequence_UnnamedField. (GH-17005) 2019-11-16 18:55:29 +02:00
symtable.h bpo-39573: Add Py_IS_TYPE() function (GH-18488) 2020-02-13 18:37:17 +01:00
sysmodule.h bpo-36842: Implement PEP 578 (GH-12613) 2019-05-23 08:45:22 -07:00
token.h bpo-40267: Fix message when last input character produces a SyntaxError (GH-19521) 2020-04-15 11:22:10 -07:00
traceback.h bpo-40421: Add pyframe.h header file (GH-19755) 2020-04-28 16:32:48 +02:00
tracemalloc.h
tupleobject.h bpo-40428: Remove PyTuple_ClearFreeList() function (GH-19769) 2020-04-29 02:29:20 +02:00
typeslots.h bpo-40724: Support setting buffer slots from type specs (GH-20648) 2020-06-06 21:35:10 +02:00
ucnhash.h
unicodeobject.h bpo-39573: Add Py_IS_TYPE() function (GH-18488) 2020-02-13 18:37:17 +01:00
warnings.h
weakrefobject.h bpo-39573: Add Py_IS_TYPE() function (GH-18488) 2020-02-13 18:37:17 +01:00