r194513 - add intrinsics: __builtin_arm_{dmb,dsb} for ARM
Weiming Zhao
weimingz at codeaurora.org
Tue Nov 12 13:42:50 PST 2013
Author: weimingz
Date: Tue Nov 12 15:42:50 2013
New Revision: 194513
URL: http://llvm.org/viewvc/llvm-project?rev=194513&view=rev
Log:
add intrinsics: __builtin_arm_{dmb,dsb} for ARM
Modified:
cfe/trunk/include/clang/Basic/BuiltinsARM.def
cfe/trunk/lib/Sema/SemaChecking.cpp
cfe/trunk/test/CodeGen/builtins-arm.c
Modified: cfe/trunk/include/clang/Basic/BuiltinsARM.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsARM.def?rev=194513&r1=194512&r2=194513&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/BuiltinsARM.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsARM.def Tue Nov 12 15:42:50 2013
@@ -61,6 +61,10 @@ BUILTIN(__builtin_arm_crc32cd, "UiUiLLUi
// HINT
BUILTIN(__builtin_arm_sevl, "v", "")
+// Data barrier
+BUILTIN(__builtin_arm_dmb, "vUi", "nc")
+BUILTIN(__builtin_arm_dsb, "vUi", "nc")
+
// NEON
#define GET_NEON_BUILTINS
#include "clang/Basic/arm_neon.inc"
Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=194513&r1=194512&r2=194513&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Tue Nov 12 15:42:50 2013
@@ -624,6 +624,8 @@ bool Sema::CheckARMBuiltinFunctionCall(u
case ARM::BI__builtin_arm_usat: i = 1; u = 31; break;
case ARM::BI__builtin_arm_vcvtr_f:
case ARM::BI__builtin_arm_vcvtr_d: i = 1; u = 1; break;
+ case ARM::BI__builtin_arm_dmb:
+ case ARM::BI__builtin_arm_dsb: l = 0; u = 15; break;
#define GET_NEON_IMMEDIATE_CHECK
#include "clang/Basic/arm_neon.inc"
#undef GET_NEON_IMMEDIATE_CHECK
Modified: cfe/trunk/test/CodeGen/builtins-arm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/builtins-arm.c?rev=194513&r1=194512&r2=194513&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/builtins-arm.c (original)
+++ cfe/trunk/test/CodeGen/builtins-arm.c Tue Nov 12 15:42:50 2013
@@ -22,5 +22,9 @@ void test_eh_return_data_regno()
void sevl() {
__builtin_arm_sevl();
}
-
// CHECK: call {{.*}} @llvm.arm.sevl
+
+void test_barrier() {
+ __builtin_arm_dmb(1); //CHECK: call {{.*}} @llvm.arm.dmb(i32 1)
+ __builtin_arm_dsb(2); //CHECK: call {{.*}} @llvm.arm.dsb(i32 2)
+}
More information about the cfe-commits
mailing list