Skip to content

Add signed/unsigned casting - #435

Open
RunDevelopment wants to merge 1 commit into
linebender:mainfrom
RunDevelopment:int-signed-unsigned
Open

RunDevelopment wants to merge 1 commit into
linebender:mainfrom
RunDevelopment:int-signed-unsigned

Conversation

@RunDevelopment

Copy link
Copy Markdown
Contributor

This PR adds SimdInt::{Signed, Unsigned, cast_signed, cast_unsigned} to allow users to cast the signedness of a vector without needing to name the target vector type. Similar to #420.

I also added SimdInt::unsigned_abs() because it's trivial to implement using the new APIs.


I'm thinking of this PR as prep for abs_diff, but I'm not sure if this is the right approach long term. IMO, std::simd's traits SimdInt and SimdUint are much more elegant, but it's a little late for that now. Except if we add traits like trait SimdSigned: SimdInt and trait SimdUnsigned: SimdInt and move all sign-specific operations there.

Ideas very welcome.

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