summaryrefslogtreecommitdiff
path: root/lib/Target/X86/X86InstrInfo.td
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2008-08-19 23:09:18 +0000
committerBill Wendling <isanbard@gmail.com>2008-08-19 23:09:18 +0000
commit108ecf397578946a5f34fc90f22cdd0c9ca4448a (patch)
treee869831aa6509ecacf3aa2406d6c572e7da6397d /lib/Target/X86/X86InstrInfo.td
parentd3aedf445c4c969c2026e3a1cc02265c5eb79a42 (diff)
downloadllvm-108ecf397578946a5f34fc90f22cdd0c9ca4448a.tar.gz
llvm-108ecf397578946a5f34fc90f22cdd0c9ca4448a.tar.bz2
llvm-108ecf397578946a5f34fc90f22cdd0c9ca4448a.tar.xz
Add support for the __sync_sub_and_fetch atomics and friends for X86. The code
was already present, but not hooked up to anything. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55018 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86InstrInfo.td')
-rw-r--r--lib/Target/X86/X86InstrInfo.td16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Target/X86/X86InstrInfo.td b/lib/Target/X86/X86InstrInfo.td
index 37a5fed51c..7b5ee91e9b 100644
--- a/lib/Target/X86/X86InstrInfo.td
+++ b/lib/Target/X86/X86InstrInfo.td
@@ -2634,6 +2634,22 @@ def LXADD8 : I<0xC0, MRMSrcMem, (outs GR8:$dst), (ins i8mem:$ptr, GR8:$val),
TB, LOCK;
}
+// Atomic exchange and subtract
+let Constraints = "$val = $dst", Defs = [EFLAGS] in {
+def LXSUB32 : I<0xC1, MRMSrcMem, (outs GR32:$dst), (ins i32mem:$ptr, GR32:$val),
+ "lock\n\txadd{l}\t{$val, $ptr|$ptr, $val}",
+ [(set GR32:$dst, (atomic_load_sub_32 addr:$ptr, GR32:$val))]>,
+ TB, LOCK;
+def LXSUB16 : I<0xC1, MRMSrcMem, (outs GR16:$dst), (ins i16mem:$ptr, GR16:$val),
+ "lock\n\txadd{w}\t{$val, $ptr|$ptr, $val}",
+ [(set GR16:$dst, (atomic_load_sub_16 addr:$ptr, GR16:$val))]>,
+ TB, OpSize, LOCK;
+def LXSUB8 : I<0xC0, MRMSrcMem, (outs GR8:$dst), (ins i8mem:$ptr, GR8:$val),
+ "lock\n\txadd{b}\t{$val, $ptr|$ptr, $val}",
+ [(set GR8:$dst, (atomic_load_sub_8 addr:$ptr, GR8:$val))]>,
+ TB, LOCK;
+}
+
// Atomic exchange, and, or, xor
let Constraints = "$val = $dst", Defs = [EFLAGS],
usesCustomDAGSchedInserter = 1 in {