aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2009-07-24 15:41:20 +0000
committerJan Beulich <jbeulich@novell.com>2009-07-24 15:41:20 +0000
commit309d33736f82fece9dbeae7a4ba096cdc2d77753 (patch)
treeaf27f997a96225ed278b45e38156d83ae13fb2a6 /gas/config
parent20203fb9399bed63f555d79dcd8ad95a5bb0aed6 (diff)
downloadgdb-309d33736f82fece9dbeae7a4ba096cdc2d77753.zip
gdb-309d33736f82fece9dbeae7a4ba096cdc2d77753.tar.gz
gdb-309d33736f82fece9dbeae7a4ba096cdc2d77753.tar.bz2
gas/
2009-07-24 Jan Beulich <jbeulich@novell.com> * tc-i386.c (cpu_arch): Add .8087, .287, .387, .no87, .nommx, .nosse, and .noavx. (cpu_flags_and_not): New. (set_cpu_arch): Check whether sub-architecture specified is a feature disable. (md_parse_option): Likewise. (parse_real_register): Don't return floating point register when x87 functionality is disabled. (md_show_usage): Add new sub-options. * doc/c-i386.texi: Update with new command line sub-options. gas/testsuite/ 2009-07-24 Jan Beulich <jbeulich@novell.com> * gas/i386/8087.[ds]: New. * gas/i386/287.[ds]: New. * gas/i386/387.[ds]: New. * gas/i386/no87.[ls]: New. * gas/i386/no87-2.[ls]: New. * gas/i386/i386.exp: Run new tests. * gas/i386/att-regs.s: Also check FPU register access. * gas/i386/intel-regs.s: Likewise. * gas/i386/att-regs.d: Adjust expectations. * gas/i386/intel-regs.d: Likewise. opcodes/ 2009-07-24 Jan Beulich <jbeulich@novell.com> * i386-dis.c (fgrps): Correct annotation for feni/fdisi. Add frstpm. * i386-gen.c (cpu_flag_init): Add FP enabling flags where needed. (cpu_flags): Add Cpu8087, Cpu287, Cpu387, Cpu687, and CpuFISTTP. (set_bitfield): Expand CpuFP to Cpu8087|Cpu287|Cpu387. * i386-opc.h (Cpu8087, Cpu287, Cpu387, Cpu687, CpuFISTTP): Define. (union i386_cpu_flags): Add cpu8087, cpu287, cpu387, cpu687, and cpufisttp. * i386-opc.tbl: Qualify floating point instructions by their respective CpuXXX flag. Fix fucom{,p,pp}, fprem1, fsin, fcos, and fsincos to be avilable only on 387. Fix fstsw ax to be available only on 287+. Add f{,n}eni, f{,n}disi, f{,n}setpm, and frstpm. * i386-init.h, i386-tbl.h: Regenerate.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-i386.c60
1 files changed, 54 insertions, 6 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 42a95ff..62486ec 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -591,8 +591,18 @@ static const arch_entry cpu_arch[] =
CPU_K8_FLAGS },
{ "amdfam10", PROCESSOR_AMDFAM10,
CPU_AMDFAM10_FLAGS },
+ { ".8087", PROCESSOR_UNKNOWN,
+ CPU_8087_FLAGS },
+ { ".287", PROCESSOR_UNKNOWN,
+ CPU_287_FLAGS },
+ { ".387", PROCESSOR_UNKNOWN,
+ CPU_387_FLAGS },
+ { ".no87", PROCESSOR_UNKNOWN,
+ CPU_ANY87_FLAGS },
{ ".mmx", PROCESSOR_UNKNOWN,
CPU_MMX_FLAGS },
+ { ".nommx", PROCESSOR_UNKNOWN,
+ CPU_3DNOWA_FLAGS },
{ ".sse", PROCESSOR_UNKNOWN,
CPU_SSE_FLAGS },
{ ".sse2", PROCESSOR_UNKNOWN,
@@ -607,8 +617,12 @@ static const arch_entry cpu_arch[] =
CPU_SSE4_2_FLAGS },
{ ".sse4", PROCESSOR_UNKNOWN,
CPU_SSE4_2_FLAGS },
+ { ".nosse", PROCESSOR_UNKNOWN,
+ CPU_ANY_SSE_FLAGS },
{ ".avx", PROCESSOR_UNKNOWN,
CPU_AVX_FLAGS },
+ { ".noavx", PROCESSOR_UNKNOWN,
+ CPU_ANY_AVX_FLAGS },
{ ".vmx", PROCESSOR_UNKNOWN,
CPU_VMX_FLAGS },
{ ".smx", PROCESSOR_UNKNOWN,
@@ -1236,6 +1250,24 @@ cpu_flags_or (i386_cpu_flags x, i386_cpu_flags y)
return x;
}
+static INLINE i386_cpu_flags
+cpu_flags_and_not (i386_cpu_flags x, i386_cpu_flags y)
+{
+ switch (ARRAY_SIZE (x.array))
+ {
+ case 3:
+ x.array [2] &= ~y.array [2];
+ case 2:
+ x.array [1] &= ~y.array [1];
+ case 1:
+ x.array [0] &= ~y.array [0];
+ break;
+ default:
+ abort ();
+ }
+ return x;
+}
+
#define CPU_FLAGS_ARCH_MATCH 0x1
#define CPU_FLAGS_64BIT_MATCH 0x2
#define CPU_FLAGS_AES_MATCH 0x4
@@ -1964,8 +1996,12 @@ set_cpu_arch (int dummy ATTRIBUTE_UNUSED)
break;
}
- flags = cpu_flags_or (cpu_arch_flags,
- cpu_arch[i].flags);
+ if (strncmp (string + 1, "no", 2))
+ flags = cpu_flags_or (cpu_arch_flags,
+ cpu_arch[i].flags);
+ else
+ flags = cpu_flags_and_not (cpu_arch_flags,
+ cpu_arch[i].flags);
if (!cpu_flags_equal (&flags, &cpu_arch_flags))
{
if (cpu_sub_arch_name)
@@ -7484,6 +7520,12 @@ parse_real_register (char *reg_string, char **end_op)
&& !cpu_arch_flags.bitfield.cpui386)
return (const reg_entry *) NULL;
+ if (r->reg_type.bitfield.floatreg
+ && !cpu_arch_flags.bitfield.cpu8087
+ && !cpu_arch_flags.bitfield.cpu287
+ && !cpu_arch_flags.bitfield.cpu387)
+ return (const reg_entry *) NULL;
+
if (r->reg_type.bitfield.regmmx && !cpu_arch_flags.bitfield.cpummx)
return (const reg_entry *) NULL;
@@ -7759,8 +7801,13 @@ md_parse_option (int c, char *arg)
{
/* ISA entension. */
i386_cpu_flags flags;
- flags = cpu_flags_or (cpu_arch_flags,
- cpu_arch[i].flags);
+
+ if (strncmp (arch, "no", 2))
+ flags = cpu_flags_or (cpu_arch_flags,
+ cpu_arch[i].flags);
+ else
+ flags = cpu_flags_and_not (cpu_arch_flags,
+ cpu_arch[i].flags);
if (!cpu_flags_equal (&flags, &cpu_arch_flags))
{
if (cpu_sub_arch_name)
@@ -7892,8 +7939,9 @@ md_show_usage (stream)
core, core2, corei7, k6, k6_2, athlon, k8, amdfam10,\n\
generic32, generic64\n\
EXTENSION is combination of:\n\
- mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, sse4,\n\
- avx, vmx, smx, xsave, movbe, ept, aes, pclmul, fma,\n\
+ 8087, 287, 387, no87, mmx, nommx, sse, sse2, sse3,\n\
+ ssse3, sse4.1, sse4.2, sse4, nosse, avx, noavx,\n\
+ vmx, smx, xsave, movbe, ept, aes, pclmul, fma,\n\
clflush, syscall, rdtscp, 3dnow, 3dnowa, sse4a,\n\
svme, abm, padlock, fma4\n"));
fprintf (stream, _("\