Bug 1111241 - SpiderMonkey: Fix VEX encoding helpers to support omitting src0 r=jandem
authorDan Gohman <sunfish@mozilla.com>
Mon, 15 Dec 2014 20:54:00 -0800
changeset 219889 9148324616e86ae941cfd49bcb105aff1148c774
parent 219888 a8abb3321dc0469549094e328dcf03dc2ad61c4a
child 219890 8e00d242e6a28189d229eec0ca229fb6a927ecea
push id10419
push usercbook@mozilla.com
push dateTue, 16 Dec 2014 12:45:27 +0000
treeherderfx-team@ec87657146eb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1111241
milestone37.0a1
Bug 1111241 - SpiderMonkey: Fix VEX encoding helpers to support omitting src0 r=jandem
js/src/jit/shared/BaseAssembler-x86-shared.h
--- a/js/src/jit/shared/BaseAssembler-x86-shared.h
+++ b/js/src/jit/shared/BaseAssembler-x86-shared.h
@@ -4378,164 +4378,164 @@ private:
         return name + 1;
     }
 
 #ifdef JS_CODEGEN_X64
     void twoByteRipOpSimd(const char *name, VexOperandType ty, TwoByteOpcodeID opcode,
                           int ripOffset, XMMRegisterID src0, XMMRegisterID dst)
     {
         if (useLegacySSEEncoding(src0, dst)) {
-            spew("%-11s?%+d(%%rip), %s", legacySSEOpName(name), ripOffset, nameFPReg(src0));
+            spew("%-11s?%+d(%%rip), %s", legacySSEOpName(name), ripOffset, nameFPReg(dst));
             m_formatter.legacySSEPrefix(ty);
-            m_formatter.twoByteRipOp(opcode, ripOffset, src0);
+            m_formatter.twoByteRipOp(opcode, ripOffset, dst);
             return;
         }
 
         spew("%-11s?%+d(%%rip), %s, %s", name, ripOffset, nameFPReg(src0), nameFPReg(dst));
         m_formatter.twoByteRipOpVex(ty, opcode, ripOffset, src0, dst);
     }
 #endif
 
     void twoByteOpSimd(const char *name, VexOperandType ty, TwoByteOpcodeID opcode,
                        XMMRegisterID rm, XMMRegisterID src0, XMMRegisterID dst)
     {
         if (useLegacySSEEncoding(src0, dst)) {
-            spew("%-11s%s, %s", legacySSEOpName(name), nameFPReg(rm), nameFPReg(src0));
+            spew("%-11s%s, %s", legacySSEOpName(name), nameFPReg(rm), nameFPReg(dst));
             m_formatter.legacySSEPrefix(ty);
-            m_formatter.twoByteOp(opcode, (RegisterID)rm, src0);
+            m_formatter.twoByteOp(opcode, (RegisterID)rm, dst);
             return;
         }
 
         spew("%-11s%s, %s, %s", name, nameFPReg(rm), nameFPReg(src0), nameFPReg(dst));
         m_formatter.twoByteOpVex(ty, opcode, (RegisterID)rm, src0, dst);
     }
 
     void twoByteOpSimd(const char *name, VexOperandType ty, TwoByteOpcodeID opcode,
                        int offset, RegisterID base, XMMRegisterID src0, XMMRegisterID dst)
     {
         if (useLegacySSEEncoding(src0, dst)) {
             spew("%-11s%s0x%x(%s), %s", legacySSEOpName(name),
-                 PRETTY_PRINT_OFFSET(offset), nameIReg(base), nameFPReg(src0));
+                 PRETTY_PRINT_OFFSET(offset), nameIReg(base), nameFPReg(dst));
             m_formatter.legacySSEPrefix(ty);
-            m_formatter.twoByteOp(opcode, offset, base, src0);
+            m_formatter.twoByteOp(opcode, offset, base, dst);
             return;
         }
 
         spew("%-11s%s0x%x(%s), %s, %s", name,
              PRETTY_PRINT_OFFSET(offset), nameIReg(base), nameFPReg(src0), nameFPReg(dst));
         m_formatter.twoByteOpVex(ty, opcode, offset, base, src0, dst);
     }
 
     void twoByteOpSimd_disp32(const char *name, VexOperandType ty, TwoByteOpcodeID opcode,
                               int offset, RegisterID base, XMMRegisterID src0, XMMRegisterID dst)
     {
         if (useLegacySSEEncoding(src0, dst)) {
             spew("%-11s%s0x%04x(%s), %s", legacySSEOpName(name),
-                 PRETTY_PRINT_OFFSET(offset), nameIReg(base), nameFPReg(src0));
+                 PRETTY_PRINT_OFFSET(offset), nameIReg(base), nameFPReg(dst));
             m_formatter.legacySSEPrefix(ty);
-            m_formatter.twoByteOp_disp32(opcode, offset, base, src0);
+            m_formatter.twoByteOp_disp32(opcode, offset, base, dst);
             return;
         }
 
         spew("%-11s%s0x%04x(%s), %s, %s", name,
              PRETTY_PRINT_OFFSET(offset), nameIReg(base), nameFPReg(src0), nameFPReg(dst));
         m_formatter.twoByteOpVex_disp32(ty, opcode, offset, base, src0, dst);
     }
 
     void twoByteOpSimd(const char *name, VexOperandType ty, TwoByteOpcodeID opcode,
                        int offset, RegisterID base, RegisterID index, int scale,
                        XMMRegisterID src0, XMMRegisterID dst)
     {
         if (useLegacySSEEncoding(src0, dst)) {
             spew("%-11s%s0x%x(%s,%s,%d), %s", legacySSEOpName(name),
                  PRETTY_PRINT_OFFSET(offset), nameIReg(base), nameIReg(index), scale,
-                 nameFPReg(src0));
+                 nameFPReg(dst));
             m_formatter.legacySSEPrefix(ty);
-            m_formatter.twoByteOp(opcode, offset, base, index, scale, src0);
+            m_formatter.twoByteOp(opcode, offset, base, index, scale, dst);
             return;
         }
 
         spew("%-11s%s0x%x(%s,%s,%d), %s, %s", name, PRETTY_PRINT_OFFSET(offset), nameIReg(base),
              nameIReg(index), scale, nameFPReg(src0), nameFPReg(dst));
         m_formatter.twoByteOpVex(ty, opcode, offset, base, index, scale, src0, dst);
     }
 
     void twoByteOpSimd(const char *name, VexOperandType ty, TwoByteOpcodeID opcode,
                        const void* address, XMMRegisterID src0, XMMRegisterID dst)
     {
         if (useLegacySSEEncoding(src0, dst)) {
-            spew("%-11s%p, %s", legacySSEOpName(name), address, nameFPReg(src0));
+            spew("%-11s%p, %s", legacySSEOpName(name), address, nameFPReg(dst));
             m_formatter.legacySSEPrefix(ty);
-            m_formatter.twoByteOp(opcode, address, src0);
+            m_formatter.twoByteOp(opcode, address, dst);
             return;
         }
 
         spew("%-11s%p, %s, %s", name, address, nameFPReg(src0), nameFPReg(dst));
         m_formatter.twoByteOpVex(ty, opcode, address, src0, dst);
     }
 
     void threeByteOpSimd(const char *name, VexOperandType ty, ThreeByteOpcodeID opcode,
                          ThreeByteEscape escape,
                          XMMRegisterID rm, XMMRegisterID src0, XMMRegisterID dst)
     {
         if (useLegacySSEEncoding(src0, dst)) {
-            spew("%-11s%s, %s", legacySSEOpName(name), nameFPReg(rm), nameFPReg(src0));
+            spew("%-11s%s, %s", legacySSEOpName(name), nameFPReg(rm), nameFPReg(dst));
             m_formatter.legacySSEPrefix(ty);
-            m_formatter.threeByteOp(opcode, escape, (RegisterID)rm, src0);
+            m_formatter.threeByteOp(opcode, escape, (RegisterID)rm, dst);
             return;
         }
 
         spew("%-11s%s, %s, %s", name, nameFPReg(rm), nameFPReg(src0), nameFPReg(dst));
         m_formatter.threeByteOpVex(ty, opcode, escape, (RegisterID)rm, src0, dst);
     }
 
     void threeByteOpSimd(const char *name, VexOperandType ty, ThreeByteOpcodeID opcode,
                          ThreeByteEscape escape,
                          int offset, RegisterID base, XMMRegisterID src0, XMMRegisterID dst)
     {
         if (useLegacySSEEncoding(src0, dst)) {
             spew("%-11s%s0x%x(%s), %s", legacySSEOpName(name),
-                 PRETTY_PRINT_OFFSET(offset), nameIReg(base), nameFPReg(src0));
+                 PRETTY_PRINT_OFFSET(offset), nameIReg(base), nameFPReg(dst));
             m_formatter.legacySSEPrefix(ty);
-            m_formatter.threeByteOp(opcode, escape, offset, base, src0);
+            m_formatter.threeByteOp(opcode, escape, offset, base, dst);
             return;
         }
 
         spew("%-11s%s0x%x(%s), %s, %s", name,
              PRETTY_PRINT_OFFSET(offset), nameIReg(base), nameFPReg(src0), nameFPReg(dst));
         m_formatter.threeByteOpVex(ty, opcode, escape, offset, base, src0, dst);
     }
 
     // Blendv is a three-byte op, but the VEX encoding has a different opcode
     // than the SSE encoding, so we handle it specially.
     void vblendvOpSimd(XMMRegisterID mask, XMMRegisterID rm, XMMRegisterID src0, XMMRegisterID dst)
     {
         if (useLegacySSEEncodingForVblendv(mask, src0, dst)) {
-            spew("blendvps   %s, %s", nameFPReg(rm), nameFPReg(src0));
+            spew("blendvps   %s, %s", nameFPReg(rm), nameFPReg(dst));
             // Even though a "ps" instruction, vblendv is encoded with the "pd" prefix.
             m_formatter.legacySSEPrefix(VEX_PD);
-            m_formatter.threeByteOp(OP3_BLENDVPS_VdqWdq, ESCAPE_BLENDVPS, (RegisterID)rm, src0);
+            m_formatter.threeByteOp(OP3_BLENDVPS_VdqWdq, ESCAPE_BLENDVPS, (RegisterID)rm, dst);
             return;
         }
 
         spew("vblendvps  %s, %s, %s, %s",
              nameFPReg(mask), nameFPReg(rm), nameFPReg(src0), nameFPReg(dst));
         // Even though a "ps" instruction, vblendv is encoded with the "pd" prefix.
         m_formatter.vblendvOpVex(VEX_PD, OP3_VBLENDVPS_VdqWdq, ESCAPE_VBLENDVPS,
                                  mask, (RegisterID)rm, src0, dst);
     }
 
     void vblendvOpSimd(XMMRegisterID mask, int offset, RegisterID base, XMMRegisterID src0, XMMRegisterID dst)
     {
         if (useLegacySSEEncodingForVblendv(mask, src0, dst)) {
             spew("blendvps   %s0x%x(%s), %s",
-                 PRETTY_PRINT_OFFSET(offset), nameIReg(base), nameFPReg(src0));
+                 PRETTY_PRINT_OFFSET(offset), nameIReg(base), nameFPReg(dst));
             // Even though a "ps" instruction, vblendv is encoded with the "pd" prefix.
             m_formatter.legacySSEPrefix(VEX_PD);
-            m_formatter.threeByteOp(OP3_BLENDVPS_VdqWdq, ESCAPE_BLENDVPS, offset, base, src0);
+            m_formatter.threeByteOp(OP3_BLENDVPS_VdqWdq, ESCAPE_BLENDVPS, offset, base, dst);
             return;
         }
 
         spew("vblendvps  %s, %s0x%x(%s), %s, %s",
              nameFPReg(mask), PRETTY_PRINT_OFFSET(offset), nameIReg(base),
              nameFPReg(src0), nameFPReg(dst));
         // Even though a "ps" instruction, vblendv is encoded with the "pd" prefix.
         m_formatter.vblendvOpVex(VEX_PD, OP3_VBLENDVPS_VdqWdq, ESCAPE_VBLENDVPS,