Skip to content

Avoid __popcnt64 on MSVC Windows 32-bit platform#87

Open
frederick-vs-ja wants to merge 1 commit into
asg017:mainfrom
frederick-vs-ja:msvc-win32-popcnt
Open

Avoid __popcnt64 on MSVC Windows 32-bit platform#87
frederick-vs-ja wants to merge 1 commit into
asg017:mainfrom
frederick-vs-ja:msvc-win32-popcnt

Conversation

@frederick-vs-ja
Copy link
Copy Markdown

@frederick-vs-ja frederick-vs-ja commented Aug 14, 2024

The __popcnt64 intrinsic isn't supported on 32-bit Windows, so __popcnt should be used instead.

See also https://learn.microsoft.com/en-us/cpp/intrinsics/popcnt16-popcnt-popcnt64?view=msvc-170.


IMO, ideally we should use stdc_count_ones (see here and WG14 N3220). But it will take a long long while until C23 will become popular enough.

@frederick-vs-ja

This comment was marked as outdated.

@frederick-vs-ja frederick-vs-ja force-pushed the msvc-win32-popcnt branch 2 times, most recently from 6b8e567 to ebb6e97 Compare October 15, 2024 05:35
@frederick-vs-ja

This comment was marked as outdated.

@frederick-vs-ja

This comment was marked as outdated.

1 similar comment
@frederick-vs-ja
Copy link
Copy Markdown
Author

Gently ping @asg017

vlasky added a commit to vlasky/sqlite-vec that referenced this pull request Dec 2, 2025
__popcnt64 intrinsic is not available on 32-bit Windows.
Split u64 into two u32 values and use __popcnt on each half.
The `__popcnt64` intrinsic isn't supported on 32-bit Windows, so `__popcnt` should be used instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant