Skip to content

BUG: Fix missing intrinsics for windows/arm64 target #20931

Merged
charris merged 2 commits intonumpy:mainfrom
niyas-sait:fix_missing_arm64_intrinsics
Jan 28, 2022
Merged

BUG: Fix missing intrinsics for windows/arm64 target #20931
charris merged 2 commits intonumpy:mainfrom
niyas-sait:fix_missing_arm64_intrinsics

Conversation

@niyas-sait
Copy link
Copy Markdown
Contributor

Fixes #20930

__popcnt and variants are not available for arm64 msvc intrinsic so use numpy population count implementation for win/arm64 targets.

https://docs.microsoft.com/en-us/cpp/intrinsics/arm64-intrinsics?view=msvc-170

Test Result

16356 passed, 649 skipped, 1296 deselected, 18 xfailed, 1 xpassed in 245.28s (0:04:05)

Do not use __popcnt and variants for windows/arm64 target
#if (defined(__clang__) || defined(__GNUC__)) && NPY_BITSOF_@STYPE@ >= 32
return __builtin_popcount@c@(a);
#elif defined(_MSC_VER) && NPY_BITSOF_@STYPE@ >= 16
#elif defined(_MSC_VER) && NPY_BITSOF_@STYPE@ >= 16 && !defined(_M_ARM64)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! I'm not aware of ARM(hence I missed it), but should we add _M_ARM as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@ganesh-k13 ganesh-k13 self-requested a review January 28, 2022 16:16
@ganesh-k13 ganesh-k13 added the 09 - Backport-Candidate PRs tagged should be backported label Jan 28, 2022
@ganesh-k13 ganesh-k13 added this to the 1.22.2 release milestone Jan 28, 2022
@charris charris merged commit c900978 into numpy:main Jan 28, 2022
@charris
Copy link
Copy Markdown
Member

charris commented Jan 28, 2022

Thanks @nsait-linaro .

@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Jan 29, 2022
@charris charris removed this from the 1.22.2 release milestone Jan 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Win/Arm64 targets broken due to missing __popcnt intrinsics

3 participants