-
Notifications
You must be signed in to change notification settings - Fork 37
feat: add bitmask to int vec conversion #144
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
base: master
Are you sure you want to change the base?
Conversation
|
The functionality is good but the names Also, test + README update needed. |
|
(I also don't think the |
|
This function should probably have the same semantics as a regular |
1f05bb5 to
f78692f
Compare
I replaced I also really like the convenience of not having to specify the output type in specific cases, so I added
Looks like LLVM is indeed clever enough to create efficient code with From my end this PR is ready for another review. |
|
@eschnett @KristofferC would you take another look at this PR? |
|
Imo, the |
|
Here's my reasoning for In other words:
The omission of the case |
|
@KristofferC thanks for the feedback. Would you please provide a little more detail behind your opinion? Are you strictly opposed to the name? If so, here are some alternatives.
If you're opposed to something other than the name, I'd love to hear your reasoning and possible options to get this feature in. |
Following up on the discussion in #141 (comment), this PR defines:
This function replaces
bitmaskand provide a general interface for converting from a vector of booleans to a uint and vice versa.There are specific cases where it's very convenient to avoid specifying the output type, for those cases
tobitmask(SIMD.Vec)andfrombitmask(UInt)were added. However, these are mostly "convenience" functions so they aren't strictly necessary.