Skip to content

Commit

Permalink
Merge pull request #188 from andjo403/new_at_and_t
Browse files Browse the repository at this point in the history
counters: use AT&T inline asm syntax for older LLVM.
  • Loading branch information
eddyb authored Oct 6, 2021
2 parents 1d904b7 + 98afa6e commit 6320316
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion measureme/src/counters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -805,10 +805,18 @@ mod hw {
let mut _tmp: u64 = 0;
unsafe {
asm!(
"lock xadd qword ptr [{atomic}], {tmp}",
// Intel syntax: "lock xadd [{atomic}], {tmp}"
"lock xadd {tmp}, ({atomic})",

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

// Older versions of LLVM do not support modifiers in
// Intel syntax inline asm; whenever Rust minimum LLVM
// version supports Intel syntax inline asm, remove
// and replace above instructions with Intel syntax
// version (from comments).
options(att_syntax),
);
}

Expand Down

0 comments on commit 6320316

Please sign in to comment.