diff options
-rw-r--r-- | gas/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/intelok.d | 25 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/intelok.e | 10 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/intelok.s | 3 | ||||
-rw-r--r-- | opcodes/ChangeLog | 4 | ||||
-rw-r--r-- | opcodes/i386-dis.c | 9 |
6 files changed, 38 insertions, 19 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 99c78a2..2995298 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2007-09-19 H.J. Lu <hongjiu.lu@intel.com> + + * gas/i386/intelok.s: Add tests for memory without base. + * gas/i386/intelok.d: Updated. + * gas/i386/intelok.e: Likewise. + 2007-09-17 H.J. Lu <hongjiu.lu@intel.com> * gas/i386/x86-64-rip.s: Revert the last change. diff --git a/gas/testsuite/gas/i386/intelok.d b/gas/testsuite/gas/i386/intelok.d index 878b712..b3a1988 100644 --- a/gas/testsuite/gas/i386/intelok.d +++ b/gas/testsuite/gas/i386/intelok.d @@ -106,26 +106,29 @@ Disassembly of section .text: [ ]*[0-9a-f]+: 8b 40 12[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+0x12\] [ ]*[0-9a-f]+: 8b 04 85 02 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\*4\+(0x)?2\] [ ]*[0-9a-f]+: 8b 04 85 02 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\*4\+(0x)?2\] +[ ]*[0-9a-f]+: 8b 04 05 00 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\*1\+(0x)?0] +[ ]*[0-9a-f]+: 8b 04 05 00 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\*1\+(0x)?0] +[ ]*[0-9a-f]+: 8b 04 05 00 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\*1\+(0x)?0] [ ]*[0-9a-f]+: 8b 04 45 00 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\*2\+(0x)?0] [ ]*[0-9a-f]+: 8b 04 45 00 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\*2\+(0x)?0] [ ]*[0-9a-f]+: 8b 04 8d 00 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[ecx\*4\+(0x)?0] [ ]*[0-9a-f]+: 8b 04 8d 00 00 00 00[ ]+mov[ ]+eax,(DWORD PTR )?\[ecx\*4\+(0x)?0] [ ]*[0-9a-f]+: 8b 40 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+(0x)?1\] [ ]*[0-9a-f]+: 8b 40 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+(0x)?1\] -[ ]*[0-9a-f]+: 8b 44 08 fb[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\-(0x)?5\] -[ ]*[0-9a-f]+: 8b 44 08 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\+(0x)?1\] -[ ]*[0-9a-f]+: 8b 44 08 0f[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\+0xf\] +[ ]*[0-9a-f]+: 8b 44 08 fb[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\*1\-(0x)?5\] +[ ]*[0-9a-f]+: 8b 44 08 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\*1\+(0x)?1\] +[ ]*[0-9a-f]+: 8b 44 08 0f[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\*1\+0xf\] [ ]*[0-9a-f]+: 8b 40 10[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+0x10\] [ ]*[0-9a-f]+: 8b 40 10[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+0x10\] -[ ]*[0-9a-f]+: 8b 44 08 10[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\+0x10\] -[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08[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\*1\] [ ]*[0-9a-f]+: 26 8b 00[ ]+mov[ ]+eax,(DWORD PTR )?es:\[eax\] [ ]*[0-9a-f]+: 6a 01[ ]+push[ ]+0x1 [ ]*[0-9a-f]+: 6a ff[ ]+push[ ]+0xffffffff diff --git a/gas/testsuite/gas/i386/intelok.e b/gas/testsuite/gas/i386/intelok.e index 8403bf2..dbe4a05 100644 --- a/gas/testsuite/gas/i386/intelok.e +++ b/gas/testsuite/gas/i386/intelok.e @@ -1,8 +1,8 @@ .*: Assembler messages: -.*:170: Warning: .* taken to mean just .* -.*:177: Warning: Treating .* as memory reference -.*:178: Warning: .* taken to mean just .* -.*:178: Warning: Treating .* as memory reference +.*:173: Warning: .* taken to mean just .* +.*:180: Warning: Treating .* as memory reference +.*:181: Warning: .* taken to mean just .* .*:181: Warning: Treating .* as memory reference -.*:182: Warning: Treating .* as memory reference +.*:184: Warning: Treating .* as memory reference .*:185: Warning: Treating .* as memory reference +.*:188: Warning: Treating .* as memory reference diff --git a/gas/testsuite/gas/i386/intelok.s b/gas/testsuite/gas/i386/intelok.s index c46a178..a313922 100644 --- a/gas/testsuite/gas/i386/intelok.s +++ b/gas/testsuite/gas/i386/intelok.s @@ -114,6 +114,9 @@ start: mov eax, [word+eax*dword] mov eax, word[eax*dword] + mov eax, [eax*1] + mov eax, [eax*+1] + mov eax, [+1*eax] mov eax, [eax*+2] mov eax, [+2*eax] mov eax, [ecx*dword] diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 2fea362..1434860 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,7 @@ +2007-09-19 H.J. Lu <hongjiu.lu@intel.com> + + * i386-dis.c (OP_E_extended): Always display scale for memory. + 2007-09-17 H.J. Lu <hongjiu.lu@intel.com> * i386-opc.h (RegRip): New. diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 82b2bcb..19b13d0 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -6303,12 +6303,14 @@ OP_E_extended (int bytemode, int sizeflag, int has_drex) int havedisp; int havesib; int havebase; + int haveindex; int base; int index = 0; int scale = 0; havesib = 0; havebase = 1; + haveindex = 0; base = modrm.rm; if (base == 4) @@ -6323,6 +6325,7 @@ OP_E_extended (int bytemode, int sizeflag, int has_drex) USED_REX (REX_X); if (rex & REX_X) index += 8; + haveindex = index != 4; codep++; } base += add; @@ -6357,7 +6360,7 @@ OP_E_extended (int bytemode, int sizeflag, int has_drex) break; } - havedisp = havebase || (havesib && (index != 4 || scale != 0)); + havedisp = havebase || (havesib && (haveindex || scale != 0)); if (!intel_syntax) if (modrm.mod != 0 || (base & 7) == 5) @@ -6388,7 +6391,7 @@ OP_E_extended (int bytemode, int sizeflag, int has_drex) ? names64[base] : names32[base]); if (havesib) { - if (index != 4) + if (haveindex) { if (!intel_syntax || havebase) { @@ -6399,7 +6402,7 @@ OP_E_extended (int bytemode, int sizeflag, int has_drex) && (sizeflag & AFLAG) ? names64[index] : names32[index]); } - if (scale != 0 || (!intel_syntax && index != 4)) + if (scale != 0 || haveindex) { *obufp++ = scale_char; *obufp = '\0'; |