aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2004-07-21 18:18:04 +0000
committerNick Clifton <nickc@redhat.com>2004-07-21 18:18:04 +0000
commit543613e9336603e177592f09ec42df2f99a2ed37 (patch)
tree1365ecdef2e5794bde271c8524e3e45bd15d3039 /gas
parenta35b6b049e653973939a56ad0ba656dffad60a0e (diff)
downloadfsf-binutils-gdb-543613e9336603e177592f09ec42df2f99a2ed37.zip
fsf-binutils-gdb-543613e9336603e177592f09ec42df2f99a2ed37.tar.gz
fsf-binutils-gdb-543613e9336603e177592f09ec42df2f99a2ed37.tar.bz2
For DefaultSize instructions, don't guess a 'q' suffix if the instruction
doesn't support it.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-i386.c17
-rw-r--r--gas/testsuite/ChangeLog17
-rw-r--r--gas/testsuite/gas/cfi/cfi-x86_64.d4
-rw-r--r--gas/testsuite/gas/i386/x86-64-inval.l104
5 files changed, 118 insertions, 29 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 977d0d9..84577df 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,4 +1,4 @@
-2004-07-21 Jan Beulich <jbeulich@novell.com>
+2004-07-21 Jan Beulich <jbeulich@novell.com>
* config/tc-i386.c (optimize_imm): Adjust immediates to only those
permissible for the selected instruction suffix.
@@ -16,6 +16,9 @@
registers.
(parse_register): Disallow Reg64 registers in 32-bit mode.
+ * config/tc-i386.c: For DefaultSize instructions, don't guess a 'q'
+ suffix if the instruction doesn't support it.
+
2004-07-20 Maciej W. Rozycki <macro@linux-mips.org>
* config/tc-mips.c (append_insn): Handle constant expressions with
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index e73aa95..db2ec7e 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -2194,7 +2194,7 @@ check_string ()
}
static int
-process_suffix ()
+process_suffix (void)
{
/* If matched instruction specifies an explicit instruction mnemonic
suffix, use it. */
@@ -2217,6 +2217,7 @@ process_suffix ()
Destination register type is more significant than source
register type. */
int op;
+
for (op = i.operands; --op >= 0;)
if ((i.types[op] & Reg)
&& !(i.tm.operand_types[op] & InOutPortReg))
@@ -2257,11 +2258,13 @@ process_suffix ()
else if ((i.tm.opcode_modifier & DefaultSize) && !i.suffix)
{
i.suffix = stackop_size;
+ if (i.suffix == QWORD_MNEM_SUFFIX
+ && (i.tm.opcode_modifier & No_qSuf))
+ i.suffix = LONG_MNEM_SUFFIX;
}
/* Change the opcode based on the operand size given by i.suffix;
We need not change things for byte insns. */
-
if (!i.suffix && (i.tm.opcode_modifier & W))
{
as_bad (_("no instruction mnemonic suffix given and no register operands; can't size instruction"));
@@ -2289,6 +2292,7 @@ process_suffix ()
&& (i.tm.opcode_modifier & JumpByte))))
{
unsigned int prefix = DATA_PREFIX_OPCODE;
+
if (i.tm.opcode_modifier & JumpByte) /* jcxz, loop */
prefix = ADDR_PREFIX_OPCODE;
@@ -2304,19 +2308,18 @@ process_suffix ()
/* Size floating point instruction. */
if (i.suffix == LONG_MNEM_SUFFIX)
- {
- if (i.tm.opcode_modifier & FloatMF)
- i.tm.base_opcode ^= 4;
- }
+ if (i.tm.opcode_modifier & FloatMF)
+ i.tm.base_opcode ^= 4;
}
return 1;
}
static int
-check_byte_reg ()
+check_byte_reg (void)
{
int op;
+
for (op = i.operands; --op >= 0;)
{
/* If this is an eight bit register, it's OK. If it's the 16 or
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index e5689e6..b63d2cf 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,11 +1,16 @@
2004-07-21 Jan Beulich <jbeulich@novell.com>
- * testsuite/gas/i386/x86-64-addr32.[ds]: New test for x86-64
- 32-bit addressing in 64-bit mode.
- * testsuite/gas/i386/x86-64-rip.[ds]: New test for x86-64
- rip-relative addressing.
- * testsuite/gas/i386/i386.exp: Run the two new tests.
-
+ * gas/i386/x86-64-addr32.[ds]: New test for x86-64 32-bit
+ addressing in 64-bit mode.
+ * gas/i386/x86-64-rip.[ds]: New test for x86-64 rip-relative
+ addressing.
+ * gas/i386/i386.exp: Run the two new tests.
+
+ * gas/cfi/cfi-x86_64.d: Adjust expectation for leave to not have a
+ rex prefix.
+ * gas/i386/x86-64-inval.[ls]: Add a bunch of instructions illegal
+ in 64-bit mode.
+
2004-07-20 Maciej W. Rozycki <macro@linux-mips.org>
* gas/mips/elf-rel19.d: Pass -march=mips1 to gas as the test
diff --git a/gas/testsuite/gas/cfi/cfi-x86_64.d b/gas/testsuite/gas/cfi/cfi-x86_64.d
index 2b19641..98cd57f 100644
--- a/gas/testsuite/gas/cfi/cfi-x86_64.d
+++ b/gas/testsuite/gas/cfi/cfi-x86_64.d
@@ -21,13 +21,13 @@ The section .eh_frame contains:
DW_CFA_advance_loc: 12 to 00000033
DW_CFA_def_cfa_offset: 8
-00000030 0000001c 00000034 FDE cie=00000000 pc=00000038..00000047
+00000030 0000001c 00000034 FDE cie=00000000 pc=00000038..00000046
DW_CFA_advance_loc: 1 to 00000039
DW_CFA_def_cfa_offset: 16
DW_CFA_offset: r6 at cfa-16
DW_CFA_advance_loc: 3 to 0000003c
DW_CFA_def_cfa_reg: r6
- DW_CFA_advance_loc: 10 to 00000046
+ DW_CFA_advance_loc: 9 to 00000045
DW_CFA_def_cfa: r7 ofs 8
DW_CFA_nop
DW_CFA_nop
diff --git a/gas/testsuite/gas/i386/x86-64-inval.l b/gas/testsuite/gas/i386/x86-64-inval.l
index 05416d7..1d7808b 100644
--- a/gas/testsuite/gas/i386/x86-64-inval.l
+++ b/gas/testsuite/gas/i386/x86-64-inval.l
@@ -11,20 +11,98 @@
.*:12: Error: .*
.*:13: Error: .*
.*:14: Error: .*
++.*:15: Error: .*
++.*:16: Error: .*
++.*:17: Error: .*
++.*:18: Error: .*
++.*:19: Error: .*
++.*:20: Error: .*
++.*:21: Error: .*
++.*:22: Error: .*
++.*:23: Error: .*
++.*:24: Error: .*
++.*:25: Error: .*
++.*:26: Error: .*
++.*:27: Error: .*
++.*:28: Error: .*
++.*:29: Error: .*
++.*:30: Error: .*
++.*:31: Error: .*
++.*:32: Error: .*
++.*:33: Error: .*
++.*:34: Error: .*
++.*:35: Error: .*
++.*:36: Error: .*
++.*:37: Error: .*
++.*:38: Error: .*
++.*:39: Error: .*
++.*:40: Error: .*
++.*:41: Error: .*
++.*:42: Error: .*
++.*:43: Error: .*
++.*:44: Error: .*
++.*:45: Error: .*
++.*:46: Error: .*
++.*:47: Error: .*
++.*:48: Error: .*
++.*:49: Error: .*
++.*:50: Error: .*
++.*:51: Error: .*
++.*:52: Error: .*
++.*:53: Error: .*
GAS LISTING .*
- 1 [ ]* .text
+ 1 [ ]*.text
2 [ ]*# All the following should be illegal for x86-64
- 3 [ ]*calll \*%eax # 32-bit data size not allowed
- 4 [ ]*calll \*\(%ax\) # 32-bit data size not allowed
- 5 [ ]*calll \*\(%eax\) # 32-bit data size not allowed
- 6 [ ]*calll \*\(%r8\) # 32-bit data size not allowed
- 7 [ ]*calll \*\(%rax\) # 32-bit data size not allowed
- 8 [ ]*callq \*\(%ax\) # 32-bit data size not allowed
- 9 [ ]*callw \*\(%ax\) # no 16-bit addressing
- 10 [ ]*foo:[ ]*jcxz foo # No prefix exists to select CX as a counter
- 11 [ ]*popl %eax # can\'t have 32-bit stack operands
- 12 [ ]*pushl %eax # can\'t have 32-bit stack operands
- 13 [ ]*pushfl # can\'t have 32-bit stack operands
- 14 [ ]*popfl # can\'t have 32-bit stack operands
+ 3 [ ]*aaa # illegal
+ 4 [ ]*aad # illegal
+ 5 [ ]*aam # illegal
+ 6 [ ]*aas # illegal
+ 7 [ ]*arpl %ax,%ax # illegal
+ 8 [ ]*bound %eax,\(%rax\) # illegal
+ 9 [ ]*calll \*%eax # 32-bit data size not allowed
+ 10 [ ]*calll \*\(%ax\) # 32-bit data size not allowed
+ 11 [ ]*calll \*\(%eax\) # 32-bit data size not allowed
+ 12 [ ]*calll \*\(%r8\) # 32-bit data size not allowed
+ 13 [ ]*calll \*\(%rax\) # 32-bit data size not allowed
+ 14 [ ]*callq \*\(%ax\) # 32-bit data size not allowed
+ 15 [ ]*callw \*\(%ax\) # no 16-bit addressing
+ 16 [ ]*daa # illegal
+ 17 [ ]*das # illegal
+ 18 [ ]*enterl \$0,\$0 # can't have 32-bit stack operands
+ 19 [ ]*into # illegal
+ 20 [ ]*foo:[ ]*jcxz foo # No prefix exists to select CX as a counter
+ 21 [ ]*jmpl \*%eax # 32-bit data size not allowed
+ 22 [ ]*jmpl \*\(%rax\) # 32-bit data size not allowed
+ 23 [ ]*lahf # illegal
+ 24 [ ]*lcalll \$0,\$0 # illegal
+ 25 [ ]*lcallq \$0,\$0 # illegal
+ 26 [ ]*ldsl %eax,\(%rax\) # illegal
+ 27 [ ]*ldsq %rax,\(%rax\) # illegal
+ 28 [ ]*lesl %eax,\(%rax\) # illegal
+ 29 [ ]*lesq %rax,\(%rax\) # illegal
+ 30 [ ]*ljmpl \$0,\$0 # illegal
+ 31 [ ]*ljmpq \$0,\$0 # illegal
+ 32 [ ]*ljmpq \*\(%rax\) # 64-bit data size not allowed
+ 33 [ ]*loopw foo # No prefix exists to select CX as a counter
+ 34 [ ]*loopew foo # No prefix exists to select CX as a counter
+ 35 [ ]*loopnew foo # No prefix exists to select CX as a counter
+ 36 [ ]*loopnzw foo # No prefix exists to select CX as a counter
+ 37 [ ]*loopzw foo # No prefix exists to select CX as a counter
+ 38 [ ]*leavel # can't have 32-bit stack operands
+ 39 [ ]*pop %ds # illegal
+ 40 [ ]*pop %es # illegal
+ 41 [ ]*pop %ss # illegal
+ 42 [ ]*popa # illegal
+ 43 [ ]*popl %eax # can't have 32-bit stack operands
+ 44 [ ]*push %cs # illegal
+ 45 [ ]*push %ds # illegal
+ 46 [ ]*push %es # illegal
+ 47 [ ]*push %ss # illegal
+ 48 [ ]*pusha # illegal
+ 49 [ ]*pushl %eax # can't have 32-bit stack operands
+ 50 [ ]*pushfl # can't have 32-bit stack operands
+ 51 [ ]*popfl # can't have 32-bit stack operands
+ 52 [ ]*retl # can't have 32-bit stack operands
+ 53 [ ]*sahf # illegal