This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: FYI: -march/-mcpu patch for mips
>
> Here it is.
>
I like it mostly.
You should probably put in a check to make sure that both -march and
-mcpu are both not given on the command line (and different).
What I would do, since both can be on the gcc command line, is to
produce a warning if both are given and use the value from -march.
Otherwise it looks good to me. We'll need Nick to approve it though.
-eric
>
> + case OPTION_MARCH:
> case OPTION_MCPU:
> {
> + int cpu = CPU_UNKNOWN;
> +
> /* Identify the processor type. */
> - if (strcasecmp (arg, "default") == 0)
> - mips_cpu = CPU_UNKNOWN;
> - else
> + if (strcasecmp (arg, "default") != 0)
> {
> const struct mips_cpu_info *ci;
>
> ci = mips_cpu_info_from_name (arg);
> if (ci == NULL || ci->is_isa)
> - as_bad (_("invalid architecture -mcpu=%s"), arg);
> + as_fatal (_("invalid architecture -march/mcpu=%s"), arg);
> else
> - mips_cpu = ci->cpu;
> + cpu = ci->cpu;
> + }
> +
> + switch (c)
> + {
> + case OPTION_MARCH:
> + mips_arch = cpu;
> + break;
> + case OPTION_MCPU:
> + mips_cpu = cpu;
> + break;
> }
--
I will not grease the monkey bars