[PATCH] D56671: [COFF, ARM64] Add __nop intrinsic

Mandeep Singh Grang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 14 10:11:38 PST 2019


mgrang created this revision.
mgrang added reviewers: rnk, efriedma, TomTan, haripul, ssijaric.
Herald added subscribers: kristof.beyls, javed.absar.

Repository:
  rC Clang

https://reviews.llvm.org/D56671

Files:
  lib/Headers/intrin.h
  test/Headers/ms-arm64-intrin.cpp


Index: test/Headers/ms-arm64-intrin.cpp
===================================================================
--- /dev/null
+++ test/Headers/ms-arm64-intrin.cpp
@@ -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();
+}
Index: lib/Headers/intrin.h
===================================================================
--- lib/Headers/intrin.h
+++ lib/Headers/intrin.h
@@ -549,6 +549,9 @@
 __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");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56671.181578.patch
Type: text/x-patch
Size: 888 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190114/a801b05e/attachment-0001.bin>


More information about the cfe-commits mailing list