Lokathor / wide

A crate to help you go wide. By which I mean use SIMD stuff.
https://docs.rs/wide
zlib License
251 stars 22 forks source link

Adds conversion functions from integers to floats #164

Closed Mottl closed 1 day ago

Mottl commented 3 weeks ago

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

Lokathor commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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

mcroomp commented 2 weeks ago

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

Mottl commented 2 weeks ago

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

Mottl commented 2 days ago

@Lokathor, does it look good now?

Lokathor commented 1 day ago

Released wide-0.7.26

Sorry about the delay! last weekend got unexpectedly busy