Skip to content

Commit

Permalink
Revert "counters: use AT&T inline asm syntax for older LLVM."
Browse files Browse the repository at this point in the history
rust LLVM minimum version is now 10

This reverts commit 349183e.
  • Loading branch information
andjo403 committed Oct 3, 2021
1 parent a8eacaa commit 8b8ccfb
Showing 1 changed file with 8 additions and 27 deletions.
35 changes: 8 additions & 27 deletions measureme/src/counters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -542,10 +542,10 @@ mod hw {
} else {
asm!(
// Dummy `cpuid(0)` to serialize instruction execution.
"xor %eax, %eax", // Intel syntax: "xor eax, eax"
"xor eax, eax",
"cpuid",

"mov {rdpmc_ecx:e}, %ecx", // Intel syntax: "mov ecx, {rdpmc_ecx:e}"
"mov ecx, {rdpmc_ecx:e}",
"rdpmc",
rdpmc_ecx = in(reg) reg_idx,
out("eax") lo,
Expand All @@ -556,12 +556,6 @@ mod hw {
out("ecx") _,

options(nostack),

// HACK(eddyb) LLVM 9 and older do not support modifiers
// in Intel syntax inline asm; whenever Rust minimum LLVM
// version becomes LLVM 10, remove and replace above
// instructions with Intel syntax version (from comments).
options(att_syntax),
);
}
}
Expand All @@ -579,14 +573,14 @@ mod hw {
unsafe {
asm!(
// Dummy `cpuid(0)` to serialize instruction execution.
"xor %eax, %eax", // Intel syntax: "xor eax, eax"
"xor eax, eax",
"cpuid",

"mov {a_rdpmc_ecx:e}, %ecx", // Intel syntax: "mov ecx, {a_rdpmc_ecx:e}"
"mov ecx, {a_rdpmc_ecx:e}",
"rdpmc",
"mov %eax, {a_rdpmc_eax:e}", // Intel syntax: "mov {a_rdpmc_eax:e}, eax"
"mov %edx, {a_rdpmc_edx:e}", // Intel syntax: "mov {a_rdpmc_edx:e}, edx"
"mov {b_rdpmc_ecx:e}, %ecx", // Intel syntax: "mov ecx, {b_rdpmc_ecx:e}"
"mov {a_rdpmc_eax:e}, eax",
"mov {a_rdpmc_edx:e}, edx",
"mov ecx, {b_rdpmc_ecx:e}",
"rdpmc",
a_rdpmc_ecx = in(reg) a_reg_idx,
a_rdpmc_eax = out(reg) a_lo,
Expand All @@ -600,12 +594,6 @@ mod hw {
out("ecx") _,

options(nostack),

// HACK(eddyb) LLVM 9 and older do not support modifiers
// in Intel syntax inline asm; whenever Rust minimum LLVM
// version becomes LLVM 10, remove and replace above
// instructions with Intel syntax version (from comments).
options(att_syntax),
);
}
(
Expand Down Expand Up @@ -815,17 +803,10 @@ mod hw {
let mut _tmp: u64 = 0;
unsafe {
asm!(
// Intel syntax: "lock xadd [{atomic}], {tmp}"
"lock xadd {tmp}, ({atomic})",
"lock xadd qword ptr [{atomic}], {tmp}",

atomic = in(reg) &mut atomic,
tmp = inout(reg) _tmp,

// HACK(eddyb) LLVM 9 and older do not support modifiers
// in Intel syntax inline asm; whenever Rust minimum LLVM
// version becomes LLVM 10, remove and replace above
// instructions with Intel syntax version (from comments).
options(att_syntax),
);
}

Expand Down

0 comments on commit 8b8ccfb

Please sign in to comment.