Closed
Description
Viz,
target_feature
does not work for rdrnd
but does work for avx2
(rustc rustc 1.27.0-nightly (ac3c2288f 2018-04-18)
, Mac OS X El Capitan).
This is created with cargo rustc -- -C target-feature=+avx2
#[cfg(all(target_arch = "x86_64", target_feature = "avx2"))]
#[inline(always)]
pub fn generate_hyper_thread_safe_random_u64() -> u64
{
println!("Hello World");
}
However, this is NOT created with cargo rustc -- -C target-feature=+rdrnd
#[cfg(all(target_arch = "x86_64", target_feature = "rdrnd"))]
#[inline(always)]
pub fn generate_hyper_thread_safe_random_u64() -> u64
{
println!("Hello World");
}
ie, changing avx2
for rdrnd
causes the function to not be compiled. Both avx2
and rdnrd
are present inrustc --print target-features