This is an archive of the discontinued LLVM Phabricator instance.

[ARM] VQADD instructions
ClosedPublic

Authored by dmgreen on Oct 7 2019, 4:00 AM.

Details

Summary

This selects MVE VQADD from the vector llvm.sadd.sat or llvm.uadd.sat intrinsics.

The signed versions seem hard to get from C, but the unsigned are simple enough. And both are available from llvm, obviously.

Diff Detail

Event Timeline

dmgreen created this revision.Oct 7 2019, 4:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 7 2019, 4:00 AM
SjoerdMeijer accepted this revision.Oct 7 2019, 5:07 AM

Looks like a nice bit of isel to me.

llvm/lib/Target/ARM/ARMInstrMVE.td
1563

And looking at this, I almost start to like tablegen. :-)

This revision is now accepted and ready to land.Oct 7 2019, 5:07 AM

Just wondering, who generates the intrinsics? From the little that I remember from the last time I looked, I thought it was clang but it that is was x86 specific? Do we have some hooks somewhere saying that we support them?

dmgreen marked an inline comment as done.Oct 7 2019, 7:24 AM

The usat version can be idiom recognised from C:
https://godbolt.org/z/9knBnP
ssat is more difficult like I mentioned, but I don't think it should be impossible to do the same thing there too.

llvm/lib/Target/ARM/ARMInstrMVE.td
1563

This is from D67158. The idea is that an intrinsic can be easily added in here, same as for vadds in that patch.

This revision was automatically updated to reflect the committed changes.