Skip to content

Commit

Permalink
Use mov and xchg instead of movl(q) and xchgl(q)
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov authored and Amanieu committed Sep 8, 2022
1 parent f1db941 commit 3049a31
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/core_arch/src/x86/cpuid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ pub unsafe fn __cpuid_count(leaf: u32, sub_leaf: u32) -> CpuidResult {
#[cfg(target_arch = "x86")]
{
asm!(
"movl {0}, ebx",
"mov {0}, ebx",
"cpuid",
"xchgl {0}, ebx",
"xchg {0}, ebx",
out(reg) ebx,
inout("eax") leaf => eax,
inout("ecx") sub_leaf => ecx,
Expand All @@ -75,9 +75,9 @@ pub unsafe fn __cpuid_count(leaf: u32, sub_leaf: u32) -> CpuidResult {
#[cfg(target_arch = "x86_64")]
{
asm!(
"movq {0:r}, rbx",
"mov {0:r}, rbx",
"cpuid",
"xchgq {0:r}, rbx",
"xchg {0:r}, rbx",
out(reg) ebx,
inout("eax") leaf => eax,
inout("ecx") sub_leaf => ecx,
Expand Down

0 comments on commit 3049a31

Please sign in to comment.