aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2016-05-27 08:02:56 -0700
committerH.J. Lu <hjl.tools@gmail.com>2016-05-27 08:03:17 -0700
commite92bae62606702c1c07e095789ffed103e0e34c5 (patch)
tree65b78ae2185c0c62cb24468da9fb8740a931bf6e /gas
parentc185ba27ca74b02bcca8d016e2d82b09aa6df28b (diff)
downloadbinutils-e92bae62606702c1c07e095789ffed103e0e34c5.zip
binutils-e92bae62606702c1c07e095789ffed103e0e34c5.tar.gz
binutils-e92bae62606702c1c07e095789ffed103e0e34c5.tar.bz2
Replace CpuAMD64/CpuIntel64 with AMD64/Intel64
AMD64 vs CpuIntel64 ISA should be handled similar as AT&T vs Intel syntax. Since cpu_flags isn't sorted by position, we need to check the whole cpu_flags array for the maximum position when verifying CpuMax. gas/ PR gas/20154 * config/tc-i386.c (cpu_flags_match): Don't set cpuamd64 nor cpuintel64. (match_template): Check Intel64/AMD64 ISA. opcodes/ PR gas/20154 * i386-gen.c (cpu_flags): Remove CpuAMD64 and CpuIntel64. (opcode_modifiers): Add AMD64 and Intel64. (main): Properly verify CpuMax. * i386-opc.h (CpuAMD64): Removed. (CpuIntel64): Likewise. (CpuMax): Set to CpuNo64. (i386_cpu_flags): Remove cpuamd64 and cpuintel64. (AMD64): New. (Intel64): Likewise. (i386_opcode_modifier): Add amd64 and intel64. (i386-opc.tbl): Replace CpuAMD64/CpuIntel64 with AMD64/Intel64 on call and jmp. * i386-init.h: Regenerated. * i386-tbl.h: Likewise.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/config/tc-i386.c11
2 files changed, 11 insertions, 7 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 042b698..a9d2268 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,6 +1,13 @@
2016-05-27 H.J. Lu <hongjiu.lu@intel.com>
PR gas/20154
+ * config/tc-i386.c (cpu_flags_match): Don't set cpuamd64 nor
+ cpuintel64.
+ (match_template): Check Intel64/AMD64 ISA.
+
+2016-05-27 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR gas/20154
* config/tc-i386.c (intel64): New.
(cpu_flags_match): Set cpuamd64 and cpuintel64.
(md_parse_option): Set intel64 instead of cpuamd64 and
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index f8a3bf0..8358740 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -1541,11 +1541,6 @@ cpu_flags_match (const insn_template *t)
/* This instruction is available only on some archs. */
i386_cpu_flags cpu = cpu_arch_flags;
- /* Set cpuamd64 and cpuintel64 here since they may be changed by
- set_cpu_arch. */
- cpu_arch_flags.bitfield.cpuamd64 = !intel64;
- cpu_arch_flags.bitfield.cpuintel64 = intel64;
-
cpu = cpu_flags_and (x, cpu);
if (!cpu_flags_all_zero (&cpu))
{
@@ -4766,10 +4761,12 @@ match_template (void)
if (intel_mnemonic && t->opcode_modifier.attmnemonic)
continue;
- /* Check AT&T/Intel syntax. */
+ /* Check AT&T/Intel syntax and Intel64/AMD64 ISA. */
i.error = unsupported_syntax;
if ((intel_syntax && t->opcode_modifier.attsyntax)
- || (!intel_syntax && t->opcode_modifier.intelsyntax))
+ || (!intel_syntax && t->opcode_modifier.intelsyntax)
+ || (intel64 && t->opcode_modifier.amd64)
+ || (!intel64 && t->opcode_modifier.intel64))
continue;
/* Check the suffix, except for some instructions in intel mode. */