This is an archive of the discontinued LLVM Phabricator instance.

[PPC] add intrinsics mapping to the extractuw/insertw instructions
ClosedPublic

Authored by sfertile on Nov 11 2016, 7:00 AM.

Details

Summary

Adds intrinsics mapping to the xxextractuw/xxinsertw instructions.

The int_ppc_vsx_xxextractuw pattern expansion requires 'casting' the out register from a f64:vsfrc to a VSRC since the altivec functionality I am trying to implement requires a return value of v2i64 with the second element zeroed out.

Diff Detail

Repository
rL LLVM

Event Timeline

sfertile updated this revision to Diff 77613.Nov 11 2016, 7:00 AM
sfertile retitled this revision from to [PPC] add intrinsics mapping to the extractuw/insertw instructiosn.
sfertile updated this object.
sfertile set the repository for this revision to rL LLVM.
sfertile added subscribers: llvm-commits, echristo.
sfertile updated this revision to Diff 77630.Nov 11 2016, 9:42 AM
sfertile retitled this revision from [PPC] add intrinsics mapping to the extractuw/insertw instructiosn to [PPC] add intrinsics mapping to the extractuw/insertw instructions.

Removed an unneeded extra COPY_TO_REGCLASS in the expansion of the xxextractuw intrinsic. Previously it was converting vsfrc:f64-->vsrc:v2f64-->vsrc:v2i64. I removed the redundant v2f64 in the middle.

kbarton accepted this revision.Nov 12 2016, 6:37 PM
kbarton edited edge metadata.

LGTM

This revision is now accepted and ready to land.Nov 12 2016, 6:37 PM
nemanjai added inline comments.Nov 13 2016, 7:02 PM
lib/Target/PowerPC/PPCInstrVSX.td
2249

I think the cast to f64 here is redundant, but it's not that relevant.

I'm going to need to update this revision based on the changes suggested in https://reviews.llvm.org/D26546

sfertile updated this revision to Diff 78764.Nov 21 2016, 12:58 PM
sfertile edited edge metadata.

Updated based on changes made to the clang portion of the feature.

sfertile marked an inline comment as done.Nov 21 2016, 1:29 PM
sfertile added inline comments.
lib/Target/PowerPC/PPCInstrVSX.td
2249

Removed

nemanjai added inline comments.Dec 7 2016, 2:24 AM
lib/Target/PowerPC/PPCInstrVSX.td
2218

This does not require another revision of the patch, but on the commit, please change the location of these in the file. Namely, we usually put anonymous patterns at the end of the named (instruction) definitions. When you do so, please make sure that you specify the correct Predicates and AddedComplexity as needed.

sfertile marked an inline comment as done.Jan 5 2017, 12:50 PM

committed in 289227

sfertile closed this revision.Jan 5 2017, 12:51 PM