-
Notifications
You must be signed in to change notification settings - Fork 21
Add f64<->f32 widening/narrowing conversions #127
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: main
Are you sure you want to change the base?
Conversation
950c4db to
d217ef5
Compare
Ralith
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any idea how to expose this to native-width code?
|
Probably through adding |
|
What would the return types be, though? We only have associated types of one width. |
|
Hm, I see the issue. Maybe the Zulip thread's "split when widening / combine when narrowing" approach is better for this? |
|
I think that's probably the best we can do in current Rust, yeah. No reason not to leave that for follow-up work, of course. |
|
If the split/combine approach is what we're going with, it might be good to separate the conversions from the existing widen/narrow ops' convention. Like, let's say we want to implement the "generic" widen operation on @LaurenzV, would it be a good idea to just update the "widen/narrow" signatures to return and consume two vectors respectively? The |
|
Seems reasonable, but maybe something for office hours. |
These were requested in #simd > Quickly deinterleaving the underlying Simd arrays?, and seem useful.
They are a bit unusual in Neon, which has specific instructions for converting the low and high halves (and combining the two).
Due to some rearrangement and cleanup of the code generation, the reinterpret ops have been moved around a bit. They haven't been changed at all.