Skip to content

Commit

Permalink
Use :e registers on x86
Browse files Browse the repository at this point in the history
  • Loading branch information
coolreader18 committed Nov 11, 2021
1 parent 4c561d8 commit f16d8d3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/elision.rs
Expand Up @@ -56,6 +56,16 @@ impl AtomicElisionExt for AtomicUsize {
fn elision_compare_exchange_acquire(&self, current: usize, new: usize) -> Result<usize, usize> {
unsafe {
let prev: usize;
#[cfg(target_pointer_width = "32")]
asm!(
"xacquire",
"lock",
"cmpxchg [{:e}], {:e}",
in(reg) self,
in(reg) new,
inout("eax") current => prev,
);
#[cfg(target_pointer_width = "64")]
asm!(
"xacquire",
"lock",
Expand Down

0 comments on commit f16d8d3

Please sign in to comment.