summaryrefslogtreecommitdiff
path: root/lib/Target/R600
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2014-06-11 18:08:42 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2014-06-11 18:08:42 +0000
commit2da1a85cbb5769ea813391b5f3e552d8ac69968f (patch)
tree949c4e9e12513c15bf12e0d9495873aff428c08f /lib/Target/R600
parent507d8cad7ba901fbd068e980c7203497156221c8 (diff)
downloadllvm-2da1a85cbb5769ea813391b5f3e552d8ac69968f.tar.gz
llvm-2da1a85cbb5769ea813391b5f3e552d8ac69968f.tar.bz2
llvm-2da1a85cbb5769ea813391b5f3e552d8ac69968f.tar.xz
R600/SI: Add other LDS atomic operations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210676 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/R600')
-rw-r--r--lib/Target/R600/SIInstructions.td15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/Target/R600/SIInstructions.td b/lib/Target/R600/SIInstructions.td
index bbe62a9dae..a00a8ba947 100644
--- a/lib/Target/R600/SIInstructions.td
+++ b/lib/Target/R600/SIInstructions.td
@@ -2210,7 +2210,7 @@ defm : DSWritePat <DS_WRITE_B16, i32, truncstorei16_local>;
defm : DSWritePat <DS_WRITE_B32, i32, local_store>;
defm : DSWritePat <DS_WRITE_B64, i64, local_store>;
-multiclass DSAtomicPat<DS inst, ValueType vt, PatFrag frag> {
+multiclass DSAtomicRetPat<DS inst, ValueType vt, PatFrag frag> {
def : Pat <
(frag (add i32:$ptr, (i32 IMM16bit:$offset)), vt:$value),
(inst (i1 0), $ptr, $value, (as_i16imm $offset))
@@ -2222,8 +2222,17 @@ multiclass DSAtomicPat<DS inst, ValueType vt, PatFrag frag> {
>;
}
-defm : DSAtomicPat<DS_ADD_RTN_U32, i32, atomic_load_add_local>;
-defm : DSAtomicPat<DS_SUB_RTN_U32, i32, atomic_load_sub_local>;
+defm : DSAtomicRetPat<DS_WRXCHG_RTN_B32, i32, atomic_swap_local>;
+defm : DSAtomicRetPat<DS_ADD_RTN_U32, i32, atomic_load_add_local>;
+defm : DSAtomicRetPat<DS_SUB_RTN_U32, i32, atomic_load_sub_local>;
+defm : DSAtomicRetPat<DS_AND_RTN_B32, i32, atomic_load_and_local>;
+defm : DSAtomicRetPat<DS_OR_RTN_B32, i32, atomic_load_or_local>;
+defm : DSAtomicRetPat<DS_XOR_RTN_B32, i32, atomic_load_xor_local>;
+defm : DSAtomicRetPat<DS_MIN_RTN_I32, i32, atomic_load_min_local>;
+defm : DSAtomicRetPat<DS_MAX_RTN_I32, i32, atomic_load_max_local>;
+defm : DSAtomicRetPat<DS_MIN_RTN_U32, i32, atomic_load_umin_local>;
+defm : DSAtomicRetPat<DS_MAX_RTN_U32, i32, atomic_load_umax_local>;
+
//===----------------------------------------------------------------------===//
// MUBUF Patterns