| diff --git a/src/stdarch/crates/core_arch/src/x86/cpuid.rs b/src/stdarch/crates/core_arch/src/x86/cpuid.rs |
| index f313c428..222a72ae 100644 |
| --- a/src/stdarch/crates/core_arch/src/x86/cpuid.rs |
| +++ b/src/stdarch/crates/core_arch/src/x86/cpuid.rs |
| @@ -65,10 +65,14 @@ pub unsafe fn __cpuid_count(leaf: u32, sub_leaf: u32) -> CpuidResult { |
| #[cfg(target_arch = "x86_64")] |
| { |
| // x86-64 uses %rbx as the base register, so preserve it. |
| - llvm_asm!("cpuid" |
| - : "={eax}"(eax), "={ebx}"(ebx), "={ecx}"(ecx), "={edx}"(edx) |
| + llvm_asm!(r#" |
| + mov %rbx, %rsi |
| + cpuid |
| + xchg %rbx, %rsi |
| + "# |
| + : "={eax}"(eax), "={esi}"(ebx), "={ecx}"(ecx), "={edx}"(edx) |
| : "{eax}"(leaf), "{ecx}"(sub_leaf) |
| - : "rbx" :); |
| + : :); |
| } |
| CpuidResult { eax, ebx, ecx, edx } |
| } |