From 1240658b92c0827ace6f9ac52b3425070eed948f Mon Sep 17 00:00:00 2001 From: Chris Metcalf Date: Tue, 10 May 2016 11:04:53 +0300 Subject: [PATCH] Support (add machine description for) TILE-Gx and TILEPro targets 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 (TILEGX, TILEPRO) [__tile__]: New macro. * include/private/gcconfig.h (mach_type_known, CPP_WORDSZ, MACH_TYPE, ALIGNMENT, ALIGN_DOUBLE, PREFETCH, CACHE_LINE_SIZE, USE_GENERIC_PUSH_REGS, OS_TYPE, __data_start, DATASTART, LINUX_STACKBOTTOM, DYNAMIC_LOADING, ALIGNMENT): Define for TILEGX and TILEPRO. --- include/private/gcconfig.h | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h index 760f8962..f4935b4f 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 -- 2.40.0