From 435acd52e0b267c3a5812117255a3bb29304ce9f Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Fri, 26 Aug 2005 15:51:15 +0000 Subject: [PATCH] gas/ 2005-08-26 Jan Beulich * config/tc-i386.c (intel_e09): Set JumpAbsolute when seeing a PTR- qualified operand of a branch. (intel_bracket_expr): Set JumpAbsolute here... (intel_e11): ... rather than here. gas/testsuite/ 2005-08-26 Jan Beulich * gas/i386/intel.s: Adjust. * gas/i386/intelok.s: Add two more insns. * gas/i386/intelok.d: Adjust. --- gas/ChangeLog | 7 +++++++ gas/config/tc-i386.c | 19 +++++++++++-------- gas/testsuite/ChangeLog | 6 ++++++ gas/testsuite/gas/i386/intel.s | 2 +- gas/testsuite/gas/i386/intelok.d | 2 ++ gas/testsuite/gas/i386/intelok.s | 2 ++ 6 files changed, 29 insertions(+), 9 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 255a7b3..41ae66c 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2005-08-26 Jan Beulich + + * config/tc-i386.c (intel_e09): Set JumpAbsolute when seeing a PTR- + qualified operand of a branch. + (intel_bracket_expr): Set JumpAbsolute here... + (intel_e11): ... rather than here. + 2005-08-26 Christian Groessler * configure.tgt: Set bfd_gas also for z8k cpu. diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index acba3e1..6542e54 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -6159,7 +6159,7 @@ intel_e09 () suffix = WORD_MNEM_SUFFIX; else if (flag_code == CODE_16BIT && (current_templates->start->opcode_modifier - & (Jump|JumpDword|JumpInterSegment))) + & (Jump | JumpDword))) suffix = LONG_DOUBLE_MNEM_SUFFIX; else if (intel_parser.got_a_float == 1) /* "f..." */ suffix = SHORT_MNEM_SUFFIX; @@ -6211,6 +6211,11 @@ intel_e09 () return 0; } + /* Operands for jump/call using 'ptr' notation denote absolute + addresses. */ + if (current_templates->start->opcode_modifier & (Jump | JumpDword)) + i.types[this_operand] |= JumpAbsolute; + if (current_templates->start->base_opcode == 0x8d /* lea */) ; else if (!i.suffix) @@ -6295,6 +6300,11 @@ intel_bracket_expr () if (!intel_parser.in_offset) { ++intel_parser.in_bracket; + + /* Operands for jump/call inside brackets denote absolute addresses. */ + if (current_templates->start->opcode_modifier & (Jump | JumpDword)) + i.types[this_operand] |= JumpAbsolute; + /* Unfortunately gas always diverged from MASM in a respect that can't be easily fixed without risking to break code sequences likely to be encountered (the testsuite even check for this): MASM doesn't consider @@ -6397,13 +6407,6 @@ intel_e11 () /* e11 [ expr ] */ case '[': - /* Operands for jump/call inside brackets denote absolute addresses. - XXX This shouldn't be needed anymore (or if it should rather live - in intel_bracket_expr). */ - if (current_templates->start->opcode_modifier - & (Jump|JumpDword|JumpByte|JumpInterSegment)) - i.types[this_operand] |= JumpAbsolute; - return intel_bracket_expr (); /* e11 $ diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 3d0ffb2..2bddc36 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,5 +1,11 @@ 2005-08-26 Jan Beulich + * gas/i386/intel.s: Adjust. + * gas/i386/intelok.s: Add two more insns. + * gas/i386/intelok.d: Adjust. + +2005-08-26 Jan Beulich + * gas/i386/intelok.d: Adjust. 2005-08-25 Chao-ying Fu diff --git a/gas/testsuite/gas/i386/intel.s b/gas/testsuite/gas/i386/intel.s index b713369..a262cac 100644 --- a/gas/testsuite/gas/i386/intel.s +++ b/gas/testsuite/gas/i386/intel.s @@ -520,7 +520,7 @@ foo: rcl word ptr 0x90909090[eax], cl in ax, 0x90 out 0x90, ax - call word ptr .+3+0x9090 + callw .+3+0x9090 jmpw 0x9090,0x9090 in ax, dx out dx, ax diff --git a/gas/testsuite/gas/i386/intelok.d b/gas/testsuite/gas/i386/intelok.d index 21c2bfa..af71b89 100644 --- a/gas/testsuite/gas/i386/intelok.d +++ b/gas/testsuite/gas/i386/intelok.d @@ -171,4 +171,6 @@ Disassembly of section .text: [ ]*[0-9a-f]+: a1 08 00 00 00[ ]+mov[ ]+eax,ds:0x8 [ ]*[0-9a-f]+: 9a 05 00 00 00 03 00[ ]+l?call[ ]+0x3[,:]0x5 [ ]*[0-9a-f]+: ea 03 00 00 00 05 00[ ]+l?jmp[ ]+0x5[,:]0x3 +[ ]*[0-9a-f]+: ff 15 00 00 00 00[ ]+call[ ]+(DWORD PTR )?(ds:)?0x0 +[ ]*[0-9a-f]+: 66 ff 25 00 00 00 00[ ]+jmp[ ]+(WORD PTR )?(ds:)?0x0 #pass diff --git a/gas/testsuite/gas/i386/intelok.s b/gas/testsuite/gas/i386/intelok.s index a35b38c..c46a178 100644 --- a/gas/testsuite/gas/i386/intelok.s +++ b/gas/testsuite/gas/i386/intelok.s @@ -187,6 +187,8 @@ start: # other operands call 3:5 jmp 5:3 + call dword ptr xtrn + jmp word ptr xtrn # Force a good alignment. .p2align 4,0 -- 2.7.4