summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly/WebAssemblyInstrAtomics.td
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyInstrAtomics.td')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyInstrAtomics.td13
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrAtomics.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrAtomics.td
index fd50f59c44b..355802f760b 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrAtomics.td
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrAtomics.td
@@ -18,16 +18,17 @@
let Defs = [ARGUMENTS] in {
// TODO: add the rest of the atomic loads
-// TODO: factor out 0xfe atomic prefix?
-def ATOMIC_LOAD_I32 : ATOMIC_I<(outs I32:$dst),
- (ins P2Align:$p2align, offset32_op:$off, I32:$addr),
- [], "i32.atomic.load\t$dst, ${off}(${addr})${p2align}",
- 0xfe10>;
+def ATOMIC_LOAD_I32 : CLoadI32<"i32.atomic.load", 0xfe10>;
+def ATOMIC_LOAD_I64 : CLoadI64<"i64.atomic.load", 0xfe11>;
} // Defs = [ARGUMENTS]
// Select loads with no constant offset.
let Predicates = [HasAtomics] in {
-def : Pat<(i32 (atomic_load I32:$addr)), (ATOMIC_LOAD_I32 0, 0, $addr)>;
+class ALoadPatNoOffset<ValueType ty, SDNode node, I inst> :
+ Pat<(ty (node I32:$addr)), (inst 0, 0, $addr)>;
+def : ALoadPatNoOffset<i32, atomic_load, ATOMIC_LOAD_I32>;
+def : ALoadPatNoOffset<i64, atomic_load, ATOMIC_LOAD_I64>;
+
}
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud