r216453 - arm_acle: Add mappings for dbg intrinsic

Yi Kong Yi.Kong at arm.com
Tue Aug 26 05:48:11 PDT 2014


Author: kongyi
Date: Tue Aug 26 07:48:11 2014
New Revision: 216453

URL: http://llvm.org/viewvc/llvm-project?rev=216453&view=rev
Log:
arm_acle: Add mappings for dbg intrinsic

This completes all ACLE hint intrinsics.

Modified:
    cfe/trunk/lib/Headers/arm_acle.h
    cfe/trunk/test/CodeGen/arm_acle.c
    cfe/trunk/test/Sema/arm_acle.c

Modified: cfe/trunk/lib/Headers/arm_acle.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/arm_acle.h?rev=216453&r1=216452&r2=216453&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/arm_acle.h (original)
+++ cfe/trunk/lib/Headers/arm_acle.h Tue Aug 26 07:48:11 2014
@@ -66,6 +66,10 @@ static __inline__ void __attribute__((al
 }
 #endif
 
+#if __ARM_32BIT_STATE
+#define __dbg(t) __builtin_arm_dbg(t)
+#endif
+
 /* 8.5 Swap */
 static __inline__ uint32_t __attribute__((always_inline, nodebug))
   __swp(uint32_t x, volatile uint32_t *p) {

Modified: cfe/trunk/test/CodeGen/arm_acle.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/arm_acle.c?rev=216453&r1=216452&r2=216453&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/arm_acle.c (original)
+++ cfe/trunk/test/CodeGen/arm_acle.c Tue Aug 26 07:48:11 2014
@@ -62,6 +62,14 @@ void test_sevl(void) {
   __sevl();
 }
 
+#if __ARM_32BIT_STATE
+// AArch32-LABEL: test_dbg
+// AArch32: call void @llvm.arm.dbg(i32 0)
+void test_dbg(void) {
+  __dbg(0);
+}
+#endif
+
 /* 8.5 Swap */
 // ARM-LABEL: test_swp
 // AArch32: call i32 @llvm.arm.ldrex

Modified: cfe/trunk/test/Sema/arm_acle.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/arm_acle.c?rev=216453&r1=216452&r2=216453&view=diff
==============================================================================
--- cfe/trunk/test/Sema/arm_acle.c (original)
+++ cfe/trunk/test/Sema/arm_acle.c Tue Aug 26 07:48:11 2014
@@ -37,3 +37,12 @@ int32_t test_usat_const_diag(int32_t t,
 void test_pldx_const_diag(int32_t i) {
   __pldx(i, 0, 0, 0);  // expected-error-re {{argument to {{.*}} must be a constant integer}}
 }
+
+/*
+ * DBG intrinsic
+ * First argument for DBG intrinsic must be compile-time constant,
+ * otherwise an error should be raised.
+ */
+void test_dbg_const_diag(unsigned int t) {
+  __dbg(t);  // expected-error-re {{argument to {{.*}} must be a constant integer}}
+}





More information about the cfe-commits mailing list