[PATCH]: finish .cpu support for ARM

Joerg Sonnenberger joerg at britannica.bec.de
Wed Dec 3 13:45:13 PST 2014


On Wed, Dec 03, 2014 at 09:32:02PM +0000, Renato Golin wrote:
> > This is wrong. Only if you (a) use inline assembler and (b) don't make
> > it self contained.
> 
> Many people use inline assembly, and the FreeBSD kernel is no
> different. Also, inline assembly *cannot* be self contained if it has
> .cpu/.fpu directives in it. You'd not know what to change back to,
> since that would depend on the compilation arguments.

I disagree, but that's more an issue with GNU as limitations. Consider
MIPS options -- they have push/pop support. Section switching provides
it too. It would be pretty easy to implement on top of this, but that's
still an incremental improvement.

> Also, both the .cpu cortex-a15 for HDIV and the .fpu neon were taken
> from real life, critical software (like the Linux kernel, libraries,
> chromium, etc). This is not theoretical stuff.

You wouldn't believe how many cases of "how did this ever work" I've
seen with inline assembly and how many of those turned out to be "well,
it didn't, really". While I am all for providing the tools to make it
possible to write proper inline assembler, it is up to the user to
depend on them. Now something like GCC's target attribute would be a
somewhat different issue, but that seems like a prime target for .cpu
push too.

Joerg



More information about the llvm-commits mailing list