]> granicus.if.org Git - clang/commitdiff
ARM: Add NOP intrinsic mapping in arm_acle.h
authorYi Kong <Yi.Kong@arm.com>
Mon, 14 Jul 2014 15:32:29 +0000 (15:32 +0000)
committerYi Kong <Yi.Kong@arm.com>
Mon, 14 Jul 2014 15:32:29 +0000 (15:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212950 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Headers/arm_acle.h
test/CodeGen/arm_acle.c

index 460f2975d46105e17b397535e53da2f60f4f50ff..c51a5dcbef2dfa2d545f40622be0d519d10e0ff0 100644 (file)
@@ -33,8 +33,9 @@
 #if defined(__cplusplus)
 extern "C" {
 #endif
-
-/* 8.4 - Hints */
+/* 8 SYNCHRONIZATION, BARRIER AND HINT INTRINSICS */
+/* 8.4 Hints */
 
 #if !defined(_MSC_VER)
 static __inline__ void __attribute__((always_inline, nodebug)) __wfi(void) {
@@ -58,6 +59,11 @@ static __inline__ void __attribute__((always_inline, nodebug)) __yield(void) {
 }
 #endif
 
+/* 8.7 NOP */
+static __inline__ void __attribute__((always_inline, nodebug)) __nop(void) {
+  __builtin_arm_nop();
+}
+
 /* 9 DATA-PROCESSING INTRINSICS */
 /* 9.2 Miscellaneous data-processing intrinsics */
 static __inline__ uint32_t __attribute__((always_inline, nodebug))
index 9321cf9a477b289291ff1b64205f4f7224005f47..41ebe1504c5d45cba7d2e95beaa967da8d037e21 100644 (file)
@@ -40,6 +40,14 @@ void test_sevl(void) {
   __sevl();
 }
 
+/* 8.7 NOP */
+// ARM-LABEL: test_nop
+// AArch32: call void @llvm.arm.hint(i32 0)
+// AArch64: call void @llvm.aarch64.hint(i32 0)
+void test_nop(void) {
+  __nop();
+}
+
 /* 9 DATA-PROCESSING INTRINSICS */
 /* 9.2 Miscellaneous data-processing intrinsics */
 // ARM-LABEL: test_rev