OSDN Git Service

Subzero: Fix register encodings.
authorJim Stichnoth <stichnot@chromium.org>
Wed, 15 Jul 2015 16:00:07 +0000 (09:00 -0700)
committerJim Stichnoth <stichnot@chromium.org>
Wed, 15 Jul 2015 16:00:07 +0000 (09:00 -0700)
Specifically, we were ending up with Encoded_Reg_xmm0=0 yet Encoded_Reg_xmm1=10, Encoded_Reg_xmm2=11, etc.

It's a mystery as to why this wasn't triggering any failures with filetype!=asm.

BUG= none
R=jpp@chromium.org

Review URL: https://codereview.chromium.org/1231973003.

src/IceInstX8632.def
src/IceRegistersX8632.h

index ad764dc..f9b1e88 100644 (file)
 #define REGX8632_GPR_TABLE                                              \
   /* val, encode, name, name16, name8, scratch, preserved, stackptr,    \
      frameptr, isI8, isInt, isFP */                                     \
-  X(Reg_eax, = 0,             "eax",  "ax", "al", 1, 0, 0, 0, 1, 1, 0)  \
-  X(Reg_ecx, = Reg_eax + 1,   "ecx",  "cx", "cl", 1, 0, 0, 0, 1, 1, 0)  \
-  X(Reg_edx, = Reg_eax + 2,   "edx",  "dx", "dl", 1, 0, 0, 0, 1, 1, 0)  \
-  X(Reg_ebx, = Reg_eax + 3,   "ebx",  "bx", "bl", 0, 1, 0, 0, 1, 1, 0)  \
-  X(Reg_esp, = Reg_eax + 4,   "esp",  "sp", ""  , 0, 0, 1, 0, 0, 0, 0)  \
-  X(Reg_ebp, = Reg_eax + 5,   "ebp",  "bp", ""  , 0, 1, 0, 1, 0, 1, 0)  \
-  X(Reg_esi, = Reg_eax + 6,   "esi",  "si", ""  , 0, 1, 0, 0, 0, 1, 0)  \
-  X(Reg_edi, = Reg_eax + 7,   "edi",  "di", ""  , 0, 1, 0, 0, 0, 1, 0)
+  X(Reg_eax, 0, "eax", "ax", "al", 1, 0, 0, 0, 1, 1, 0)                 \
+  X(Reg_ecx, 1, "ecx", "cx", "cl", 1, 0, 0, 0, 1, 1, 0)                 \
+  X(Reg_edx, 2, "edx", "dx", "dl", 1, 0, 0, 0, 1, 1, 0)                 \
+  X(Reg_ebx, 3, "ebx", "bx", "bl", 0, 1, 0, 0, 1, 1, 0)                 \
+  X(Reg_esp, 4, "esp", "sp", ""  , 0, 0, 1, 0, 0, 0, 0)                 \
+  X(Reg_ebp, 5, "ebp", "bp", ""  , 0, 1, 0, 1, 0, 1, 0)                 \
+  X(Reg_esi, 6, "esi", "si", ""  , 0, 1, 0, 0, 0, 1, 0)                 \
+  X(Reg_edi, 7, "edi", "di", ""  , 0, 1, 0, 0, 0, 1, 0)      
 
 #define REGX8632_XMM_TABLE                                              \
-  X(Reg_xmm0, = 0,            "xmm0", ""  , ""  , 1, 0, 0, 0, 0, 0, 1)  \
-  X(Reg_xmm1, = Reg_xmm0 + 1, "xmm1", ""  , ""  , 1, 0, 0, 0, 0, 0, 1)  \
-  X(Reg_xmm2, = Reg_xmm0 + 2, "xmm2", ""  , ""  , 1, 0, 0, 0, 0, 0, 1)  \
-  X(Reg_xmm3, = Reg_xmm0 + 3, "xmm3", ""  , ""  , 1, 0, 0, 0, 0, 0, 1)  \
-  X(Reg_xmm4, = Reg_xmm0 + 4, "xmm4", ""  , ""  , 1, 0, 0, 0, 0, 0, 1)  \
-  X(Reg_xmm5, = Reg_xmm0 + 5, "xmm5", ""  , ""  , 1, 0, 0, 0, 0, 0, 1)  \
-  X(Reg_xmm6, = Reg_xmm0 + 6, "xmm6", ""  , ""  , 1, 0, 0, 0, 0, 0, 1)  \
-  X(Reg_xmm7, = Reg_xmm0 + 7, "xmm7", ""  , ""  , 1, 0, 0, 0, 0, 0, 1)  \
+  X(Reg_xmm0, 0, "xmm0", "" , "" , 1, 0, 0, 0, 0, 0, 1)                 \
+  X(Reg_xmm1, 1, "xmm1", "" , "" , 1, 0, 0, 0, 0, 0, 1)                 \
+  X(Reg_xmm2, 2, "xmm2", "" , "" , 1, 0, 0, 0, 0, 0, 1)                 \
+  X(Reg_xmm3, 3, "xmm3", "" , "" , 1, 0, 0, 0, 0, 0, 1)                 \
+  X(Reg_xmm4, 4, "xmm4", "" , "" , 1, 0, 0, 0, 0, 0, 1)                 \
+  X(Reg_xmm5, 5, "xmm5", "" , "" , 1, 0, 0, 0, 0, 0, 1)                 \
+  X(Reg_xmm6, 6, "xmm6", "" , "" , 1, 0, 0, 0, 0, 0, 1)                 \
+  X(Reg_xmm7, 7, "xmm7", "" , "" , 1, 0, 0, 0, 0, 0, 1)                 \
 //#define X(val, encode, name, name16, name8, scratch, preserved, stackptr,
 //          frameptr, isI8, isInt, isFP)
 
@@ -53,7 +53,7 @@
   /* val, encode, name, name16, name8, scratch, preserved, stackptr,    \
      frameptr, isI8, isInt, isFP */                                     \
   REGX8632_GPR_TABLE                                                    \
-  X(Reg_ah,  = Reg_eax + 4,   "???",  ""  , "ah", 0, 0, 0, 0, 0, 0, 0)  \
+  X(Reg_ah, 4, "???", "" , "ah", 0, 0, 0, 0, 0, 0, 0)                   \
   REGX8632_XMM_TABLE
 //#define X(val, encode, name, name16, name8, scratch, preserved, stackptr,
 //          frameptr, isI8, isInt, isFP)
index 7cce661..f0baec4 100644 (file)
@@ -42,7 +42,7 @@ public:
   enum GPRRegister {
 #define X(val, encode, name, name16, name8, scratch, preserved, stackptr,      \
           frameptr, isI8, isInt, isFP)                                         \
-  Encoded_##val encode,
+  Encoded_##val encode,
     REGX8632_GPR_TABLE
 #undef X
         Encoded_Not_GPR = -1
@@ -53,7 +53,7 @@ public:
   enum XmmRegister {
 #define X(val, encode, name, name16, name8, scratch, preserved, stackptr,      \
           frameptr, isI8, isInt, isFP)                                         \
-  Encoded_##val encode,
+  Encoded_##val encode,
     REGX8632_XMM_TABLE
 #undef X
         Encoded_Not_Xmm = -1