Lokathor / wide

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

Fix compile error on targets with sse4.1 and no avx2 #63

Closed nathanvoglsam closed 4 years ago

nathanvoglsam commented 4 years ago

It appears I've found a little copy-paste error created at some point in time. I'm guessing most developers for this crate are on new enough hardware that they have avx2. My crate builds with rustflags = ["-C", "target-cpu=sandybridge"] as I target hardware with sse4.1 and AVX, but not AVX2, and pulling in ultraviolet triggered a compilation error in this crate.

I'm assuming this is the correct behavior for the function, please correct me if I'm wrong but the snippet:

Self { sse: blend_varying_i8_m128i(f.sse, t.sse, self.sse),  sse: blend_varying_i8_m128i(f.sse, t.sse, self.sse) }

Should actually be:

Self { sse0: blend_varying_i8_m128i(f.sse0, t.sse0, self.sse0),  sse1: blend_varying_i8_m128i(f.sse1, t.sse1, self.sse1) }

Easy fix either way, hopefully it can get through quickly so I can go back to using a cargo release of ultraviolet

Lokathor commented 4 years ago

Ah, yes. It is a little cumbersome to test every feature level so sadly a few breaks do slip in. At least they're usually this obvious when it happens.

Lokathor commented 4 years ago

released as 0.5.5