diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2014-01-30 04:48:46 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2014-01-30 04:48:46 +0000 |
commit | ef1d59a1757e1b38b47fa386c74e669b385047fc (patch) | |
tree | c671a36285337ac5abd0c66340c11fb3cf61a404 /llvm/lib/Target/Sparc/SparcInstr64Bit.td | |
parent | 5b630b4e9611a043b8b67a3c47e33348b2b79d77 (diff) | |
download | bcm5719-llvm-ef1d59a1757e1b38b47fa386c74e669b385047fc.tar.gz bcm5719-llvm-ef1d59a1757e1b38b47fa386c74e669b385047fc.zip |
Implement SPARCv9 atomic_swap_64 with a pseudo.
The SWAP instruction only exists in a 32-bit variant, but the 64-bit
atomic swap can be implemented in terms of CASX, like the other atomic
rmw primitives.
llvm-svn: 200453
Diffstat (limited to 'llvm/lib/Target/Sparc/SparcInstr64Bit.td')
-rw-r--r-- | llvm/lib/Target/Sparc/SparcInstr64Bit.td | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Target/Sparc/SparcInstr64Bit.td b/llvm/lib/Target/Sparc/SparcInstr64Bit.td index 5f213342914..9146098a230 100644 --- a/llvm/lib/Target/Sparc/SparcInstr64Bit.td +++ b/llvm/lib/Target/Sparc/SparcInstr64Bit.td @@ -463,6 +463,14 @@ defm ATOMIC_LOAD_MAX : AtomicRMW<atomic_load_max_32, atomic_load_max_64>; defm ATOMIC_LOAD_UMIN : AtomicRMW<atomic_load_umin_32, atomic_load_umin_64>; defm ATOMIC_LOAD_UMAX : AtomicRMW<atomic_load_umax_32, atomic_load_umax_64>; +// There is no 64-bit variant of SWAP, so use a pseudo. +let usesCustomInserter = 1, hasCtrlDep = 1, mayLoad = 1, mayStore = 1, + Defs = [ICC], Predicates = [Is64Bit] in +def ATOMIC_SWAP_64 : Pseudo<(outs I64Regs:$rd), + (ins ptr_rc:$addr, I64Regs:$rs2), "", + [(set i64:$rd, + (atomic_swap_64 iPTR:$addr, i64:$rs2))]>; + // Global addresses, constant pool entries let Predicates = [Is64Bit] in { |