+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
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... */
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;
+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.
--- /dev/null
+.*: 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
--- /dev/null
+.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
--- /dev/null
+#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
--- /dev/null
+.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
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.
+2005-03-02 Jan Beulich <jbeulich@novell.com>
+
+ * i386-dis.c (print_insn): Suppress lock prefix printing for cr8...15
+ accesses.
+ (OP_C): Consider lock prefix in non-64-bit modes.
+
2005-02-24 Alan Modra <amodra@bigpond.net.au>
* cris-dis.c (format_hex): Remove ineffective warning fix.
int i;
char *first, *second, *third;
int needcomma;
- unsigned char uses_SSE_prefix;
+ unsigned char uses_SSE_prefix, uses_LOCK_prefix;
int sizeflag;
const char *p;
struct dis_private priv;
dp = &dis386_twobyte[*++codep];
need_modrm = twobyte_has_modrm[*codep];
uses_SSE_prefix = twobyte_uses_SSE_prefix[*codep];
+ uses_LOCK_prefix = (*codep & ~0x02) == 0x20;
}
else
{
dp = &dis386[*codep];
need_modrm = onebyte_has_modrm[*codep];
uses_SSE_prefix = 0;
+ uses_LOCK_prefix = 0;
}
codep++;
oappend ("repnz ");
used_prefixes |= PREFIX_REPNZ;
}
- if (prefixes & PREFIX_LOCK)
+ if (!uses_LOCK_prefix && (prefixes & PREFIX_LOCK))
{
oappend ("lock ");
used_prefixes |= PREFIX_LOCK;
OP_C (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
int add = 0;
- USED_REX (REX_EXTX);
if (rex & REX_EXTX)
- add = 8;
+ {
+ USED_REX (REX_EXTX);
+ add = 8;
+ }
+ else if (!mode_64bit && (prefixes & PREFIX_LOCK))
+ {
+ used_prefixes |= PREFIX_LOCK;
+ add = 8;
+ }
sprintf (scratchbuf, "%%cr%d", reg + add);
oappend (scratchbuf + intel_syntax);
}