Skip to content

zend_ulong_ntz/zend_ulong_ntz little optimisation for windows.#17527

Closed
devnexen wants to merge 1 commit into
php:masterfrom
devnexen:bitscan_win_optim
Closed

zend_ulong_ntz/zend_ulong_ntz little optimisation for windows.#17527
devnexen wants to merge 1 commit into
php:masterfrom
devnexen:bitscan_win_optim

Conversation

@devnexen
Copy link
Copy Markdown
Member

because of the unix code path, UB is avoided beforehand thus errors with 0 mask for the windows api is unlikely.

because of the unix code path, UB is avoided beforehand thus errors
with 0 mask for the windows api is unlikely.
@devnexen
Copy link
Copy Markdown
Member Author

nvm pretty pointless, with clang it s the same as unix and unexpected is no-op with msvc..

@devnexen devnexen closed this Jan 19, 2025
@cmb69
Copy link
Copy Markdown
Member

cmb69 commented Jan 19, 2025

with clang it s the same as unix

Is it? It looks like clang-cl actually takes the defined(_WIN32) path (I've put in an #error directive).

However, I don't think either return value is expected (or unexpected). It seems to me the comment "undefined behavior" is very misleading. It's just when BitScanForward() returns zero, index is undefined; should probably drop that comment altogether.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants