[PATCH] Use ".arch_extension" ARM directive to specify the additional CPU features

Eric Christopher echristo at gmail.com
Wed Feb 18 13:46:29 PST 2015


On Wed Feb 18 2015 at 1:42:23 PM Renato Golin <renato.golin at linaro.org>
wrote:

> In http://reviews.llvm.org/D7316#125709, @echristo wrote:
>
> > b) The attribute changes on the testcases, what's going on there?
>
>
> Krait is currently modelled as A15 because it's A9+Div, but it's closer to
> A9 than A15, and that generates codegen issues.
>
> There is no way of telling an external assembler that the CPU is A9+Div
> other than adding two directives (.cpu + .arch_extension), since GAS
> doesn't support ".cpu krait", and I'm not sure it should, TBH, since that's
> the whole point of the .arch_extension directive.
>

Right, but there are other ones. Like:

-mcpu=krait
-mattr=-v7,+v6,-hwdiv,-hwdiv-arm,-vfp4,-vfp3,+vfp2,-neon,-t2dsp,+slowfpvmlx,-aclass,-trustzone

Most of those likely aren't needed?


>
> > c) If the krait always has hardware divide why both conditionals after?
>
>
> Because of "-mattr=-hwdiv,-hwdiv-arm".
>

Fair (annoying, but fair).


>
> > d) It seems that the .cpu directive for the krait cpu is orthogonal to
> the arch_extension part of this patch.
>
>
> Almost... :)
>
> .arch_extension is needed to help GAS understand that krait is A9+Div,
> that's why it's in the same patch. Without it, the original patch looked
> completely useless. This merge was actually my fault, if you feel strongly,
> it should be pretty safe to split the .arch_extension from the krait
> changes.
>
>
Would be nice, yes.


> > e) It doesn't seem that the arch_extension stuff is wired into the
> object emitter? What is supposed to happen there?
>
>
> The object emitter already knows that Krait is A9+Div, so the Div
> instructions get emitted correctly. The directive is *just* for the sake of
> GAS allowing Divs to be emitted.
>

So it's quite literally taking the place of a command line option?
Otherwise gas can't handle the instruction or what? Can I get some more
background here please?

Thanks!

-eric


>
>
> http://reviews.llvm.org/D7316
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150218/287233d1/attachment.html>


More information about the llvm-commits mailing list