Skip to content
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

Adds conversion functions from integers to floats #164

Merged
merged 6 commits into from
Jul 21, 2024

Conversation

Mottl
Copy link
Contributor

@Mottl Mottl commented Jun 29, 2024

This PR adds four conversion functions from integers to floats:
f32x4::from_i32x4
f32x8::from_i32x8
f64x2::from_i32x4
f64x4::from_i32x4

@Lokathor
Copy link
Owner

Looks like the build errors are because you're trying to use nightly stuff.

Also, these should either be From impls, or they should have more descriptive names that help the reader understand why it's not just a normal From impl. eg: f64x2::from_i32x4_lower2(x) lets the reader understand that they're dropping half their lanes.

@Mottl
Copy link
Contributor Author

Mottl commented Jul 1, 2024

Thanks for comments! I chose to implement From.
Do you want to have f64x2::from_i32x4_lower2(x) instead of impl From<i32x4> for f64x2?

@Mottl
Copy link
Contributor Author

Mottl commented Jul 1, 2024

Btw, is there a reason for aarch64 in #[cfg(all(target_feature="neon",target_arch="aarch64"))]?
(compare with #[cfg(target_feature="sse2")]).

@mcroomp
Copy link
Contributor

mcroomp commented Jul 7, 2024

They aren't really simple From since they are potentially lossy... i32 -> f32

@Mottl
Copy link
Contributor Author

Mottl commented Jul 7, 2024

Yes, according to From description you are right. Changed from From impls to ordinary functions.

@Mottl
Copy link
Contributor Author

Mottl commented Jul 21, 2024

@Lokathor, does it look good now?

@Lokathor Lokathor merged commit 7ab90ea into Lokathor:main Jul 21, 2024
22 checks passed
@Lokathor
Copy link
Owner

Released wide-0.7.26

Sorry about the delay! last weekend got unexpectedly busy

@Mottl Mottl deleted the convert branch July 22, 2024 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants