File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ pub unsafe fn __cpuid(leaf: u32) -> CpuidResult {
78
78
}
79
79
80
80
/// Does the host support the `cpuid` instruction?
81
- #[ inline( never ) ]
81
+ #[ inline]
82
82
pub fn has_cpuid ( ) -> bool {
83
83
#[ cfg( target_arch = "x86_64" ) ]
84
84
{
@@ -116,14 +116,15 @@ pub fn has_cpuid() -> bool {
116
116
# otherwise. All other bits have not been modified and
117
117
# are zero:
118
118
xor $0, $1
119
- # Store in $0 the value of the 21st bit
120
- shr $0, 21
121
119
"#
122
120
: "=r" ( result) , "=r" ( _temp)
123
121
:
124
122
: "cc" , "memory"
125
123
: "intel" ) ;
126
124
}
125
+ // Therefore, if result is 0, the bit was not modified and cpuid is
126
+ // not available. If cpuid is available, the bit was modified and
127
+ // result != 0.
127
128
result != 0
128
129
}
129
130
}
You can’t perform that action at this time.
0 commit comments