[PATCH] D51204: [COFF, ARM64] Add MS intrinsics: __getReg, _ReadStatusReg, _WriteStatusReg

Mandeep Singh Grang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 23 18:11:25 PDT 2018


mgrang created this revision.
mgrang added reviewers: rnk, compnerd, mstorsjo, haripul, TomTan.
Herald added a reviewer: javed.absar.
Herald added subscribers: chrib, kristof.beyls.

Added declarations for the intrinsics in arm64intr.h. These are defined in MSVC libs and are needed for
certain spec2000 benchmarks.


Repository:
  rC Clang

https://reviews.llvm.org/D51204

Files:
  lib/Headers/arm64intr.h
  test/CodeGen/arm64-microsoft-intrinsics.c


Index: test/CodeGen/arm64-microsoft-intrinsics.c
===================================================================
--- test/CodeGen/arm64-microsoft-intrinsics.c
+++ test/CodeGen/arm64-microsoft-intrinsics.c
@@ -59,3 +59,19 @@
 
 // CHECK-MSVC: @llvm.aarch64.hint(i32 5)
 // CHECK-LINUX: error: implicit declaration of function '__sevl'
+
+unsigned __int64 check__getReg(void) {
+  return __getReg(1);
+}
+// CHECK-MSVC: call i32 bitcast (i32 (...)* @__getReg to i32 (i32)*)(i32 1)
+
+__int64 check_ReadStatusReg(void) {
+  return _ReadStatusReg(1);
+}
+// CHECK-MSVC: call i32 bitcast (i32 (...)* @_ReadStatusReg to i32 (i32)*)(i32 1)
+
+void check_WriteStatusReg(void) {
+  __int64 x;
+  _WriteStatusReg(1, x);
+}
+// CHECK-MSVC: call i32 bitcast (i32 (...)* @_WriteStatusReg to i32 (i32, i64)*)(i32 1, i64 %0)
Index: lib/Headers/arm64intr.h
===================================================================
--- lib/Headers/arm64intr.h
+++ lib/Headers/arm64intr.h
@@ -45,5 +45,9 @@
   _ARM64_BARRIER_OSHLD = 0x1
 } _ARM64INTR_BARRIER_TYPE;
 
+unsigned __int64 __getReg(int);
+__int64 _ReadStatusReg(int);
+void _WriteStatusReg(int, __int64);
+
 #endif /* __ARM64INTR_H */
 #endif /* _MSC_VER */


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51204.162316.patch
Type: text/x-patch
Size: 1200 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180824/f26114a8/attachment-0001.bin>


More information about the cfe-commits mailing list