x86: Don't display eiz with no scale
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 15 Jul 2020 13:49:45 +0000 (06:49 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 15 Jul 2020 13:57:47 +0000 (06:57 -0700)
Change

67 48 8b 1c 25 ef cd ab 89  mov    0x89abcdef(,%eiz,1),%rbx

to

67 48 8b 1c 25 ef cd ab 89  mov    0x89abcdef,%rbx

in AT&T syntax and

67 48 8b 1c 25 ef cd ab 89  mov    rbx,QWORD PTR [eiz*1+0x89abcdef]

to

67 48 8b 1c 25 ef cd ab 89  mov    rbx,QWORD PTR ds:0x89abcdef

in Intel syntax.

gas/

PR gas/26237
* testsuite/gas/i386/evex-no-scale-64.d: Updated.
* testsuite/gas/i386/addr32.d: Likewise.
* testsuite/gas/i386/x86-64-addr32-intel.d: Likewise.
* testsuite/gas/i386/x86-64-addr32.d: Likewise.

opcodes/

PR gas/26237
* i386-dis.c (OP_E_memory): Don't display eiz with no scale
without base nor index registers.

gas/ChangeLog
gas/testsuite/gas/i386/evex-no-scale-64.d
gas/testsuite/gas/i386/x86-64-addr32-intel.d
gas/testsuite/gas/i386/x86-64-addr32.d
opcodes/ChangeLog
opcodes/i386-dis.c

index 194819eecfd4cfed73b37015cfb75f262545c1d0..2336fb57e15e3d7dae1fc7cc41b11e2b18b94240 100644 (file)
@@ -1,3 +1,11 @@
+2020-07-15  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR gas/26237
+       * testsuite/gas/i386/evex-no-scale-64.d: Updated.
+       * testsuite/gas/i386/addr32.d: Likewise.
+       * testsuite/gas/i386/x86-64-addr32-intel.d: Likewise.
+       * testsuite/gas/i386/x86-64-addr32.d: Likewise.
+
 2020-07-15  Nick Clifton  <nickc@redhat.com>
 
        * write.c (create_note_reloc): Add desc2_size parameter.  Zero out
index 33623656eefbc6fcc8046bbbffbdff8d598c25a8..6c9f68faf234af5bd43e8236feb348389f85e98e 100644 (file)
@@ -10,5 +10,5 @@ Disassembly of section .text:
  +[a-f0-9]+:   62 f1 7c 48 28 04 05 40 00 00 00        vmovaps 0x40\(,%rax,1\),%zmm0
  +[a-f0-9]+:   62 f1 7c 48 28 04 25 40 00 00 00        vmovaps 0x40,%zmm0
  +[a-f0-9]+:   67 62 f1 7c 48 28 04 05 40 00 00 00     vmovaps 0x40\(,%eax,1\),%zmm0
- +[a-f0-9]+:   67 62 f1 7c 48 28 04 25 40 00 00 00     vmovaps 0x40\(,%eiz,1\),%zmm0
+ +[a-f0-9]+:   67 62 f1 7c 48 28 04 25 40 00 00 00     vmovaps 0x40,%zmm0
  +[a-f0-9]+:   62 f1 7c 48 28 04 25 40 00 00 00        vmovaps 0x40,%zmm0
index 0988457b34c5e4e5691ee59105f17ade3588415d..7a25d40162c3a332458482822a10573713171cc3 100644 (file)
@@ -11,15 +11,15 @@ Disassembly of section .text:
 [      ]*[a-f0-9]+:    67 48 8d 80 00 00 00 00[        ]+lea[  ]+rax,\[eax\+0x0\].*
 [      ]*[a-f0-9]+:    67 49 8d 80 00 00 00 00[        ]+lea[  ]+rax,\[r8d\+0x0\].*
 [      ]*[a-f0-9]+:    67 48 8d 05 00 00 00 00[        ]+lea[  ]+rax,\[eip\+0x0\].*
-[      ]*[a-f0-9]+:    67 48 8d 04 25 00 00 00 00      lea[ ]+rax,\[eiz\*1\+0x0\].*
+[      ]*[a-f0-9]+:    67 48 8d 04 25 00 00 00 00      lea[ ]+rax,ds:0x0       .*
 [      ]*[a-f0-9]+:    67 a0 98 08 60 00       addr32 mov al,ds:0x600898
 [      ]*[a-f0-9]+:    67 66 a1 98 08 60 00    addr32 mov ax,ds:0x600898
 [      ]*[a-f0-9]+:    67 a1 98 08 60 00       addr32 mov eax,ds:0x600898
 [      ]*[a-f0-9]+:    67 48 a1 98 08 60 00    addr32 mov rax,ds:0x600898
 [      ]*[a-f0-9]+:    67 48 a1 98 08 80 00    addr32 mov rax,ds:0x800898
-[      ]*[a-f0-9]+:    67 48 8b 1c 25 98 08 80 00      mov[ ]+rbx,QWORD PTR \[eiz\*1\+0x800898\]
+[      ]*[a-f0-9]+:    67 48 8b 1c 25 98 08 80 00      mov[ ]+rbx,QWORD PTR ds:0x800898
 [      ]*[a-f0-9]+:    67 48 a1 ef cd ab 89    addr32 mov rax,ds:0x89abcdef
-[      ]*[a-f0-9]+:    67 48 8b 1c 25 ef cd ab 89      mov[ ]+rbx,QWORD PTR \[eiz\*1\+0x89abcdef\]
+[      ]*[a-f0-9]+:    67 48 8b 1c 25 ef cd ab 89      mov[ ]+rbx,QWORD PTR ds:0x89abcdef
 [      ]*[a-f0-9]+:    67 48 b8 ef cd ab 89 00 00 00 00        addr32 movabs rax,0x89abcdef
 [      ]*[a-f0-9]+:    67 48 bb ef cd ab 89 00 00 00 00        addr32 movabs rbx,0x89abcdef
 [      ]*[a-f0-9]+:    67 a2 98 08 60 00       addr32 mov ds:0x600898,al
@@ -27,9 +27,9 @@ Disassembly of section .text:
 [      ]*[a-f0-9]+:    67 a3 98 08 60 00       addr32 mov ds:0x600898,eax
 [      ]*[a-f0-9]+:    67 48 a3 98 08 60 00    addr32 mov ds:0x600898,rax
 [      ]*[a-f0-9]+:    67 48 a3 98 08 80 00    addr32 mov ds:0x800898,rax
-[      ]*[a-f0-9]+:    67 48 89 1c 25 98 08 80 00      mov[ ]+QWORD PTR \[eiz\*1\+0x800898\],rbx
+[      ]*[a-f0-9]+:    67 48 89 1c 25 98 08 80 00      mov[ ]+QWORD PTR ds:0x800898,rbx
 [      ]*[a-f0-9]+:    67 48 a3 ef cd ab 89    addr32 mov ds:0x89abcdef,rax
-[      ]*[a-f0-9]+:    67 48 89 1c 25 ef cd ab 89      mov[ ]+QWORD PTR \[eiz\*1\+0x89abcdef\],rbx
-[      ]*[a-f0-9]+:    67 89 04 25 11 22 33 ff         mov[ ]+DWORD PTR \[eiz\*1\+0xff332211\],eax
+[      ]*[a-f0-9]+:    67 48 89 1c 25 ef cd ab 89      mov[ ]+QWORD PTR ds:0x89abcdef,rbx
+[      ]*[a-f0-9]+:    67 89 04 25 11 22 33 ff         mov[ ]+DWORD PTR ds:0xff332211,eax
 [      ]*[a-f0-9]+:    67 89 04 65 11 22 33 ff         mov[ ]+DWORD PTR \[eiz\*2\+0xff332211\],eax
 #pass
index d9481a7439ec363a18ec7050367fba0e485eaff6..c513f0dd8e13b2788bbaa360175d336a6476322b 100644 (file)
@@ -10,15 +10,15 @@ Disassembly of section .text:
 [      ]*[a-f0-9]+:    67 48 8d 80 00 00 00 00[        ]+lea[  ]+0x0\(%eax\),%rax.*
 [      ]*[a-f0-9]+:    67 49 8d 80 00 00 00 00[        ]+lea[  ]+0x0\(%r8d\),%rax.*
 [      ]*[a-f0-9]+:    67 48 8d 05 00 00 00 00[        ]+lea[  ]+0x0\(%eip\),%rax.*
-[      ]*[a-f0-9]+:    67 48 8d 04 25 00 00 00 00[     ]+lea[ ]+0x0\(,%eiz,1\),%rax.*
+[      ]*[a-f0-9]+:    67 48 8d 04 25 00 00 00 00[     ]+lea[ ]+0x0,%rax.*
 [      ]*[a-f0-9]+:    67 a0 98 08 60 00       addr32 mov 0x600898,%al
 [      ]*[a-f0-9]+:    67 66 a1 98 08 60 00    addr32 mov 0x600898,%ax
 [      ]*[a-f0-9]+:    67 a1 98 08 60 00       addr32 mov 0x600898,%eax
 [      ]*[a-f0-9]+:    67 48 a1 98 08 60 00    addr32 mov 0x600898,%rax
 [      ]*[a-f0-9]+:    67 48 a1 98 08 80 00    addr32 mov 0x800898,%rax
-[      ]*[a-f0-9]+:    67 48 8b 1c 25 98 08 80 00      mov[ ]+0x800898\(,%eiz,1\),%rbx
+[      ]*[a-f0-9]+:    67 48 8b 1c 25 98 08 80 00      mov[ ]+0x800898,%rbx
 [      ]*[a-f0-9]+:    67 48 a1 ef cd ab 89    addr32 mov 0x89abcdef,%rax
-[      ]*[a-f0-9]+:    67 48 8b 1c 25 ef cd ab 89      mov[ ]+0x89abcdef\(,%eiz,1\),%rbx
+[      ]*[a-f0-9]+:    67 48 8b 1c 25 ef cd ab 89      mov[ ]+0x89abcdef,%rbx
 [      ]*[a-f0-9]+:    67 48 b8 ef cd ab 89 00 00 00 00        addr32 movabs \$0x89abcdef,%rax
 [      ]*[a-f0-9]+:    67 48 bb ef cd ab 89 00 00 00 00        addr32 movabs \$0x89abcdef,%rbx
 [      ]*[a-f0-9]+:    67 a2 98 08 60 00       addr32 mov %al,0x600898
@@ -26,9 +26,9 @@ Disassembly of section .text:
 [      ]*[a-f0-9]+:    67 a3 98 08 60 00       addr32 mov %eax,0x600898
 [      ]*[a-f0-9]+:    67 48 a3 98 08 60 00    addr32 mov %rax,0x600898
 [      ]*[a-f0-9]+:    67 48 a3 98 08 80 00    addr32 mov %rax,0x800898
-[      ]*[a-f0-9]+:    67 48 89 1c 25 98 08 80 00      mov[ ]+%rbx,0x800898\(,%eiz,1\)
+[      ]*[a-f0-9]+:    67 48 89 1c 25 98 08 80 00      mov[ ]+%rbx,0x800898
 [      ]*[a-f0-9]+:    67 48 a3 ef cd ab 89    addr32 mov %rax,0x89abcdef
-[      ]*[a-f0-9]+:    67 48 89 1c 25 ef cd ab 89      mov[ ]+%rbx,0x89abcdef\(,%eiz,1\)
-[      ]*[a-f0-9]+:    67 89 04 25 11 22 33 ff         mov[ ]+%eax,0xff332211\(,%eiz,1\)
+[      ]*[a-f0-9]+:    67 48 89 1c 25 ef cd ab 89      mov[ ]+%rbx,0x89abcdef
+[      ]*[a-f0-9]+:    67 89 04 25 11 22 33 ff         mov[ ]+%eax,0xff332211
 [      ]*[a-f0-9]+:    67 89 04 65 11 22 33 ff         mov[ ]+%eax,0xff332211\(,%eiz,2\)
 #pass
index e4e26a18d6b4828951b606d91a00b1995659c180..91d7f5b67455358e0b898cb7e43f6f9a33748c39 100644 (file)
@@ -1,3 +1,9 @@
+2020-07-15  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR gas/26237
+       * i386-dis.c (OP_E_memory): Don't display eiz with no scale
+       without base nor index registers.
+
 2020-07-15  Jan Beulich  <jbeulich@suse.com>
 
        * i386-dis.c (putop): Move 'V' and 'W' handling.
index cd8a9a8d752f7f0e825556c460f0bd8890939214..d1d7a7d94d489ae6f18b4a4be01a9855d7e69d6a 100644 (file)
@@ -11818,7 +11818,7 @@ OP_E_memory (int bytemode, int sizeflag)
                  /* Without base nor index registers, zero-extend the
                     lower 32-bit displacement to 64 bits.  */
                  disp = (unsigned int) disp;
-                 needindex = 1;
+                 needindex = scale;
                }
              needaddr32 = 1;
            }
This page took 0.045149 seconds and 4 git commands to generate.