* i386-dis.c (twobyte_has_modrm): Update table.
authorAlan Modra <amodra@gmail.com>
Sat, 12 May 2001 12:07:10 +0000 (12:07 +0000)
committerAlan Modra <amodra@gmail.com>
Sat, 12 May 2001 12:07:10 +0000 (12:07 +0000)
(need_modrm): Give it file scope.
(MODRM_CHECK): Define.
(dofloat): Use MODRM_CHECK.
(OP_E): Likewise.
(OP_EM): Likewise.
(OP_EX): Likewise.
and fix testsuite yet again now that we are getting correct disassembly.

gas/testsuite/ChangeLog
gas/testsuite/gas/i386/sse2.d
opcodes/ChangeLog
opcodes/i386-dis.c

index c1d821ba74e0a8a32d9a07adb3123f4de27b92a9..51785868aaae5074195ae1bab9040a28f2173aea 100644 (file)
@@ -1,7 +1,7 @@
 2001-05-12  Alan Modra  <amodra@one.net.au>
 
        * gas/i386/sse2.s: Correct cvtps2dq, movdq2q, and movq2dq
-       * gas/i386/sse2.d: Likewise.  Fix pmuludq too.
+       * gas/i386/sse2.d: Likewise.  Fix pmuludq and punpckhqdq too.
 
        * gas/i386/ssemmx2.d: Correct movq.
 
index 4e9365fcce7410fe4558839b29842099e5dd8611..b7aa48909d2e706b8257dd9e84b0ba4ace95d5ef 100644 (file)
@@ -152,5 +152,5 @@ Disassembly of section .text:
  26b:  f2 0f 70 c8 01[         ]+pshuflw \$0x1,%xmm0,%xmm1
  270:  66 0f 73 f8 01[         ]+pslldq \$0x1,%xmm0
  275:  66 0f 73 d8 01[         ]+psrldq \$0x1,%xmm0
- 27a:  66 0f 6d c8[    ]+punpckhqdq %xmm0,%xmm3
+ 27a:  66 0f 6d c8[    ]+punpckhqdq %xmm0,%xmm1
  27e:  89 f6[  ]+mov[  ]+%esi,%esi
index b4f61fc4ce72a7b218e62041396f18a67e194519..ed1b0a87016a870bdeb3dc771ba8f248c47460a1 100644 (file)
@@ -2,6 +2,13 @@
 
        * i386-dis.c (prefix_user_table): Correct movq2dq, movdq2q, and
        movq operands.
+       (twobyte_has_modrm): Update table.
+       (need_modrm): Give it file scope.
+       (MODRM_CHECK): Define.
+       (dofloat): Use MODRM_CHECK.
+       (OP_E): Likewise.
+       (OP_EM): Likewise.
+       (OP_EX): Likewise.
 
 2001-05-07  Frank Ch. Eigler  <fche@redhat.com>
 
index f1d9e140559518804a2ee964ee1d73f59fd28bc1..4eb57da3823fba40cefe2015ccbdf50897a8ca45 100644 (file)
@@ -2228,20 +2228,20 @@ static const unsigned char twobyte_has_modrm[256] = {
   /*       -------------------------------        */
   /* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */
   /* 10 */ 1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0, /* 1f */
-  /* 20 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 2f */
+  /* 20 */ 1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1, /* 2f */
   /* 30 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 3f */
   /* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */
-  /* 50 */ 1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1, /* 5f */
-  /* 60 */ 1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1, /* 6f */
+  /* 50 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 5f */
+  /* 60 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 6f */
   /* 70 */ 1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1, /* 7f */
   /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */
   /* 90 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 9f */
-  /* a0 */ 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1, /* af */
+  /* a0 */ 0,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1, /* af */
   /* b0 */ 1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1, /* bf */
   /* c0 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* cf */
-  /* d0 */ 0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1, /* df */
-  /* e0 */ 1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1, /* ef */
-  /* f0 */ 0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0  /* ff */
+  /* d0 */ 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* df */
+  /* e0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ef */
+  /* f0 */ 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0  /* ff */
   /*       -------------------------------        */
   /*       0 1 2 3 4 5 6 7 8 9 a b c d e f        */
 };
@@ -2279,8 +2279,14 @@ static disassemble_info *the_info;
 static int mod;
 static int rm;
 static int reg;
+static unsigned char need_modrm;
 static void oappend PARAMS ((const char *s));
 
+/* If we are accessing mod/rm/reg without need_modrm set, then the
+   values are stale.  Hitting this abort likely indicates that you
+   need to update onebyte_has_modrm or twobyte_has_modrm.  */
+#define MODRM_CHECK  if (!need_modrm) abort ()
+
 static const char *names64[] = {
   "%rax","%rcx","%rdx","%rbx", "%rsp","%rbp","%rsi","%rdi",
   "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"
@@ -2989,7 +2995,6 @@ print_insn_i386 (pc, info)
   int two_source_ops;
   char *first, *second, *third;
   int needcomma;
-  unsigned char need_modrm;
   unsigned char uses_SSE_prefix;
   VOLATILE int sizeflag;
   VOLATILE int orig_sizeflag;
@@ -3624,6 +3629,8 @@ dofloat (sizeflag)
         OP_E (v_mode, sizeflag);
       return;
     }
+  /* skip mod/rm byte */
+  MODRM_CHECK;
   codep++;
 
   dp = &float_reg[floatop - 0xd8][reg];
@@ -4038,6 +4045,7 @@ OP_E (bytemode, sizeflag)
     add += 8;
 
   /* skip mod/rm byte */
+  MODRM_CHECK;
   codep++;
 
   if (mod == 3)
@@ -4927,6 +4935,8 @@ OP_EM (bytemode, sizeflag)
   if (rex & REX_EXTZ)
     add = 8;
 
+  /* skip mod/rm byte */
+  MODRM_CHECK;
   codep++;
   used_prefixes |= (prefixes & PREFIX_DATA);
   if (prefixes & PREFIX_DATA)
@@ -4951,6 +4961,8 @@ OP_EX (bytemode, sizeflag)
   if (rex & REX_EXTZ)
     add = 8;
 
+  /* skip mod/rm byte */
+  MODRM_CHECK;
   codep++;
   sprintf (scratchbuf, "%%xmm%d", rm + add);
   oappend (scratchbuf);
This page took 0.030981 seconds and 4 git commands to generate.