[llvm-commits] [dragonegg] r92696 - /dragonegg/trunk/llvm-convert.cpp
Duncan Sands
baldrick at free.fr
Mon Jan 4 22:59:52 PST 2010
Author: baldrick
Date: Tue Jan 5 00:59:52 2010
New Revision: 92696
URL: http://llvm.org/viewvc/llvm-project?rev=92696&view=rev
Log:
Port commit 91336 (grosbach) from llvm-gcc:
Enable atomic builtins for ARM
Modified:
dragonegg/trunk/llvm-convert.cpp
Modified: dragonegg/trunk/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-convert.cpp?rev=92696&r1=92695&r2=92696&view=diff
==============================================================================
--- dragonegg/trunk/llvm-convert.cpp (original)
+++ dragonegg/trunk/llvm-convert.cpp Tue Jan 5 00:59:52 2010
@@ -4681,7 +4681,8 @@
C, C + 5);
return true;
}
-#if defined(TARGET_ALPHA) || defined(TARGET_386) || defined(TARGET_POWERPC)
+#if defined(TARGET_ALPHA) || defined(TARGET_386) || defined(TARGET_POWERPC) \
+ || defined(TARGET_ARM)
// gcc uses many names for the sync intrinsics
// The type of the first argument is not reliable for choosing the
// right llvm function; if the original type is not volatile, gcc has
@@ -4692,18 +4693,33 @@
// Note that Intrinsic::getDeclaration expects the type list in reversed
// order, while CreateCall expects the parameter list in normal order.
case BUILT_IN_BOOL_COMPARE_AND_SWAP_1: {
+#if defined(TARGET_ARM)
+ if (TARGET_THUMB1 || !arm_arch6)
+ return false;
+#endif
Result = BuildCmpAndSwapAtomicBuiltin(stmt, unsigned_char_type_node, true);
return true;
}
case BUILT_IN_BOOL_COMPARE_AND_SWAP_2: {
+#if defined(TARGET_ARM)
+ if (TARGET_THUMB1 || !arm_arch6)
+ return false;
+#endif
Result = BuildCmpAndSwapAtomicBuiltin(stmt, short_unsigned_type_node, true);
return true;
}
case BUILT_IN_BOOL_COMPARE_AND_SWAP_4: {
+#if defined(TARGET_ARM)
+ if (TARGET_THUMB1 || !arm_arch6)
+ return false;
+#endif
Result = BuildCmpAndSwapAtomicBuiltin(stmt, unsigned_type_node, true);
return true;
}
case BUILT_IN_BOOL_COMPARE_AND_SWAP_8: {
+#if defined(TARGET_ARM)
+ return false;
+#endif
#if defined(TARGET_POWERPC)
if (!TARGET_64BIT)
return false;
@@ -4714,6 +4730,9 @@
}
case BUILT_IN_VAL_COMPARE_AND_SWAP_8:
+#if defined(TARGET_ARM)
+ return false;
+#endif
#if defined(TARGET_POWERPC)
if (!TARGET_64BIT)
return false;
@@ -4721,11 +4740,19 @@
case BUILT_IN_VAL_COMPARE_AND_SWAP_1:
case BUILT_IN_VAL_COMPARE_AND_SWAP_2:
case BUILT_IN_VAL_COMPARE_AND_SWAP_4: {
+#if defined(TARGET_ARM)
+ if (TARGET_THUMB1 || !arm_arch6)
+ return false;
+#endif
tree type = gimple_call_return_type(stmt);
Result = BuildCmpAndSwapAtomicBuiltin(stmt, type, false);
return true;
}
case BUILT_IN_FETCH_AND_ADD_8:
+#if defined(TARGET_ARM)
+ if (TARGET_THUMB1 || !arm_arch6)
+ return false;
+#endif
#if defined(TARGET_POWERPC)
if (!TARGET_64BIT)
return false;
@@ -4737,6 +4764,9 @@
return true;
}
case BUILT_IN_FETCH_AND_SUB_8:
+#if defined(TARGET_ARM)
+ return false;
+#endif
#if defined(TARGET_POWERPC)
if (!TARGET_64BIT)
return false;
@@ -4744,10 +4774,17 @@
case BUILT_IN_FETCH_AND_SUB_1:
case BUILT_IN_FETCH_AND_SUB_2:
case BUILT_IN_FETCH_AND_SUB_4: {
+#if defined(TARGET_ARM)
+ if (TARGET_THUMB1 || !arm_arch6)
+ return false;
+#endif
Result = BuildBinaryAtomicBuiltin(stmt, Intrinsic::atomic_load_sub);
return true;
}
case BUILT_IN_FETCH_AND_OR_8:
+#if defined(TARGET_ARM)
+ return false;
+#endif
#if defined(TARGET_POWERPC)
if (!TARGET_64BIT)
return false;
@@ -4755,10 +4792,17 @@
case BUILT_IN_FETCH_AND_OR_1:
case BUILT_IN_FETCH_AND_OR_2:
case BUILT_IN_FETCH_AND_OR_4: {
+#if defined(TARGET_ARM)
+ if (TARGET_THUMB1 || !arm_arch6)
+ return false;
+#endif
Result = BuildBinaryAtomicBuiltin(stmt, Intrinsic::atomic_load_or);
return true;
}
case BUILT_IN_FETCH_AND_AND_8:
+#if defined(TARGET_ARM)
+ return false;
+#endif
#if defined(TARGET_POWERPC)
if (!TARGET_64BIT)
return false;
@@ -4766,10 +4810,17 @@
case BUILT_IN_FETCH_AND_AND_1:
case BUILT_IN_FETCH_AND_AND_2:
case BUILT_IN_FETCH_AND_AND_4: {
+#if defined(TARGET_ARM)
+ if (TARGET_THUMB1 || !arm_arch6)
+ return false;
+#endif
Result = BuildBinaryAtomicBuiltin(stmt, Intrinsic::atomic_load_and);
return true;
}
case BUILT_IN_FETCH_AND_XOR_8:
+#if defined(TARGET_ARM)
+ return false;
+#endif
#if defined(TARGET_POWERPC)
if (!TARGET_64BIT)
return false;
@@ -4777,10 +4828,17 @@
case BUILT_IN_FETCH_AND_XOR_1:
case BUILT_IN_FETCH_AND_XOR_2:
case BUILT_IN_FETCH_AND_XOR_4: {
+#if defined(TARGET_ARM)
+ if (TARGET_THUMB1 || !arm_arch6)
+ return false;
+#endif
Result = BuildBinaryAtomicBuiltin(stmt, Intrinsic::atomic_load_xor);
return true;
}
case BUILT_IN_FETCH_AND_NAND_8:
+#if defined(TARGET_ARM)
+ return false;
+#endif
#if defined(TARGET_POWERPC)
if (!TARGET_64BIT)
return false;
@@ -4788,10 +4846,17 @@
case BUILT_IN_FETCH_AND_NAND_1:
case BUILT_IN_FETCH_AND_NAND_2:
case BUILT_IN_FETCH_AND_NAND_4: {
+#if defined(TARGET_ARM)
+ if (TARGET_THUMB1 || !arm_arch6)
+ return false;
+#endif
Result = BuildBinaryAtomicBuiltin(stmt, Intrinsic::atomic_load_nand);
return true;
}
case BUILT_IN_LOCK_TEST_AND_SET_8:
+#if defined(TARGET_ARM)
+ return false;
+#endif
#if defined(TARGET_POWERPC)
if (!TARGET_64BIT)
return false;
@@ -4799,11 +4864,18 @@
case BUILT_IN_LOCK_TEST_AND_SET_1:
case BUILT_IN_LOCK_TEST_AND_SET_2:
case BUILT_IN_LOCK_TEST_AND_SET_4: {
+#if defined(TARGET_ARM)
+ if (TARGET_THUMB1 || !arm_arch6)
+ return false;
+#endif
Result = BuildBinaryAtomicBuiltin(stmt, Intrinsic::atomic_swap);
return true;
}
case BUILT_IN_ADD_AND_FETCH_8:
+#if defined(TARGET_ARM)
+ return false;
+#endif
#if defined(TARGET_POWERPC)
if (!TARGET_64BIT)
return false;
@@ -4811,6 +4883,10 @@
case BUILT_IN_ADD_AND_FETCH_1:
case BUILT_IN_ADD_AND_FETCH_2:
case BUILT_IN_ADD_AND_FETCH_4: {
+#if defined(TARGET_ARM)
+ if (TARGET_THUMB1 || !arm_arch6)
+ return false;
+#endif
tree return_type = gimple_call_return_type(stmt);
const Type *ResultTy = ConvertType(return_type);
Value* C[2] = {
@@ -4844,6 +4920,9 @@
return true;
}
case BUILT_IN_SUB_AND_FETCH_8:
+#if defined(TARGET_ARM)
+ return false;
+#endif
#if defined(TARGET_POWERPC)
if (!TARGET_64BIT)
return false;
@@ -4851,6 +4930,10 @@
case BUILT_IN_SUB_AND_FETCH_1:
case BUILT_IN_SUB_AND_FETCH_2:
case BUILT_IN_SUB_AND_FETCH_4: {
+#if defined(TARGET_ARM)
+ if (TARGET_THUMB1 || !arm_arch6)
+ return false;
+#endif
tree return_type = gimple_call_return_type(stmt);
const Type *ResultTy = ConvertType(return_type);
Value* C[2] = {
@@ -4884,6 +4967,9 @@
return true;
}
case BUILT_IN_OR_AND_FETCH_8:
+#if defined(TARGET_ARM)
+ return false;
+#endif
#if defined(TARGET_POWERPC)
if (!TARGET_64BIT)
return false;
@@ -4891,6 +4977,10 @@
case BUILT_IN_OR_AND_FETCH_1:
case BUILT_IN_OR_AND_FETCH_2:
case BUILT_IN_OR_AND_FETCH_4: {
+#if defined(TARGET_ARM)
+ if (TARGET_THUMB1 || !arm_arch6)
+ return false;
+#endif
tree return_type = gimple_call_return_type(stmt);
const Type *ResultTy = ConvertType(return_type);
Value* C[2] = {
@@ -4931,6 +5021,10 @@
case BUILT_IN_AND_AND_FETCH_1:
case BUILT_IN_AND_AND_FETCH_2:
case BUILT_IN_AND_AND_FETCH_4: {
+#if defined(TARGET_ARM)
+ if (TARGET_THUMB1 || !arm_arch6)
+ return false;
+#endif
tree return_type = gimple_call_return_type(stmt);
const Type *ResultTy = ConvertType(return_type);
Value* C[2] = {
@@ -4964,6 +5058,9 @@
return true;
}
case BUILT_IN_XOR_AND_FETCH_8:
+#if defined(TARGET_ARM)
+ return false;
+#endif
#if defined(TARGET_POWERPC)
if (!TARGET_64BIT)
return false;
@@ -4971,6 +5068,10 @@
case BUILT_IN_XOR_AND_FETCH_1:
case BUILT_IN_XOR_AND_FETCH_2:
case BUILT_IN_XOR_AND_FETCH_4: {
+#if defined(TARGET_ARM)
+ if (TARGET_THUMB1 || !arm_arch6)
+ return false;
+#endif
tree return_type = gimple_call_return_type(stmt);
const Type *ResultTy = ConvertType(return_type);
Value* C[2] = {
@@ -5004,6 +5105,9 @@
return true;
}
case BUILT_IN_NAND_AND_FETCH_8:
+#if defined(TARGET_ARM)
+ return false;
+#endif
#if defined(TARGET_POWERPC)
if (!TARGET_64BIT)
return false;
@@ -5011,6 +5115,10 @@
case BUILT_IN_NAND_AND_FETCH_1:
case BUILT_IN_NAND_AND_FETCH_2:
case BUILT_IN_NAND_AND_FETCH_4: {
+#if defined(TARGET_ARM)
+ if (TARGET_THUMB1 || !arm_arch6)
+ return false;
+#endif
tree return_type = gimple_call_return_type(stmt);
const Type *ResultTy = ConvertType(return_type);
Value* C[2] = {
More information about the llvm-commits
mailing list