From 0f7da3979d1e0e3696266abe279fe4d549e34d61 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 19 Sep 2007 17:52:21 +0000 Subject: [PATCH] gas/testsuite/gas/ 2007-09-19 H.J. Lu * gas/i386/intelok.s: Add tests for memory without base. * gas/i386/intelok.d: Updated. * gas/i386/intelok.e: Likewise. opcodes/ 2007-09-19 H.J. Lu * i386-dis.c (OP_E_extended): Always display scale for memory. --- gas/testsuite/ChangeLog | 6 ++++++ gas/testsuite/gas/i386/intelok.d | 25 ++++++++++++++----------- gas/testsuite/gas/i386/intelok.e | 10 +++++----- gas/testsuite/gas/i386/intelok.s | 3 +++ opcodes/ChangeLog | 4 ++++ opcodes/i386-dis.c | 9 ++++++--- 6 files changed, 38 insertions(+), 19 deletions(-) diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 99c78a243f8..2995298c885 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2007-09-19 H.J. Lu + + * 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 * 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 878b712cf11..b3a1988c542 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\] -[ ]*[0-9a-f]+: 8b 44 08 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\+(0x)?1\] -[ ]*[0-9a-f]+: 8b 44 08 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\+(0x)?1\] -[ ]*[0-9a-f]+: 8b 44 08 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\+(0x)?1\] -[ ]*[0-9a-f]+: 8b 44 08 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\+(0x)?1\] -[ ]*[0-9a-f]+: 8b 44 08 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\+(0x)?1\] +[ ]*[0-9a-f]+: 8b 44 08 10[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\*1\+0x10\] +[ ]*[0-9a-f]+: 8b 44 08 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\*1\+(0x)?1\] +[ ]*[0-9a-f]+: 8b 44 08 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\*1\+(0x)?1\] +[ ]*[0-9a-f]+: 8b 44 08 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\*1\+(0x)?1\] +[ ]*[0-9a-f]+: 8b 44 08 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\*1\+(0x)?1\] +[ ]*[0-9a-f]+: 8b 44 08 01[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\*1\+(0x)?1\] [ ]*[0-9a-f]+: 8b 00[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\] -[ ]*[0-9a-f]+: 8b 04 08[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\] -[ ]*[0-9a-f]+: 8b 04 08[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\] +[ ]*[0-9a-f]+: 8b 04 08[ ]+mov[ ]+eax,(DWORD PTR )?\[eax\+ecx\*1\] +[ ]*[0-9a-f]+: 8b 04 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 8403bf218e8..dbe4a052c8a 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 c46a1787485..a313922941a 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 2fea362087a..1434860a289 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,7 @@ +2007-09-19 H.J. Lu + + * i386-dis.c (OP_E_extended): Always display scale for memory. + 2007-09-17 H.J. Lu * i386-opc.h (RegRip): New. diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 82b2bcbd1e4..19b13d0dad4 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'; -- 2.30.2