This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients louielu, mark.dickinson, niklasf, vstinner
Date 2020-01-16.14:13:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1579184026.83.0.821921490508.issue31031@roundup.psfhosted.org>
In-reply-to
Content
"On BSD, there's a library function called fls() that we could use, and GCC provides __builtin_clz()."

See also rejected bpo-29782 and GH-594.

If someone wants to experiment that, I suggest to add Include/internal/pycore_pymath.h, move _Py_bit_length() there and convert it to a static inline function.

Since the code is now unified, it makes a little bit more sense to add specialized code, *if* the code is not too complex.

I'm still not sure that GH-594 is worth it, since it was not possible to see the speedup on a microbenchmark :-(
History
Date User Action Args
2020-01-16 14:13:46vstinnersetrecipients: + vstinner, mark.dickinson, louielu, niklasf
2020-01-16 14:13:46vstinnersetmessageid: <1579184026.83.0.821921490508.issue31031@roundup.psfhosted.org>
2020-01-16 14:13:46vstinnerlinkissue31031 messages
2020-01-16 14:13:46vstinnercreate