This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Add qadd lowering from a sadd_sat
ClosedPublic

Authored by dmgreen on Oct 15 2019, 2:40 AM.

Details

Summary

This lowers a sadd_sat to a qadd by treating it as legal. Also adds qsub at the same time.

The qadd instruction sets the q flag, but we already have many cases where we do not model this explicitly.

Diff Detail

Event Timeline

dmgreen created this revision.Oct 15 2019, 2:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 15 2019, 2:40 AM

How about adding support for the QD* versions as well?

samparker added inline comments.Oct 15 2019, 8:00 AM
llvm/lib/Target/ARM/ARMInstrInfo.td
3758

I think these should be V5TE patterns.

dmgreen updated this revision to Diff 225074.Oct 15 2019, 10:23 AM
dmgreen marked 2 inline comments as done.
dmgreen added inline comments.
llvm/lib/Target/ARM/ARMInstrInfo.td
3758

I've added a hasBaseDSP method to do the check in ISel. Let me know if there's a better name for it.

samparker added inline comments.Oct 16 2019, 2:34 AM
llvm/test/CodeGen/ARM/qdadd.ll
45

Still need the tablegen patterns!

dmgreen marked an inline comment as done.Oct 16 2019, 6:00 AM
dmgreen added inline comments.
llvm/test/CodeGen/ARM/qdadd.ll
45

D68999. I thought I had put that somewhere here, but perhaps I had just presumed you would get the notification.

I rebased these tests, which is why they appear here too. That patch adds the patterns.

LGTM.

llvm/test/CodeGen/ARM/qdadd.ll
45

Ah!

This revision was not accepted when it landed; it landed in state Needs Review.Oct 21 2019, 5:39 AM
This revision was automatically updated to reflect the committed changes.