This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Fix encoding of APSR in CLRM instruction
ClosedPublic

Authored by chill on Aug 7 2019, 7:43 AM.

Details

Summary

The APSR is encoded by setting bit 15 in the register list of the CLRM
instruction (cf. https://static.docs.arm.com/ddi0553/bh/DDI0553B_h_armv8m_arm.pdf).

Encoding APSR as 1 causes a bogus duplicated register warning and one of the registers ( r1 or apsr) is dropped, e.g.

$ llvm-mc --triple thumbv8.1m.main --show-encoding <<< 'clrm {apsr,r1,r0}'
	.text
<stdin>:1:12: warning: duplicated register (r1) in register list
clrm {apsr,r1,r0}
           ^
	clrm		{r0, apsr}      @ encoding: [0x9f,0xe8,0x01,0x80]

Diff Detail

Repository
rL LLVM

Event Timeline

chill created this revision.Aug 7 2019, 7:43 AM
chill edited the summary of this revision. (Show Details)Aug 7 2019, 7:43 AM
chill added a reviewer: simon_tatham.
This revision is now accepted and ready to land.Aug 9 2019, 2:11 AM
This revision was automatically updated to reflect the committed changes.