From a84c619bf34161fff5b2dbed763dc84381ac0d10 Mon Sep 17 00:00:00 2001 From: gnzlbg Date: Sun, 24 Jun 2018 11:57:20 +0200 Subject: [PATCH] remove unnecessary shift --- library/stdarch/coresimd/x86/cpuid.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/library/stdarch/coresimd/x86/cpuid.rs b/library/stdarch/coresimd/x86/cpuid.rs index b708542c394c..72d68e71f429 100644 --- a/library/stdarch/coresimd/x86/cpuid.rs +++ b/library/stdarch/coresimd/x86/cpuid.rs @@ -78,7 +78,7 @@ pub unsafe fn __cpuid(leaf: u32) -> CpuidResult { } /// Does the host support the `cpuid` instruction? -#[inline(never)] +#[inline] pub fn has_cpuid() -> bool { #[cfg(target_arch = "x86_64")] { @@ -116,14 +116,15 @@ pub fn has_cpuid() -> bool { # otherwise. All other bits have not been modified and # are zero: xor $0, $1 - # Store in $0 the value of the 21st bit - shr $0, 21 "# : "=r"(result), "=r"(_temp) : : "cc", "memory" : "intel"); } + // Therefore, if result is 0, the bit was not modified and cpuid is + // not available. If cpuid is available, the bit was modified and + // result != 0. result != 0 } }