This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Improve tests for sxta{b|h} and uxta{b|h} instructions for Thumb
ClosedPublic

Authored by samparker on Aug 8 2016, 9:34 AM.

Details

Summary

Created a predicate pattern for Thumb2 and HasT2ExtractPack and used it to redefine the patterns for sxta{b|h} and uxta{b|h}. Also used the similar patterns to fill in isel pattern gaps for the corresponding instructions in the ARM backend. The patch is mainly changes to tests since most of this functionality appears not to have been tested.

Diff Detail

Repository
rL LLVM

Event Timeline

samparker updated this revision to Diff 67185.Aug 8 2016, 9:34 AM
samparker retitled this revision from to [ARM] Improve tests for sxta{b|h} and uxta{b|h} instructions for Thumb.
samparker updated this object.
samparker added a subscriber: llvm-commits.
t.p.northover added inline comments.
lib/Target/ARM/ARMInstrThumb2.td
1993 ↗(On Diff #67185)

Shouldn't rot_imm be imm8_or_16 since we're producing an SXTAH? Specifically, we're only matching an srl not a rol so an shifting by 24 will give the wrong answer.

test/CodeGen/Thumb2/thumb2-sxt-uxt.ll
32 ↗(On Diff #67185)

None of these tests are hitting the non-zero rotation cases.

samparker added inline comments.Aug 9 2016, 1:37 AM
lib/Target/ARM/ARMInstrThumb2.td
1993 ↗(On Diff #67185)

ah cheers, I forgot I left this in.

test/CodeGen/Thumb2/thumb2-sxt-uxt.ll
32 ↗(On Diff #67185)

I wasn't planning on touching the rotation patterns yet, but I will now.

Hi Tim,

The ARM target also looks like it could do with some changes too. Would you mind those patches being attached here as well?

cheers,

Would you mind those patches being attached here as well?

No, go for it!

samparker updated this revision to Diff 67356.Aug 9 2016, 8:50 AM
samparker updated this object.

Added pattern matching for ARM as well, and updated the tests to include the instructions with a rotate operand - including new tests for ARM.

t.p.northover accepted this revision.Aug 9 2016, 9:36 AM
t.p.northover added a reviewer: t.p.northover.

Thanks Sam. I think this looks fine now.

This revision is now accepted and ready to land.Aug 9 2016, 9:36 AM
This revision was automatically updated to reflect the committed changes.