Skip to content

Commit 8b8ccfb

Browse files
committed
Revert "counters: use AT&T inline asm syntax for older LLVM."
rust LLVM minimum version is now 10 This reverts commit 349183e.
1 parent a8eacaa commit 8b8ccfb

File tree

1 file changed

+8
-27
lines changed

1 file changed

+8
-27
lines changed

measureme/src/counters.rs

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -542,10 +542,10 @@ mod hw {
542542
} else {
543543
asm!(
544544
// Dummy `cpuid(0)` to serialize instruction execution.
545-
"xor %eax, %eax", // Intel syntax: "xor eax, eax"
545+
"xor eax, eax",
546546
"cpuid",
547547

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

558558
options(nostack),
559-
560-
// HACK(eddyb) LLVM 9 and older do not support modifiers
561-
// in Intel syntax inline asm; whenever Rust minimum LLVM
562-
// version becomes LLVM 10, remove and replace above
563-
// instructions with Intel syntax version (from comments).
564-
options(att_syntax),
565559
);
566560
}
567561
}
@@ -579,14 +573,14 @@ mod hw {
579573
unsafe {
580574
asm!(
581575
// Dummy `cpuid(0)` to serialize instruction execution.
582-
"xor %eax, %eax", // Intel syntax: "xor eax, eax"
576+
"xor eax, eax",
583577
"cpuid",
584578

585-
"mov {a_rdpmc_ecx:e}, %ecx", // Intel syntax: "mov ecx, {a_rdpmc_ecx:e}"
579+
"mov ecx, {a_rdpmc_ecx:e}",
586580
"rdpmc",
587-
"mov %eax, {a_rdpmc_eax:e}", // Intel syntax: "mov {a_rdpmc_eax:e}, eax"
588-
"mov %edx, {a_rdpmc_edx:e}", // Intel syntax: "mov {a_rdpmc_edx:e}, edx"
589-
"mov {b_rdpmc_ecx:e}, %ecx", // Intel syntax: "mov ecx, {b_rdpmc_ecx:e}"
581+
"mov {a_rdpmc_eax:e}, eax",
582+
"mov {a_rdpmc_edx:e}, edx",
583+
"mov ecx, {b_rdpmc_ecx:e}",
590584
"rdpmc",
591585
a_rdpmc_ecx = in(reg) a_reg_idx,
592586
a_rdpmc_eax = out(reg) a_lo,
@@ -600,12 +594,6 @@ mod hw {
600594
out("ecx") _,
601595

602596
options(nostack),
603-
604-
// HACK(eddyb) LLVM 9 and older do not support modifiers
605-
// in Intel syntax inline asm; whenever Rust minimum LLVM
606-
// version becomes LLVM 10, remove and replace above
607-
// instructions with Intel syntax version (from comments).
608-
options(att_syntax),
609597
);
610598
}
611599
(
@@ -815,17 +803,10 @@ mod hw {
815803
let mut _tmp: u64 = 0;
816804
unsafe {
817805
asm!(
818-
// Intel syntax: "lock xadd [{atomic}], {tmp}"
819-
"lock xadd {tmp}, ({atomic})",
806+
"lock xadd qword ptr [{atomic}], {tmp}",
820807

821808
atomic = in(reg) &mut atomic,
822809
tmp = inout(reg) _tmp,
823-
824-
// HACK(eddyb) LLVM 9 and older do not support modifiers
825-
// in Intel syntax inline asm; whenever Rust minimum LLVM
826-
// version becomes LLVM 10, remove and replace above
827-
// instructions with Intel syntax version (from comments).
828-
options(att_syntax),
829810
);
830811
}
831812

0 commit comments

Comments
 (0)