Allow the use of R9 and R10 in primops; fixes trac #5423
authorIan Lynagh <igloo@earth.li>
Sun, 6 Nov 2011 18:11:56 +0000 (18:11 +0000)
committerIan Lynagh <igloo@earth.li>
Sun, 6 Nov 2011 18:11:56 +0000 (18:11 +0000)
compiler/codeGen/CgUtils.hs
compiler/codeGen/StgCmmUtils.hs
compiler/nativeGen/PPC/Regs.hs
compiler/nativeGen/SPARC/RegPlate.hs
compiler/nativeGen/X86/Regs.hs
includes/rts/Constants.h
includes/stg/MachRegs.h
includes/stg/Regs.h

index 3ee4726..a0a5ac2 100644 (file)
@@ -350,6 +350,12 @@ callerSaves (VanillaReg 7 _)    = True
 #ifdef CALLER_SAVES_R8
 callerSaves (VanillaReg 8 _)    = True
 #endif
+#ifdef CALLER_SAVES_R9
+callerSaves (VanillaReg 9 _)    = True
+#endif
+#ifdef CALLER_SAVES_R10
+callerSaves (VanillaReg 10 _)   = True
+#endif
 #ifdef CALLER_SAVES_F1
 callerSaves (FloatReg 1)        = True
 #endif
@@ -921,6 +927,12 @@ activeStgRegs = [
 #ifdef REG_R8
     ,VanillaReg 8 VGcPtr
 #endif
+#ifdef REG_R9
+    ,VanillaReg 9 VGcPtr
+#endif
+#ifdef REG_R10
+    ,VanillaReg 10 VGcPtr
+#endif
 #ifdef REG_SpLim
     ,SpLim
 #endif
index ca0d23a..f209005 100644 (file)
@@ -327,6 +327,12 @@ callerSaves (VanillaReg 7 _)       = True
 #ifdef CALLER_SAVES_R8
 callerSaves (VanillaReg 8 _)   = True
 #endif
+#ifdef CALLER_SAVES_R9
+callerSaves (VanillaReg 9 _)   = True
+#endif
+#ifdef CALLER_SAVES_R10
+callerSaves (VanillaReg 10 _)  = True
+#endif
 #ifdef CALLER_SAVES_F1
 callerSaves (FloatReg 1)       = True
 #endif
index 2f1bae3..203709e 100644 (file)
@@ -472,6 +472,12 @@ freeReg REG_R7   = fastBool False
 #ifdef REG_R8  
 freeReg REG_R8   = fastBool False
 #endif
+#ifdef REG_R9
+freeReg REG_R9   = fastBool False
+#endif
+#ifdef REG_R10
+freeReg REG_R10  = fastBool False
+#endif
 #ifdef REG_F1
 freeReg REG_F1 = fastBool False
 #endif
index 7a7d447..32d2da1 100644 (file)
@@ -175,6 +175,12 @@ freeReg REG_R7     = fastBool False
 #ifdef REG_R8  
 freeReg REG_R8 = fastBool False
 #endif
+#ifdef REG_R9
+freeReg REG_R9 = fastBool False
+#endif
+#ifdef REG_R10
+freeReg REG_R10        = fastBool False
+#endif
 #ifdef REG_F1
 freeReg REG_F1 = fastBool False
 #endif
index 59566a7..68ab351 100644 (file)
@@ -500,6 +500,12 @@ freeReg REG_R7   = fastBool False
 #ifdef REG_R8
 freeReg REG_R8   = fastBool False
 #endif
+#ifdef REG_R9
+freeReg REG_R9   = fastBool False
+#endif
+#ifdef REG_R10
+freeReg REG_R10  = fastBool False
+#endif
 #ifdef REG_F1
 freeReg REG_F1 = fastBool False
 #endif
index a4114ab..e6e4a51 100644 (file)
@@ -80,7 +80,7 @@
    *real* machine registers, and not just offsets in the Register Table.
    -------------------------------------------------------------------------- */
 
-#define MAX_VANILLA_REG 8
+#define MAX_VANILLA_REG 10
 #define MAX_FLOAT_REG   4
 #define MAX_DOUBLE_REG  2
 #define MAX_LONG_REG    1
index 64b32e8..b8b0212 100644 (file)
  */
 
 #ifndef MAX_REAL_VANILLA_REG
-#  if   defined(REG_R8)
+#  if   defined(REG_R10)
+#  define MAX_REAL_VANILLA_REG 10
+#  elif   defined(REG_R9)
+#  define MAX_REAL_VANILLA_REG 9
+#  elif   defined(REG_R8)
 #  define MAX_REAL_VANILLA_REG 8
 #  elif defined(REG_R7)
 #  define MAX_REAL_VANILLA_REG 7
index e50b431..1d0c00c 100644 (file)
@@ -141,6 +141,8 @@ typedef struct StgRegTable_ {
 #define SAVE_R6             (BaseReg->rR6)
 #define SAVE_R7             (BaseReg->rR7)
 #define SAVE_R8             (BaseReg->rR8)
+#define SAVE_R9             (BaseReg->rR9)
+#define SAVE_R10            (BaseReg->rR10)
  
 #define SAVE_F1             (BaseReg->rF1)
 #define SAVE_F2             (BaseReg->rF2)
@@ -611,6 +613,8 @@ GLOBAL_REG_DECL(bdescr *,HpAlloc,REG_HpAlloc)
   CALLER_SAVE_R6                               \
   CALLER_SAVE_R7                               \
   CALLER_SAVE_R8                               \
+  CALLER_SAVE_R9                               \
+  CALLER_SAVE_R10                              \
   CALLER_SAVE_F1                               \
   CALLER_SAVE_F2                               \
   CALLER_SAVE_F3                               \
@@ -638,6 +642,8 @@ GLOBAL_REG_DECL(bdescr *,HpAlloc,REG_HpAlloc)
   CALLER_RESTORE_R6                            \
   CALLER_RESTORE_R7                            \
   CALLER_RESTORE_R8                            \
+  CALLER_RESTORE_R9                            \
+  CALLER_RESTORE_R10                   \
   CALLER_RESTORE_F1                            \
   CALLER_RESTORE_F2                            \
   CALLER_RESTORE_F3                            \