Blob Blame History Raw
From: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.de> 
Date: 2017-06-12 04:37:30
Subject: s390/s390x support 

Ref: https://upc-bugs.lbl.gov/bugzilla/show_bug.cgi?id=3523 

diff --git gasnet_membar.h gasnet_membar.h
index f1376c4..1204183 100644
--- gasnet_membar.h
+++ gasnet_membar.h
@@ -260,6 +260,12 @@
    #define gasneti_local_rmb() gasneti_local_mb()
    #define GASNETI_RMB_IS_MB
    #define GASNETI_WMB_IS_MB
+#elif PLATFORM_ARCH_S390 && PLATFORM_COMPILER_GNU
+   #define gasneti_local_mb() __sync_synchronize()
+   #define gasneti_local_wmb() gasneti_local_mb()
+   #define gasneti_local_rmb() gasneti_local_mb()
+   #define GASNETI_RMB_IS_MB
+   #define GASNETI_WMB_IS_MB
 #else
  #error unknown CPU - dont know how to do a local memory barrier for your CPU/OS
 #endif
diff --git other/gasnet_portable_platform.h other/gasnet_portable_platform.h
index 917cb9b..4fe8776 100644
--- other/gasnet_portable_platform.h
+++ other/gasnet_portable_platform.h
@@ -157,6 +157,7 @@
 #undef PLATFORM_ARCH_ARM
 #undef PLATFORM_ARCH_AARCH64
 #undef PLATFORM_ARCH_TILE
+#undef PLATFORM_ARCH_S390
 #undef PLATFORM_ARCH_UNKNOWN
 
 /* prevent known old/broken versions of this header from loading */
@@ -925,6 +926,16 @@
     #define _PLATFORM_ARCH_32 1
   #endif
 
+#elif defined(__s390__)
+  #define PLATFORM_ARCH_S390 1
+  #define PLATFORM_ARCH_FAMILYNAME S390
+  #define _PLATFORM_ARCH_BIG_ENDIAN 1
+  #if defined(__s390x__)
+    #define _PLATFORM_ARCH_64 1
+  #else
+    #define _PLATFORM_ARCH_32 1
+  #endif
+
 #else /* unknown CPU */
   #define PLATFORM_ARCH_UNKNOWN 1
   #define PLATFORM_ARCH_FAMILYNAME UNKNOWN