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

Renato Golin renato.golin at linaro.org
Wed Feb 18 13:42:19 PST 2015

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.

> c) If the krait always has hardware divide why both conditionals after?

Because of "-mattr=-hwdiv,-hwdiv-arm".

> 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.

> 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.



More information about the llvm-commits mailing list