mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-19 19:40:36 +00:00

* fix build after stabilization of cfg_target_feature and target_feature * fix doc tests * fix spurious unused_attributes warning * fix more unused attribute warnings * More unnecessary target features * Remove no longer needed trait imports * Remove fixed upstream workarounds * Fix parsing the #[assert_instr] macro Following upstream proc_macro changes * Fix form and parsing of #[simd_test] * Don't use Cargo features for testing modes Instead use RUSTFLAGS with `--cfg`. This'll help us be compatible with the latest Cargo where a tweak to workspaces and features made the previous invocations we had invalid. * Don't thread RUSTFLAGS through docker * Re-gate on x86 verification Closes #411
93 lines
2.7 KiB
Rust
93 lines
2.7 KiB
Rust
#![feature(stdsimd)]
|
|
#![cfg_attr(stdsimd_strict, deny(warnings))]
|
|
#![cfg_attr(feature = "cargo-clippy",
|
|
allow(option_unwrap_used, print_stdout, use_debug))]
|
|
|
|
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
|
|
#[macro_use]
|
|
extern crate stdsimd;
|
|
|
|
#[test]
|
|
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
|
|
fn x86_all() {
|
|
println!("sse: {:?}", is_x86_feature_detected!("sse"));
|
|
println!("sse2: {:?}", is_x86_feature_detected!("sse2"));
|
|
println!("sse3: {:?}", is_x86_feature_detected!("sse3"));
|
|
println!("ssse3: {:?}", is_x86_feature_detected!("ssse3"));
|
|
println!(
|
|
"sse4.1: {:?}",
|
|
is_x86_feature_detected!("sse4.1")
|
|
);
|
|
println!(
|
|
"sse4.2: {:?}",
|
|
is_x86_feature_detected!("sse4.2")
|
|
);
|
|
println!("sse4a: {:?}", is_x86_feature_detected!("sse4a"));
|
|
println!("avx: {:?}", is_x86_feature_detected!("avx"));
|
|
println!("avx2: {:?}", is_x86_feature_detected!("avx2"));
|
|
println!(
|
|
"avx512f {:?}",
|
|
is_x86_feature_detected!("avx512f")
|
|
);
|
|
println!(
|
|
"avx512cd {:?}",
|
|
is_x86_feature_detected!("avx512cd")
|
|
);
|
|
println!(
|
|
"avx512er {:?}",
|
|
is_x86_feature_detected!("avx512er")
|
|
);
|
|
println!(
|
|
"avx512pf {:?}",
|
|
is_x86_feature_detected!("avx512pf")
|
|
);
|
|
println!(
|
|
"avx512bw {:?}",
|
|
is_x86_feature_detected!("avx512bw")
|
|
);
|
|
println!(
|
|
"avx512dq {:?}",
|
|
is_x86_feature_detected!("avx512dq")
|
|
);
|
|
println!(
|
|
"avx512vl {:?}",
|
|
is_x86_feature_detected!("avx512vl")
|
|
);
|
|
println!(
|
|
"avx512_ifma {:?}",
|
|
is_x86_feature_detected!("avx512ifma")
|
|
);
|
|
println!(
|
|
"avx512_vbmi {:?}",
|
|
is_x86_feature_detected!("avx512vbmi")
|
|
);
|
|
println!(
|
|
"avx512_vpopcntdq {:?}",
|
|
is_x86_feature_detected!("avx512vpopcntdq")
|
|
);
|
|
println!("fma: {:?}", is_x86_feature_detected!("fma"));
|
|
println!("abm: {:?}", is_x86_feature_detected!("abm"));
|
|
println!("bmi: {:?}", is_x86_feature_detected!("bmi1"));
|
|
println!("bmi2: {:?}", is_x86_feature_detected!("bmi2"));
|
|
println!("tbm: {:?}", is_x86_feature_detected!("tbm"));
|
|
println!(
|
|
"popcnt: {:?}",
|
|
is_x86_feature_detected!("popcnt")
|
|
);
|
|
println!("lzcnt: {:?}", is_x86_feature_detected!("lzcnt"));
|
|
println!("fxsr: {:?}", is_x86_feature_detected!("fxsr"));
|
|
println!("xsave: {:?}", is_x86_feature_detected!("xsave"));
|
|
println!(
|
|
"xsaveopt: {:?}",
|
|
is_x86_feature_detected!("xsaveopt")
|
|
);
|
|
println!(
|
|
"xsaves: {:?}",
|
|
is_x86_feature_detected!("xsaves")
|
|
);
|
|
println!(
|
|
"xsavec: {:?}",
|
|
is_x86_feature_detected!("xsavec")
|
|
);
|
|
}
|