-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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
Metadata
Metadata
Assignees
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.