[PATCH] D24986: Headers: Add iso_volatile load/store intrinsics

Martin Storsjö via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 27 13:29:57 PDT 2016


mstorsjo created this revision.
mstorsjo added a reviewer: majnemer.
mstorsjo added a subscriber: cfe-commits.
Herald added a subscriber: aemerson.

This implements what is missing for PR30394, making it possible to compile C++ for ARM in MSVC mode with MSVC headers.

https://reviews.llvm.org/D24986

Files:
  lib/Headers/intrin.h

Index: lib/Headers/intrin.h
===================================================================
--- lib/Headers/intrin.h
+++ lib/Headers/intrin.h
@@ -1248,6 +1248,42 @@
 }
 #endif
 
+#if defined(__arm__) || defined(__aarch64__)
+static __inline__ char __DEFAULT_FN_ATTRS
+__iso_volatile_load8(const char volatile *_Src) {
+  return *_Src;
+}
+static __inline__ short __DEFAULT_FN_ATTRS
+__iso_volatile_load16(const short volatile *_Src) {
+  return *_Src;
+}
+static __inline__ int __DEFAULT_FN_ATTRS
+__iso_volatile_load32(const int volatile *_Src) {
+  return *_Src;
+}
+static __inline__ __int64 __DEFAULT_FN_ATTRS
+__iso_volatile_load64(const __int64 volatile *_Src) {
+  return *_Src;
+}
+
+static __inline__ void __DEFAULT_FN_ATTRS
+__iso_volatile_store8(char volatile *_Dest, char _Value) {
+  *_Dest = _Value;
+}
+static __inline__ void __DEFAULT_FN_ATTRS
+__iso_volatile_store16(short volatile *_Dest, short _Value) {
+  *_Dest = _Value;
+}
+static __inline__ void __DEFAULT_FN_ATTRS
+__iso_volatile_store32(int volatile *_Dest, int _Value) {
+  *_Dest = _Value;
+}
+static __inline__ void __DEFAULT_FN_ATTRS
+__iso_volatile_store64(__int64 volatile *_Dest, __int64 _Value) {
+  *_Dest = _Value;
+}
+#endif
+
 #ifdef __cplusplus
 }
 #endif


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24986.72702.patch
Type: text/x-patch
Size: 1249 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160927/26298eb0/attachment.bin>


More information about the cfe-commits mailing list