mgrang updated this revision to Diff 162431.
mgrang edited the summary of this revision.

https://reviews.llvm.org/D51204

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


Index: test/Headers/arm64-ms-intrin.cpp
===================================================================
--- /dev/null
+++ test/Headers/arm64-ms-intrin.cpp
@@ -0,0 +1,21 @@
+// RUN: %clang_cc1 -triple arm64-windows -S -emit-llvm -o - %s \
+// RUN: -fms-compatibility -fms-compatibility-version=17.00 \
+// RUN: -isystem %S/Inputs/include 2>&1 | FileCheck %s
+
+#include <intrin.h>
+
+unsigned __int64 check__getReg() {
+  return __getReg(1);
+}
+// CHECK: call i64 @__getReg(i32 1)
+
+__int64 check_ReadStatusReg() {
+  return _ReadStatusReg(1);
+}
+// CHECK: call i64 @_ReadStatusReg(i32 1)
+
+void check_WriteStatusReg() {
+  __int64 x;
+  _WriteStatusReg(1, x);
+}
+// CHECK: call void @_WriteStatusReg(i32 1, i64 %0)
Index: lib/Headers/intrin.h
===================================================================
--- lib/Headers/intrin.h
+++ lib/Headers/intrin.h
@@ -865,6 +865,15 @@
 #endif
 
 
/*----------------------------------------------------------------------------*\
+|* MS AArch64 specific
+\*----------------------------------------------------------------------------*/
+#if defined(__aarch64__)
+unsigned __int64 __getReg(int);
+__int64 _ReadStatusReg(int);
+void _WriteStatusReg(int, __int64);
+#endif
+
+/*----------------------------------------------------------------------------*\
 |* Privileged intrinsics
 
\*----------------------------------------------------------------------------*/
 #if defined(__i386__) || defined(__x86_64__)


Index: test/Headers/arm64-ms-intrin.cpp
===================================================================
--- /dev/null
+++ test/Headers/arm64-ms-intrin.cpp
@@ -0,0 +1,21 @@
+// RUN: %clang_cc1 -triple arm64-windows -S -emit-llvm -o - %s \
+// RUN: -fms-compatibility -fms-compatibility-version=17.00 \
+// RUN: -isystem %S/Inputs/include 2>&1 | FileCheck %s
+
+#include <intrin.h>
+
+unsigned __int64 check__getReg() {
+  return __getReg(1);
+}
+// CHECK: call i64 @__getReg(i32 1)
+
+__int64 check_ReadStatusReg() {
+  return _ReadStatusReg(1);
+}
+// CHECK: call i64 @_ReadStatusReg(i32 1)
+
+void check_WriteStatusReg() {
+  __int64 x;
+  _WriteStatusReg(1, x);
+}
+// CHECK: call void @_WriteStatusReg(i32 1, i64 %0)
Index: lib/Headers/intrin.h
===================================================================
--- lib/Headers/intrin.h
+++ lib/Headers/intrin.h
@@ -865,6 +865,15 @@
 #endif
 
 /*----------------------------------------------------------------------------*\
+|* MS AArch64 specific
+\*----------------------------------------------------------------------------*/
+#if defined(__aarch64__)
+unsigned __int64 __getReg(int);
+__int64 _ReadStatusReg(int);
+void _WriteStatusReg(int, __int64);
+#endif
+
+/*----------------------------------------------------------------------------*\
 |* Privileged intrinsics
 \*----------------------------------------------------------------------------*/
 #if defined(__i386__) || defined(__x86_64__)
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to