This is an archive of the discontinued LLVM Phabricator instance.

ARMEB: Fix trunc store for vector types
ClosedPublic

Authored by cpirker on Jun 13 2014, 8:19 AM.

Details

Reviewers
jmolloy
Summary

Hi all,

The ARM backend transforms a trunc store to shuffle and store operations.
A vector (or multiple scalars) is packed in one (wide) place to be stored in less memory operations.
The shuffle operation is utilized to extract some values (narrowed elements) to mimic the trunc operation.
Currently, the shuffle operation assumes little endian byte order.

This patch is calculating the shuffle indices for the least significant data (trunc) based upon the "higher side" of vector element.

Please review.

Thanks,
Christian

Diff Detail

Event Timeline

cpirker updated this revision to Diff 10391.Jun 13 2014, 8:19 AM
cpirker retitled this revision from to ARMEB: Fix trunc store for vector types.
cpirker updated this object.
cpirker edited the test plan for this revision. (Show Details)
cpirker added subscribers: Unknown Object (MLST), Konrad.
jmolloy accepted this revision.Jun 15 2014, 12:48 PM
jmolloy added a reviewer: jmolloy.
jmolloy added a subscriber: jmolloy.

Hi Christian,

This looks good to me, I have only one comment that should be trivial to address before commit.

Cheers,

James

test/CodeGen/ARM/big-endian-neon-trunc-store.ll
17

I just tried your patch, and this test case is producing another REV just above this line. Is that expected? If so, please add it as a CHECK line so that it is obvioiusly expected behaviour.

This revision is now accepted and ready to land.Jun 15 2014, 12:48 PM
cpirker closed this revision.Jun 16 2014, 2:26 AM

I committed this patch as rL211010.

test/CodeGen/ARM/big-endian-neon-trunc-store.ll
17

The vrev64.32 instruction that you are observing, belongs to a bundle of vld and vrev to load a vector from memory. This instruction sequence for load is not touched by this patch and therefore a CHECK line for the vrev instruction is purposely not included.