r212891 - Headers: add hint intrinsics to arm_acle.h

Saleem Abdulrasool compnerd at compnerd.org
Sat Jul 12 16:27:26 PDT 2014


Author: compnerd
Date: Sat Jul 12 18:27:26 2014
New Revision: 212891

URL: http://llvm.org/viewvc/llvm-project?rev=212891&view=rev
Log:
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.

Modified:
    cfe/trunk/lib/Headers/arm_acle.h
    cfe/trunk/test/Headers/arm-acle-header.c

Modified: cfe/trunk/lib/Headers/arm_acle.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/arm_acle.h?rev=212891&r1=212890&r2=212891&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/arm_acle.h (original)
+++ cfe/trunk/lib/Headers/arm_acle.h Sat Jul 12 18:27:26 2014
@@ -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))

Modified: cfe/trunk/test/Headers/arm-acle-header.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Headers/arm-acle-header.c?rev=212891&r1=212890&r2=212891&view=diff
==============================================================================
--- cfe/trunk/test/Headers/arm-acle-header.c (original)
+++ cfe/trunk/test/Headers/arm-acle-header.c Sat Jul 12 18:27:26 2014
@@ -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 <arm_acle.h>





More information about the cfe-commits mailing list