aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-06-18 23:03:10 +0000
committerJim Grosbach <grosbach@apple.com>2010-06-18 23:03:10 +0000
commitdd67159ea024c078f6c9f3c41bc400b1f3f2f6e1 (patch)
treeeb274c405a8619ac88d34133a8a24a0667289388 /lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
parent0c8db20bf20977226461d8cd4c6047e17f6c2cf5 (diff)
downloadexternal_llvm-dd67159ea024c078f6c9f3c41bc400b1f3f2f6e1.zip
external_llvm-dd67159ea024c078f6c9f3c41bc400b1f3f2f6e1.tar.gz
external_llvm-dd67159ea024c078f6c9f3c41bc400b1f3f2f6e1.tar.bz2
back-end libcall handling for ATOMIC_SWAP (__sync_lock_test_and_set)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106342 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeDAG.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 70822b7..f360a01 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -2399,6 +2399,15 @@ std::pair <SDValue, SDValue> SelectionDAGLegalize::ExpandAtomic(SDNode *Node) {
default:
llvm_unreachable("Unhandled atomic intrinsic Expand!");
break;
+ case ISD::ATOMIC_SWAP:
+ switch (VT.SimpleTy) {
+ default: llvm_unreachable("Unexpected value type for atomic!");
+ case MVT::i8: LC = RTLIB::SYNC_LOCK_TEST_AND_SET_1; break;
+ case MVT::i16: LC = RTLIB::SYNC_LOCK_TEST_AND_SET_2; break;
+ case MVT::i32: LC = RTLIB::SYNC_LOCK_TEST_AND_SET_4; break;
+ case MVT::i64: LC = RTLIB::SYNC_LOCK_TEST_AND_SET_8; break;
+ }
+ break;
case ISD::ATOMIC_CMP_SWAP:
switch (VT.SimpleTy) {
default: llvm_unreachable("Unexpected value type for atomic!");