ARM: Add NOP intrinsic mapping in arm_acle.h
llvm-svn: 212950
diff --git a/clang/lib/Headers/arm_acle.h b/clang/lib/Headers/arm_acle.h
index 460f297..c51a5dc 100644
--- a/clang/lib/Headers/arm_acle.h
+++ b/clang/lib/Headers/arm_acle.h
@@ -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 @@
}
#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))
diff --git a/clang/test/CodeGen/arm_acle.c b/clang/test/CodeGen/arm_acle.c
index 9321cf9..41ebe15 100644
--- a/clang/test/CodeGen/arm_acle.c
+++ b/clang/test/CodeGen/arm_acle.c
@@ -40,6 +40,14 @@
__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