aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-i386.c8
-rw-r--r--gas/testsuite/ChangeLog6
-rw-r--r--gas/testsuite/gas/i386/cr-err.l29
-rw-r--r--gas/testsuite/gas/i386/cr-err.s35
-rw-r--r--gas/testsuite/gas/i386/crx.d20
-rw-r--r--gas/testsuite/gas/i386/crx.s18
-rw-r--r--gas/testsuite/gas/i386/i386.exp3
8 files changed, 124 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index a12b389..759c9be 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,11 @@
2005-03-02 Jan Beulich <jbeulich@novell.com>
+ * config/tc-i386.c (build_modrm_byte): Add lock prefix for cr8...15
+ accesses.
+ (parse_register): Allow cr8...15 in all modes.
+
+2005-03-02 Jan Beulich <jbeulich@novell.com>
+
* config/tc-i386.c (intel_e11): If not followed by T_PTR, treat T_BYTE
etc. like normal symbol references (T_ID).
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 37c4073..b116ee4 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -2868,6 +2868,13 @@ build_modrm_byte ()
if ((i.op[source].regs->reg_flags & RegRex) != 0)
i.rex |= REX_EXTX;
}
+ if (flag_code != CODE_64BIT && (i.rex & (REX_EXTX | REX_EXTZ)))
+ {
+ if (!((i.types[0] | i.types[1]) & Control))
+ abort ();
+ i.rex &= ~(REX_EXTX | REX_EXTZ);
+ add_prefix (LOCK_PREFIX_OPCODE);
+ }
}
else
{ /* If it's not 2 reg operands... */
@@ -5040,6 +5047,7 @@ parse_register (reg_string, end_op)
if (r != NULL
&& ((r->reg_flags & (RegRex64 | RegRex)) | (r->reg_type & Reg64)) != 0
+ && (r->reg_type != Control || !(cpu_arch_flags & CpuSledgehammer))
&& flag_code != CODE_64BIT)
return (const reg_entry *) NULL;
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 641368d..0f91ee7 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,5 +1,11 @@
2005-03-02 Jan Beulich <jbeulich@novell.com>
+ * gas/i386/cr-err.[ls]: New.
+ * gas/i386/crx.[ds]: New.
+ * gas/i386/i386.exp: Run new tests.
+
+2005-03-02 Jan Beulich <jbeulich@novell.com>
+
* gas/i386/intelok.d: Add -r to objdump options. Adjust expectations.
* gas/i386/intelok.s: Add checks for various special memory operands.
diff --git a/gas/testsuite/gas/i386/cr-err.l b/gas/testsuite/gas/i386/cr-err.l
new file mode 100644
index 0000000..4aa1358
--- /dev/null
+++ b/gas/testsuite/gas/i386/cr-err.l
@@ -0,0 +1,29 @@
+.*: Assembler messages:
+.*:[0-9]+: Error: .\(%cr0\). is not a valid base/index expression
+.*:[0-9]+: Error: .\(%cr7\). is not a valid base/index expression
+.*:[0-9]+: Error: .\(%cr8\). is not a valid base/index expression
+.*:[0-9]+: Error: .\(%cr15\). is not a valid base/index expression
+.*:[0-9]+: Error: .\(%db0\). is not a valid base/index expression
+.*:[0-9]+: Error: .\(%db7\). is not a valid base/index expression
+.*:[0-9]+: Error: .\(%dr0\). is not a valid base/index expression
+.*:[0-9]+: Error: .\(%dr7\). is not a valid base/index expression
+.*:[0-9]+: Error: .\(%tr0\). is not a valid base/index expression
+.*:[0-9]+: Error: .\(%tr7\). is not a valid base/index expression
+.*:[0-9]+: Error: .\(cr0\). is not a valid base/index expression
+.*:[0-9]+: Error: .\(cr7\). is not a valid base/index expression
+.*:[0-9]+: Error: .\(cr8\). is not a valid base/index expression
+.*:[0-9]+: Error: .\(cr15\). is not a valid base/index expression
+.*:[0-9]+: Error: .\(db0\). is not a valid base/index expression
+.*:[0-9]+: Error: .\(db7\). is not a valid base/index expression
+.*:[0-9]+: Error: .\(dr0\). is not a valid base/index expression
+.*:[0-9]+: Error: .\(dr7\). is not a valid base/index expression
+.*:[0-9]+: Error: .\(tr0\). is not a valid base/index expression
+.*:[0-9]+: Error: .\(tr7\). is not a valid base/index expression
+.*:[0-9]+: Error: .\[cr0\]. is not a valid base/index expression
+.*:[0-9]+: Error: .\[cr7\]. is not a valid base/index expression
+.*:[0-9]+: Error: .\[cr8\]. is not a valid base/index expression
+.*:[0-9]+: Error: .\[cr15\]. is not a valid base/index expression
+.*:[0-9]+: Error: .\[dr0\]. is not a valid base/index expression
+.*:[0-9]+: Error: .\[dr7\]. is not a valid base/index expression
+.*:[0-9]+: Error: .\[tr0\]. is not a valid base/index expression
+.*:[0-9]+: Error: .\[tr7\]. is not a valid base/index expression
diff --git a/gas/testsuite/gas/i386/cr-err.s b/gas/testsuite/gas/i386/cr-err.s
new file mode 100644
index 0000000..5c45c32
--- /dev/null
+++ b/gas/testsuite/gas/i386/cr-err.s
@@ -0,0 +1,35 @@
+.text
+
+_start:
+ movl (%cr0), %eax
+ movl %eax, (%cr7)
+ movl (%cr8), %eax
+ movl %eax, (%cr15)
+ movl (%db0), %eax
+ movl %eax, (%db7)
+ movl (%dr0), %eax
+ movl %eax, (%dr7)
+ movl (%tr0), %eax
+ movl %eax, (%tr7)
+
+.att_syntax noprefix
+ movl (cr0), eax
+ movl eax, (cr7)
+ movl (cr8), eax
+ movl eax, (cr15)
+ movl (db0), eax
+ movl eax, (db7)
+ movl (dr0), eax
+ movl eax, (dr7)
+ movl (tr0), eax
+ movl eax, (tr7)
+
+.intel_syntax noprefix
+ mov eax, [cr0]
+ mov [cr7], eax
+ mov eax, [cr8]
+ mov [cr15], eax
+ mov eax, [dr0]
+ mov [dr7], eax
+ mov eax, [tr0]
+ mov [tr7], eax
diff --git a/gas/testsuite/gas/i386/crx.d b/gas/testsuite/gas/i386/crx.d
new file mode 100644
index 0000000..11e007a
--- /dev/null
+++ b/gas/testsuite/gas/i386/crx.d
@@ -0,0 +1,20 @@
+#objdump: -dw
+#name: i386 cr8+
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+0+ <_start>:
+[ ]*[0-9a-f]+: f0 0f 20 c0[ ]+movl?[ ]+?%cr8,%eax
+[ ]*[0-9a-f]+: f0 0f 20 c7[ ]+movl?[ ]+?%cr8,%edi
+[ ]*[0-9a-f]+: f0 0f 22 c0[ ]+movl?[ ]+?%eax,%cr8
+[ ]*[0-9a-f]+: f0 0f 22 c7[ ]+movl?[ ]+?%edi,%cr8
+[ ]*[0-9a-f]+: f0 0f 20 c0[ ]+movl?[ ]+?%cr8,%eax
+[ ]*[0-9a-f]+: f0 0f 20 c7[ ]+movl?[ ]+?%cr8,%edi
+[ ]*[0-9a-f]+: f0 0f 22 c0[ ]+movl?[ ]+?%eax,%cr8
+[ ]*[0-9a-f]+: f0 0f 22 c7[ ]+movl?[ ]+?%edi,%cr8
+[ ]*[0-9a-f]+: f0 0f 20 c0[ ]+movl?[ ]+?%cr8,%eax
+[ ]*[0-9a-f]+: f0 0f 20 c7[ ]+movl?[ ]+?%cr8,%edi
+[ ]*[0-9a-f]+: f0 0f 22 c0[ ]+movl?[ ]+?%eax,%cr8
+[ ]*[0-9a-f]+: f0 0f 22 c7[ ]+movl?[ ]+?%edi,%cr8
diff --git a/gas/testsuite/gas/i386/crx.s b/gas/testsuite/gas/i386/crx.s
new file mode 100644
index 0000000..e0a78fd
--- /dev/null
+++ b/gas/testsuite/gas/i386/crx.s
@@ -0,0 +1,18 @@
+.text
+_start:
+ movl %cr8, %eax
+ movl %cr8, %edi
+ movl %eax, %cr8
+ movl %edi, %cr8
+
+.att_syntax noprefix
+ movl cr8, eax
+ movl cr8, edi
+ movl eax, cr8
+ movl edi, cr8
+
+.intel_syntax noprefix
+ mov eax, cr8
+ mov edi, cr8
+ mov cr8, eax
+ mov cr8, edi
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index 98b6ea6..1cb1af3 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -68,8 +68,9 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]]
run_dump_test "divide"
}
-
run_dump_test "padlock"
+ run_dump_test "crx"
+ run_list_test "cr-err" ""
# These tests require support for 8 and 16 bit relocs,
# so we only run them for ELF and COFF targets.