[LLVMdev] Apple clang 4.2 based on llvm 3.2 produces a wrong "instruction requires:arm-mode"

Tim Northover t.p.northover at gmail.com
Wed Jun 12 10:53:56 PDT 2013


Hi Moshe,

The others are right that you'll likely get better Apple-specific help
at the forums, but this problem happens to be the same in generic
LLVM.

> ./src/asm.s:30:5: error: instruction requires a CPU feature not currently enabled
>
>     add r2, pc, r2
>
> According to ARM specification:

The specifications you're referring to are a little vague, and the
actual instruction definitions give the real situation (page/section
A3-308).

I think it boils down to:
"add r2, r2, pc" should be allowed (but LLVM doesn't, this is a bug).
"add r2, pc" should be allowed (and is)
"add r2, pc, r2" should be allowed *if* it's in an IT block (but LLVM
doesn't, this is a bug).

That last one might be rather tricky to implement. I'll take a bit of
a look, but may not have time to do it properly. Reporting it at
llvm.org/bugs (and/or bugreporter.apple.com since that seems to be
your platform) would make sure it doesn't get lost.

Cheers.

Tim.



More information about the llvm-dev mailing list