r193740 - [AArch64] Add some CPU targets for "generic", A-53 and A-57.
Bernie Ogden
bogden at arm.com
Tue Nov 12 04:39:18 PST 2013
I'm still not sure what the point at issue is.
Based on a recent copy of the GCC manual and a little checking of CLI
behaviour in recent Linaro releases, my understanding of the GCC behaviour
for both AArch32 and AArch64 is:
march: Takes an architecture such as armv8-a, with optional feature
modifiers. Rejects CPU names. Determines which instructions can be selected.
mcpu: A CPU such as cortex-a53, with optional feature modifiers. Rejects
arch names. Determines which instructions can be selected.
mtune: Like mcpu, but does not take feature modifiers and determines which
optimizations should be applied rather than which instructions should be
selected.
So I think the suggestion is that -mcpu should be dropped. But this would be
a GCC compatibility break, which I thought was considered undesirable?
Having -march take CPU names would also be incompatible, but I think that
that's a detail, not the main issue.
Have I understood all of this correctly? If not, I would be grateful if
someone would set me straight.
I would like the two ARM flavours to behave consistently in clang/LLVM. I'm
not sure right now what the AArch32 side does with mtune/march, but I
suspect it's not quite what GCC does - I think clang probably ignores the
former and implicitly selects a CPU for the latter. If we want to do
something with -march/-mtune on one side, let's do it on the other too, and
in the same way.
I think not supporting -mcpu in AArch64 would add no value and would break
compatibility with both GCC and with LLVM AArch32, so would be a Bad Thing.
But perhaps I'm just ignorant - I'm happy to be educated.
> -----Original Message-----
> From: Nigel Stephens
> Sent: 11 November 2013 20:49
> To: Eric Christopher
> Cc: Tim Northover; Bernard Ogden; Amara Emerson; cfe-
> commits at cs.uiuc.edu
> Subject: Re: r193740 - [AArch64] Add some CPU targets for "generic", A-
> 53 and A-57.
>
>
>
> > On 11 Nov 2013, at 07:24 pm, "Eric Christopher" <echristo at gmail.com>
> wrote:
> >
> > On Fri, Nov 8, 2013 at 9:02 AM, Tim Northover
> <t.p.northover at gmail.com> wrote:
> >>> To me it would be odd if the AArch64 CLI behaved differently to
> AArch32,
> >>> except where absolutely necessary.
> >>
> >> The general GCC interface has been encouraging -march/-mtune for
> years
> >> now. I've no idea what reasons 32-bit ARM chose to go against that,
> >> but I'd want to make sure they were valid for AArch64 before
> >> perpetuating it.
> >>
> >> Inertia doesn't seem like a great reason except for ARM-only
> projects,
> >> which are fairly rare.
> >
> > I agree with all of this.
>
> Likewise.
>
> The march/mtune mechanism seems to be the correct model, so long as
> it's clear that march specifies the base architecture name (I.e. what
> instructions/features are available to the compiler), and mtune a
> specific CPU name (I.e. how do those instructions behave on a specific
> microarchitecture). Confusion can reign if these get reversed!
>
> Nigel
More information about the cfe-commits
mailing list