diff options
author | Geoffrey Mainland <gmainlan@microsoft.com> | 2013-09-15 22:41:31 -0400 |
---|---|---|
committer | Geoffrey Mainland <gmainlan@microsoft.com> | 2013-09-22 22:34:00 -0400 |
commit | c5add86a9ec1f0f2fab2ba11ccb05eb9161e9960 (patch) | |
tree | 7971b2d3c315b6b9013f8504e6543174d76371a5 /includes | |
parent | 26a960c662cdfdfb24ec8ed3e013c686dfdca4cd (diff) | |
download | haskell-c5add86a9ec1f0f2fab2ba11ccb05eb9161e9960.tar.gz |
Pass 512-bit-wide vectors in registers.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/CodeGen.Platform.hs | 55 | ||||
-rw-r--r-- | includes/stg/MachRegs.h | 23 | ||||
-rw-r--r-- | includes/stg/Regs.h | 42 | ||||
-rw-r--r-- | includes/stg/Types.h | 2 |
4 files changed, 122 insertions, 0 deletions
diff --git a/includes/CodeGen.Platform.hs b/includes/CodeGen.Platform.hs index cff60b3e8c..3d6dd41ae4 100644 --- a/includes/CodeGen.Platform.hs +++ b/includes/CodeGen.Platform.hs @@ -82,6 +82,23 @@ import Reg # define ymm14 54 # define ymm15 55 +# define zmm0 56 +# define zmm1 57 +# define zmm2 58 +# define zmm3 59 +# define zmm4 60 +# define zmm5 61 +# define zmm6 62 +# define zmm7 63 +# define zmm8 64 +# define zmm9 65 +# define zmm10 66 +# define zmm11 67 +# define zmm12 68 +# define zmm13 69 +# define zmm14 70 +# define zmm15 71 + #elif MACHREGS_powerpc # define r0 0 @@ -411,6 +428,9 @@ activeStgRegs = [ #ifdef REG_YMM1 ,YmmReg 1 #endif +#ifdef REG_ZMM1 + ,ZmmReg 1 +#endif #ifdef REG_F2 ,FloatReg 2 #endif @@ -423,6 +443,9 @@ activeStgRegs = [ #ifdef REG_YMM2 ,YmmReg 2 #endif +#ifdef REG_ZMM2 + ,ZmmReg 2 +#endif #ifdef REG_F3 ,FloatReg 3 #endif @@ -435,6 +458,9 @@ activeStgRegs = [ #ifdef REG_YMM3 ,YmmReg 3 #endif +#ifdef REG_ZMM3 + ,ZmmReg 3 +#endif #ifdef REG_F4 ,FloatReg 4 #endif @@ -447,6 +473,9 @@ activeStgRegs = [ #ifdef REG_YMM4 ,YmmReg 4 #endif +#ifdef REG_ZMM4 + ,ZmmReg 4 +#endif #ifdef REG_F5 ,FloatReg 5 #endif @@ -459,6 +488,9 @@ activeStgRegs = [ #ifdef REG_YMM5 ,YmmReg 5 #endif +#ifdef REG_ZMM5 + ,ZmmReg 5 +#endif #ifdef REG_F6 ,FloatReg 6 #endif @@ -471,6 +503,9 @@ activeStgRegs = [ #ifdef REG_YMM6 ,YmmReg 6 #endif +#ifdef REG_ZMM6 + ,ZmmReg 6 +#endif #else /* MAX_REAL_XMM_REG == 0 */ #ifdef REG_F1 ,FloatReg 1 @@ -662,6 +697,26 @@ globalRegMaybe (YmmReg 5) = Just (RealRegSingle REG_YMM5) globalRegMaybe (YmmReg 6) = Just (RealRegSingle REG_YMM6) # endif # endif +# if MAX_REAL_ZMM_REG != 0 +# ifdef REG_ZMM1 +globalRegMaybe (ZmmReg 1) = Just (RealRegSingle REG_ZMM1) +# endif +# ifdef REG_ZMM2 +globalRegMaybe (ZmmReg 2) = Just (RealRegSingle REG_ZMM2) +# endif +# ifdef REG_ZMM3 +globalRegMaybe (ZmmReg 3) = Just (RealRegSingle REG_ZMM3) +# endif +# ifdef REG_ZMM4 +globalRegMaybe (ZmmReg 4) = Just (RealRegSingle REG_ZMM4) +# endif +# ifdef REG_ZMM5 +globalRegMaybe (ZmmReg 5) = Just (RealRegSingle REG_ZMM5) +# endif +# ifdef REG_ZMM6 +globalRegMaybe (ZmmReg 6) = Just (RealRegSingle REG_ZMM6) +# endif +# endif # ifdef REG_Sp globalRegMaybe Sp = Just (RealRegSingle REG_Sp) # endif diff --git a/includes/stg/MachRegs.h b/includes/stg/MachRegs.h index a73705110d..81e48cc9b4 100644 --- a/includes/stg/MachRegs.h +++ b/includes/stg/MachRegs.h @@ -113,12 +113,18 @@ #define REG_YMM3 ymm2 #define REG_YMM4 ymm3 +#define REG_ZMM1 zmm0 +#define REG_ZMM2 zmm1 +#define REG_ZMM3 zmm2 +#define REG_ZMM4 zmm3 + #define MAX_REAL_VANILLA_REG 1 /* always, since it defines the entry conv */ #define MAX_REAL_FLOAT_REG 0 #define MAX_REAL_DOUBLE_REG 0 #define MAX_REAL_LONG_REG 0 #define MAX_REAL_XMM_REG 4 #define MAX_REAL_YMM_REG 4 +#define MAX_REAL_ZMM_REG 4 /* ----------------------------------------------------------------------------- The x86-64 register mapping @@ -192,6 +198,13 @@ #define REG_YMM5 ymm5 #define REG_YMM6 ymm6 +#define REG_ZMM1 zmm1 +#define REG_ZMM2 zmm2 +#define REG_ZMM3 zmm3 +#define REG_ZMM4 zmm4 +#define REG_ZMM5 zmm5 +#define REG_ZMM6 zmm6 + #if !defined(mingw32_HOST_OS) #define CALLER_SAVES_R3 #define CALLER_SAVES_R4 @@ -235,12 +248,22 @@ #define CALLER_SAVES_YMM6 #endif +#define CALLER_SAVES_ZMM1 +#define CALLER_SAVES_ZMM2 +#define CALLER_SAVES_ZMM3 +#define CALLER_SAVES_ZMM4 +#define CALLER_SAVES_ZMM5 +#if !defined(mingw32_HOST_OS) +#define CALLER_SAVES_ZMM6 +#endif + #define MAX_REAL_VANILLA_REG 6 #define MAX_REAL_FLOAT_REG 6 #define MAX_REAL_DOUBLE_REG 6 #define MAX_REAL_LONG_REG 0 #define MAX_REAL_XMM_REG 6 #define MAX_REAL_YMM_REG 6 +#define MAX_REAL_ZMM_REG 6 /* ----------------------------------------------------------------------------- The PowerPC register mapping diff --git a/includes/stg/Regs.h b/includes/stg/Regs.h index 2f27c639c8..1abf9da439 100644 --- a/includes/stg/Regs.h +++ b/includes/stg/Regs.h @@ -93,6 +93,12 @@ typedef struct { StgWord256 rYMM4; StgWord256 rYMM5; StgWord256 rYMM6; + StgWord512 rZMM1; + StgWord512 rZMM2; + StgWord512 rZMM3; + StgWord512 rZMM4; + StgWord512 rZMM5; + StgWord512 rZMM6; StgWord64 rL1; StgPtr rSp; StgPtr rSpLim; @@ -354,6 +360,42 @@ GLOBAL_REG_DECL(StgWord256,YMM6,REG_YMM6) #define YMM6 (BaseReg->rYMM6) #endif +#if defined(REG_ZMM1) && !defined(NO_GLOBAL_REG_DECLS) +GLOBAL_REG_DECL(StgWord512,ZMM1,REG_ZMM1) +#else +#define ZMM1 (BaseReg->rZMM1) +#endif + +#if defined(REG_ZMM2) && !defined(NO_GLOBAL_REG_DECLS) +GLOBAL_REG_DECL(StgWord512,ZMM2,REG_ZMM2) +#else +#define ZMM2 (BaseReg->rZMM2) +#endif + +#if defined(REG_ZMM3) && !defined(NO_GLOBAL_REG_DECLS) +GLOBAL_REG_DECL(StgWord512,ZMM3,REG_ZMM3) +#else +#define ZMM3 (BaseReg->rZMM3) +#endif + +#if defined(REG_ZMM4) && !defined(NO_GLOBAL_REG_DECLS) +GLOBAL_REG_DECL(StgWord512,ZMM4,REG_ZMM4) +#else +#define ZMM4 (BaseReg->rZMM4) +#endif + +#if defined(REG_ZMM5) && !defined(NO_GLOBAL_REG_DECLS) +GLOBAL_REG_DECL(StgWord512,ZMM5,REG_ZMM5) +#else +#define ZMM5 (BaseReg->rZMM5) +#endif + +#if defined(REG_ZMM6) && !defined(NO_GLOBAL_REG_DECLS) +GLOBAL_REG_DECL(StgWord512,ZMM6,REG_ZMM6) +#else +#define ZMM6 (BaseReg->rZMM6) +#endif + #if defined(REG_L1) && !defined(NO_GLOBAL_REG_DECLS) GLOBAL_REG_DECL(StgWord64,L1,REG_L1) #else diff --git a/includes/stg/Types.h b/includes/stg/Types.h index 4e574bb5c6..6138a8f8a2 100644 --- a/includes/stg/Types.h +++ b/includes/stg/Types.h @@ -87,6 +87,8 @@ typedef struct { StgWord64 h; StgWord64 l; } StgWord128; typedef struct { StgWord128 h; StgWord128 l; } StgWord256; +typedef struct { StgWord256 h; StgWord256 l; } StgWord512; + /* * Define the standard word size we'll use on this machine: make it * big enough to hold a pointer. |