]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/5c, cmd/5g, cmd/5l: enable use of R12, F8-F15
authorShenghou Ma <minux.ma@gmail.com>
Sat, 2 Jun 2012 16:54:28 +0000 (12:54 -0400)
committerRuss Cox <rsc@golang.org>
Sat, 2 Jun 2012 16:54:28 +0000 (12:54 -0400)
R=dave, rsc
CC=golang-dev
https://golang.org/cl/6248070

src/cmd/5c/reg.c
src/cmd/5g/reg.c
src/cmd/5l/5.out.h

index c6d760c509b05a29d9c22bddc875b062efa04f47..42c5193de54b3de11e249b787ebb1a6834eb1df1 100644 (file)
@@ -1150,12 +1150,13 @@ addreg(Adr *a, int rn)
  *     1       R1
  *     ...     ...
  *     10      R10
+ *     12  R12
  */
 int32
 RtoB(int r)
 {
 
-       if(r < 2 || r >= REGTMP-2)      // excluded R9 and R10 for m and g
+       if(r < 2 || (r >= REGTMP-2 && r != 12)) // excluded R9 and R10 for m and g, but not R12
                return 0;
        return 1L << r;
 }
@@ -1163,7 +1164,7 @@ RtoB(int r)
 int
 BtoR(int32 b)
 {
-       b &= 0x01fcL;   // excluded R9 and R10 for m and g
+       b &= 0x11fcL;   // excluded R9 and R10 for m and g, but not R12
        if(b == 0)
                return 0;
        return bitno(b);
@@ -1174,7 +1175,7 @@ BtoR(int32 b)
  *     18      F2
  *     19      F3
  *     ...     ...
- *     23      F7
+ *     31      F15
  */
 int32
 FtoB(int f)
@@ -1189,7 +1190,7 @@ int
 BtoF(int32 b)
 {
 
-       b &= 0xfc0000L;
+       b &= 0xfffc0000L;
        if(b == 0)
                return 0;
        return bitno(b) - 16;
index 82e2166b8472ec80c2870e355605e49ccebd87e3..bc3fca5048a70a4acf70406029a62ed5740cd476 100644 (file)
@@ -34,8 +34,8 @@
 #include "gg.h"
 #include "opt.h"
 
-#define        NREGVAR 24
-#define        REGBITS ((uint32)0xffffff)
+#define        NREGVAR 32
+#define        REGBITS ((uint32)0xffffffff)
 #define        P2R(p)  (Reg*)(p->reg)
 
        void    addsplits(void);
@@ -160,6 +160,14 @@ static char* regname[] = {
        ".F5",
        ".F6",
        ".F7",
+       ".F8",
+       ".F9",
+       ".F10",
+       ".F11",
+       ".F12",
+       ".F13",
+       ".F14",
+       ".F15",
 };
 
 void
@@ -1486,11 +1494,12 @@ addreg(Adr *a, int rn)
  *     1       R1
  *     ...     ...
  *     10      R10
+ *     12  R12
  */
 int32
 RtoB(int r)
 {
-       if(r >= REGTMP-2)       // excluded R9 and R10 for m and g
+       if(r >= REGTMP-2 && r != 12)    // excluded R9 and R10 for m and g, but not R12
                return 0;
        return 1L << r;
 }
@@ -1498,7 +1507,7 @@ RtoB(int r)
 int
 BtoR(int32 b)
 {
-       b &= 0x01fcL;   // excluded R9 and R10 for m and g
+       b &= 0x11fcL;   // excluded R9 and R10 for m and g, but not R12
        if(b == 0)
                return 0;
        return bitno(b);
@@ -1509,7 +1518,7 @@ BtoR(int32 b)
  *     18      F2
  *     19      F3
  *     ...     ...
- *     23      F7
+ *     31      F15
  */
 int32
 FtoB(int f)
@@ -1524,7 +1533,7 @@ int
 BtoF(int32 b)
 {
 
-       b &= 0xfc0000L;
+       b &= 0xfffc0000L;
        if(b == 0)
                return 0;
        return bitno(b) - 16;
index 3c726e924b3f413ac26eba2e43a45b1b98d515eb..56724d3dbcea3184fa695dce938612eeaacdd556 100644 (file)
 #define REGM        (REGEXT-1)
 /* compiler allocates external registers R10 down */
 #define        REGTMP          11
-#define        REGSB           12
 #define        REGSP           13
 #define        REGLINK         14
 #define        REGPC           15
 
-#define        NFREG           8
+#define        NFREG           16
 #define        FREGRET         0
 #define        FREGEXT         7
 #define        FREGTMP         15