Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zend_ulong_ntz/zend_ulong_ntz little optimisation for windows. #17527

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Zend/zend_bitset.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ ZEND_ATTRIBUTE_CONST static zend_always_inline int zend_ulong_ntz(zend_ulong num
unsigned long index;

#if defined(_WIN64)
if (!BitScanForward64(&index, num)) {
if (UNEXPECTED(!BitScanForward64(&index, num))) {
#else
if (!BitScanForward(&index, num)) {
if (UNEXPECTED(!BitScanForward(&index, num))) {
#endif
/* undefined behavior */
return SIZEOF_ZEND_LONG * 8;
Expand Down Expand Up @@ -94,9 +94,9 @@ ZEND_ATTRIBUTE_CONST static zend_always_inline int zend_ulong_nlz(zend_ulong num
unsigned long index;

#if defined(_WIN64)
if (!BitScanReverse64(&index, num)) {
if (UNEXPECTED(!BitScanReverse64(&index, num))) {
#else
if (!BitScanReverse(&index, num)) {
if (UNEXPECTED(!BitScanReverse(&index, num))) {
#endif
/* undefined behavior */
return SIZEOF_ZEND_LONG * 8;
Expand Down
Loading