We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3605ad3 commit c70093bCopy full SHA for c70093b
coresimd/x86/cpuid.rs
@@ -78,7 +78,7 @@ pub unsafe fn __cpuid(leaf: u32) -> CpuidResult {
78
}
79
80
/// Does the host support the `cpuid` instruction?
81
-#[inline(never)]
+#[inline]
82
pub fn has_cpuid() -> bool {
83
#[cfg(target_arch = "x86_64")]
84
{
@@ -116,14 +116,15 @@ pub fn has_cpuid() -> bool {
116
# otherwise. All other bits have not been modified and
117
# are zero:
118
xor $0, $1
119
- # Store in $0 the value of the 21st bit
120
- shr $0, 21
121
"#
122
: "=r"(result), "=r"(_temp)
123
:
124
: "cc", "memory"
125
: "intel");
126
+ // Therefore, if result is 0, the bit was not modified and cpuid is
+ // not available. If cpuid is available, the bit was modified and
127
+ // result != 0.
128
result != 0
129
130
0 commit comments