[Gc] [PATCH] gcconfig.h: Add machine description for TILE-Gx and TILEPro

Chris Metcalf <cmetcalf-VPRAkNaXOzVWk0Htik3J/[email protected]> Mon, 2 May 2016 11:42:04 -0400
Newsgroups gmane.comp.programming.garbage-collection.boehmgc
Message-ID <[email protected]>
---
For bdwgc:

This patch is an updated version of the CentOS 6 patch that we have
been carrying as part of our own CentOS-like distribution since 2012.

 include/private/gcconfig.h |   48 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h
index 760f896..beac61c 100644
--- a/include/private/gcconfig.h
+++ b/include/private/gcconfig.h
@@ -574,6 +574,14 @@
 #    define HEXAGON
 #    define mach_type_known
 # endif
+# if defined(__tile__) && defined(LINUX)
+#   ifdef __tilegx__
+#      define TILEGX
+#   else
+#      define TILEPRO
+#   endif
+#   define mach_type_known
+# endif
 
 # if defined(SYMBIAN)
 #   define mach_type_known
@@ -635,6 +643,8 @@
                     /*             CRIS       ==> Axis Etrax            */
                     /*             M32R       ==> Renesas M32R          */
                     /*             HEXAGON    ==> Qualcomm Hexagon      */
+                    /*             TILEPRO    ==> Tilera TILEPro        */
+                    /*             TILEGX     ==> Tilera TILE-Gx        */
 
 
 /*
@@ -2572,6 +2582,44 @@
 #   endif
 # endif
 
+# ifdef TILEPRO
+#   define CPP_WORDSZ 32
+#   define MACH_TYPE "TILEPro"
+#   define ALIGNMENT 4
+#   define ALIGN_DOUBLE
+#   define PREFETCH(x) __insn_prefetch(x)
+#   define CACHE_LINE_SIZE 64
+#   define USE_GENERIC_PUSH_REGS
+#   ifdef LINUX
+#     define OS_TYPE "LINUX"
+      extern int __data_start[];
+#     define DATASTART (ptr_t)(__data_start)
+#     define LINUX_STACKBOTTOM
+#     define DYNAMIC_LOADING
+#   endif
+# endif
+
+# ifdef TILEGX
+#   define CPP_WORDSZ (__SIZEOF_POINTER__ * 8)
+#   define MACH_TYPE "TILE-Gx"
+#   define ALIGNMENT __SIZEOF_POINTER__
+#   if CPP_WORDSZ < 64
+#     define ALIGN_DOUBLE /* Guarantee 64-bit alignment for allocations. */
+      /* Take advantage of 64-bit stores. */
+#     define CLEAR_DOUBLE(x) ((*(long long *)(x)) = 0)
+#   endif
+#   define PREFETCH(x) __insn_prefetch_l1(x)
+#   define CACHE_LINE_SIZE 64
+#   define USE_GENERIC_PUSH_REGS
+#   ifdef LINUX
+#     define OS_TYPE "LINUX"
+      extern int __data_start[];
+#     define DATASTART (ptr_t)(__data_start)
+#     define LINUX_STACKBOTTOM
+#     define DYNAMIC_LOADING
+#   endif
+# endif
+
 #if defined(__GLIBC__) && !defined(DONT_USE_LIBC_PRIVATES)
   /* Use glibc's stack-end marker. */
 # define USE_LIBC_PRIVATES
-- 
1.7.1