r351135 - [COFF, ARM64] Add __nop intrinsic

Mandeep Singh Grang via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 14 15:26:01 PST 2019


Author: mgrang
Date: Mon Jan 14 15:26:01 2019
New Revision: 351135

URL: http://llvm.org/viewvc/llvm-project?rev=351135&view=rev
Log:
[COFF, ARM64] Add __nop intrinsic

Reviewers: rnk, efriedma, TomTan, haripul, ssijaric

Reviewed By: rnk, efriedma

Subscribers: javed.absar, kristof.beyls, cfe-commits

Differential Revision: https://reviews.llvm.org/D56671

Added:
    cfe/trunk/test/Headers/ms-arm64-intrin.cpp
Modified:
    cfe/trunk/lib/Headers/intrin.h

Modified: cfe/trunk/lib/Headers/intrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/intrin.h?rev=351135&r1=351134&r2=351135&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/intrin.h (original)
+++ cfe/trunk/lib/Headers/intrin.h Mon Jan 14 15:26:01 2019
@@ -549,6 +549,9 @@ static __inline__ void __DEFAULT_FN_ATTR
 __halt(void) {
   __asm__ volatile ("hlt");
 }
+#endif
+
+#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__)
 static __inline__ void __DEFAULT_FN_ATTRS
 __nop(void) {
   __asm__ volatile ("nop");

Added: cfe/trunk/test/Headers/ms-arm64-intrin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Headers/ms-arm64-intrin.cpp?rev=351135&view=auto
==============================================================================
--- cfe/trunk/test/Headers/ms-arm64-intrin.cpp (added)
+++ cfe/trunk/test/Headers/ms-arm64-intrin.cpp Mon Jan 14 15:26:01 2019
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -triple arm64-windows \
+// RUN: -fms-compatibility -fms-compatibility-version=17.00 \
+// RUN: -ffreestanding -fsyntax-only -Werror \
+// RUN: -isystem %S/Inputs/include %s -S -o - 2>&1 | FileCheck %s
+
+// REQUIRES: aarch64-registered-target
+
+#include <intrin.h>
+
+void f() {
+// CHECK: nop
+  __nop();
+}




More information about the cfe-commits mailing list