[PATCH] D63863: [ARM] Make coprocessor number restrictions consistent.

Szabolcs Nagy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 17 01:53:19 PDT 2019


nsz added a comment.

In D63863#1588965 <https://reviews.llvm.org/D63863#1588965>, @simon_tatham wrote:

> Hmmm. This surely can't be the first time a case like this has come up. What's the usual solution in other similar situations, when you want to include code for mutually incompatible architectures in the same object because you're going to test at run time which one to execute?


separate use of .arch and .object_arch works sometimes (to allow use of instructions for a new arch but mark the object file to be compatible with an old one, however that does not work when there is no "new arch" which supports all the instructions in use)

or use .inst, but old binutils does not support that so .word is the only option which will be wrong on bigendian so conditional .word and then there is thumb vs arm mode to deal with too.

either way this kind of code is way more painful to write than it should be, ideally there should be a flag that tells the assembler to accept the union of all instructions supported on the architecture especially on targets like arm where you have to write this kind of runtime checks to be able to create portable binaries.

i suspect the musl longjmp asm is not the only thing this patch broke (multimedia codecs also tend to do this sort of runtime checks in asm)


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63863/new/

https://reviews.llvm.org/D63863





More information about the llvm-commits mailing list