This is an archive of the discontinued LLVM Phabricator instance.

[mips][msa] Splat.d endianness check
ClosedPublic

Authored by smaksimovic on Apr 19 2017, 3:21 AM.

Details

Summary

Before this change, it was always the first element of a vector that got splatted since the lower 6 bits of vshf.d $wd were always zero for little endian.
Additionally, masking has been performed for vshf via which splat.d is created.

Vshf has a property where if its first operand's elements have either bit 6 or 7 set, destination element is set to zero.
Initially masked with 63 to avoid this property, which would result in generation of and.v + vshf.d in all cases.
Masking with one results in generating a single splati.d instruction when possible.

Diff Detail

Repository
rL LLVM

Event Timeline

smaksimovic created this revision.Apr 19 2017, 3:21 AM
sdardis accepted this revision.Jun 19 2017, 8:55 AM

LGTM.

lib/Target/Mips/MipsSEISelLowering.cpp
1442 ↗(On Diff #95703)

Replace the 2 there with OpNr.

This revision is now accepted and ready to land.Jun 19 2017, 8:55 AM
This revision was automatically updated to reflect the committed changes.