From: Saleem Abdulrasool Date: Sat, 12 Jul 2014 23:27:26 +0000 (+0000) Subject: Headers: add hint intrinsics to arm_acle.h X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=71f06af4f7951c910333ea8f40ad343f5e754d75;p=clang Headers: add hint intrinsics to arm_acle.h This adds the ARM ACLE hint intrinsic wrappers to arm_acle.h. These need to be protected with a !defined(_MSC_VER) since MSVC (and thus clang in compatibility mode) provide these wrappers as proper builtin intrinsics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212891 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Headers/arm_acle.h b/lib/Headers/arm_acle.h index a7406fbf0a..460f2975d4 100644 --- a/lib/Headers/arm_acle.h +++ b/lib/Headers/arm_acle.h @@ -34,6 +34,30 @@ extern "C" { #endif +/* 8.4 - Hints */ + +#if !defined(_MSC_VER) +static __inline__ void __attribute__((always_inline, nodebug)) __wfi(void) { + __builtin_arm_wfi(); +} + +static __inline__ void __attribute__((always_inline, nodebug)) __wfe(void) { + __builtin_arm_wfe(); +} + +static __inline__ void __attribute__((always_inline, nodebug)) __sev(void) { + __builtin_arm_sev(); +} + +static __inline__ void __attribute__((always_inline, nodebug)) __sevl(void) { + __builtin_arm_sevl(); +} + +static __inline__ void __attribute__((always_inline, nodebug)) __yield(void) { + __builtin_arm_yield(); +} +#endif + /* 9 DATA-PROCESSING INTRINSICS */ /* 9.2 Miscellaneous data-processing intrinsics */ static __inline__ uint32_t __attribute__((always_inline, nodebug)) diff --git a/test/Headers/arm-acle-header.c b/test/Headers/arm-acle-header.c index 523e77e486..d9d2e04c94 100644 --- a/test/Headers/arm-acle-header.c +++ b/test/Headers/arm-acle-header.c @@ -1,7 +1,9 @@ -// RUN: %clang_cc1 -triple armv7 -target-cpu cortex-a15 -fsyntax-only -ffreestanding %s -// RUN: %clang_cc1 -triple aarch64 -target-cpu cortex-a53 -fsyntax-only -ffreestanding %s -// RUN: %clang_cc1 -x c++ -triple armv7 -target-cpu cortex-a15 -fsyntax-only -ffreestanding %s -// RUN: %clang_cc1 -x c++ -triple aarch64 -target-cpu cortex-a57 -fsyntax-only -ffreestanding %s +// RUN: %clang_cc1 -triple armv7-eabi -target-cpu cortex-a15 -fsyntax-only -ffreestanding %s +// RUN: %clang_cc1 -triple aarch64-eabi -target-cpu cortex-a53 -fsyntax-only -ffreestanding %s +// RUN: %clang_cc1 -triple thumbv7-windows -target-cpu cortex-a53 -fsyntax-only -ffreestanding %s +// RUN: %clang_cc1 -x c++ -triple armv7-eabi -target-cpu cortex-a15 -fsyntax-only -ffreestanding %s +// RUN: %clang_cc1 -x c++ -triple aarch64-eabi -target-cpu cortex-a57 -fsyntax-only -ffreestanding %s +// RUN: %clang_cc1 -x c++ -triple thumbv7-windows -target-cpu cortex-a15 -fsyntax-only -ffreestanding %s // expected-no-diagnostics #include