GAS: Handling option parsing for ARM co-processor extensions
Richard Earnshaw
rearnsha@arm.com
Thu Jan 17 10:30:00 GMT 2002
Right, this is the patch I've come up with. It goes a little further than
I previously discussed in that it also merges in another related idea that
I've been toying with.
The other idea concerns the non-uniformity of the command lines that GAS
and GCC use with respect to naming the processor/architecture etc. In
order to simplify this and bring the two in line I'd like GAS on the ARM
to use the same command line syntax as GCC for handling cpu options, vis
-mcpu=... -march=... and, in future gcc releases, -mfpu=... (there's no
need to handle -mtune=... since the assembler does no optimization).
This patch cleans up the existing option parser (which is at best a
cludge) and starts the process of obsoleting the old syntax. Being table
based it is now much clearer (at least to me) what is accepted, what
isn't, and what you get when you pass that flag.
Consider, with the old command line parser the options:
-marmv5t
was accepted and gave you thumb code on a V5 cpu;
-marmv5e
was accepted (even though there is no such architecture variant according
to the ARM ARM) and gave V5E code (but no thumb);
-marmv5te
was accepted, but only gave you thumb code on armv5 (no V5E support).
There are warnings already present in the patch -- they are currently
disabled, but I think they should be turned on after the next GAS release
-- that will warn the user and tell them what the correct replacement
option is.
The new +extension syntax is supported on both the -mcpu= and -march=
options, so it is now possible to write
-march=armv5te+xscale
Which is a precise architectural specification of the i80200 core (I've
left -march=xscale in for this case as well, mainly for compatibility with
GCC).
Oh, I've also added the two specific parts i80200 and ep9312, these are
the Intel XScale and Cirrus Maverick parts.
Documentation will follow; it's fairly mundane.
Any comments before I commit?
R.
* tc-arm.c (uses_apcs_26, atcps, support_interwork,
uses_apcs_float)
(pic_code): Declare for all object types. Make type int.
(legacy_cpu, legacy_fpu, mcpu_cpu_opt, mcpu_fpu_opt, march_cpu_opt)
(march_fpu_opt, mfpu_opt): Declare.
(md_longopts): Tidy up conditional definitions.
(arm_opts, arm_cpus, arm_archs, arm_fpus, arm_long_opts): New
tables.
(arm_parse_cpu, arm_parse_arch, arm_parse_fpu): New functions.
(md_parse_option): Rewrite using new table-driven system.
(md_show_usage): Use new table-driven system.
(md_begin): Calculate cpu_variant from command line option data.
More information about the Binutils
mailing list