From 5573271b0c55d7c202003450198b8da578ec77ac Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Mon, 14 Jul 2014 15:32:29 +0000 Subject: [PATCH] ARM: Add NOP intrinsic mapping in arm_acle.h git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212950 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Headers/arm_acle.h | 10 ++++++++-- test/CodeGen/arm_acle.c | 8 ++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/Headers/arm_acle.h b/lib/Headers/arm_acle.h index 460f2975d4..c51a5dcbef 100644 --- a/lib/Headers/arm_acle.h +++ b/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 @@ 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)) diff --git a/test/CodeGen/arm_acle.c b/test/CodeGen/arm_acle.c index 9321cf9a47..41ebe1504c 100644 --- a/test/CodeGen/arm_acle.c +++ b/test/CodeGen/arm_acle.c @@ -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 -- 2.50.1