Closed
Description
This is due to a known issue (rust-lang/rust#44367), but it's pretty confusing.
#![feature(target_feature)]
extern crate stdsimd;
use stdsimd::simd::u32x8;
fn main() {
foo();
}
#[target_feature = "+avx2"]
fn foo() {
let p = u32x8::new(0, 1, 2, 3, 4, 5, 6, 7);
println!("{:?}", p);
}
$ cargo +nightly run
Compiling foo v0.1.0 (file:///Users/sfackler/foo)
Finished dev [unoptimized + debuginfo] target(s) in 0.32 secs
Running `target/debug/foo`
u32x8(0, 1, 2, 3, 0, 0, 0, 0)
$ cargo +nightly run --release
Compiling stdsimd v0.0.2 (https://github.com/rust-lang-nursery/stdsimd#6fdfce52)
Compiling foo v0.1.0 (file:///Users/sfackler/foo)
Finished release [optimized] target(s) in 4.43 secs
Running `target/release/foo`
u32x8(0, 1, 2, 3, 4, 5, 6, 7)
Switching p
to a static with #137 makes everything work.
Metadata
Metadata
Assignees
Labels
No labels