[PATCH] Correct syntax of ARM mrc, mrc2 when writing to APSR

Tim Northover t.p.northover at gmail.com
Mon May 13 06:00:46 PDT 2013


Hi Mihail,

> The purpose of the patch is to fix the syntax of ARM mrc and mrc2
> instructions when they are used to write to the APSR. In this case, the
> destination operand should be APSR_nzcv, and the encoding of the target
> should be 0b1111 (same as for PC).

Thanks for looking at this.

The changes look reasonable to me, though I'd probably suggest setting
APSR_NZCV to reserved in ARMBaseRegisterInfo.cpp. Your AltOrders
*should* prevent the register allocator doing anything stupid anyway,
but just in case...

Also, some of disassembly tests would be good. I don't think the
DecodeGPRWithAPSR function is exercised by the assembly tests you
added and none of the existing tests seem to use the 0b1111 encoding.

Cheers.

Tim.



More information about the llvm-commits mailing list