This is an archive of the discontinued LLVM Phabricator instance.

[x86] Make the x86 PACKSSWB, PACKSSDW, PACKUSWB, and PACKUSDW instructions available as synthetic SDNodes PACKSS and PACKUS that will select to the correct instruction variants based on the return type.
ClosedPublic

Authored by chandlerc on Jun 4 2014, 2:29 AM.

Details

Reviewers
grosbach
bkramer
Summary

[x86] Make the x86 PACKSSWB, PACKSSDW, PACKUSWB, and PACKUSDW instructions available as synthetic SDNodes PACKSS and PACKUS that will select to the correct instruction variants based on the return type. This allows us to use these rather important instructions when lowering vector shuffles.

No functionality should actually be changed here.

Diff Detail

Event Timeline

chandlerc updated this revision to Diff 10086.Jun 4 2014, 2:29 AM
chandlerc retitled this revision from to [x86] Make the x86 PACKSSWB, PACKSSDW, PACKUSWB, and PACKUSDW instructions available as synthetic SDNodes PACKSS and PACKUS that will select to the correct instruction variants based on the return type..
chandlerc updated this object.
chandlerc edited the test plan for this revision. (Show Details)
chandlerc added a reviewer: grosbach.
chandlerc set the repository for this revision to rL LLVM.
chandlerc added a subscriber: Unknown Object (MLST).
filcab added a subscriber: filcab.Jun 4 2014, 6:02 PM

Not that I'm an expert on ISel, but LGTM.

bkramer accepted this revision.Jun 5 2014, 10:24 AM
bkramer added a reviewer: bkramer.
bkramer added a subscriber: bkramer.

lg

This revision is now accepted and ready to land.Jun 5 2014, 10:24 AM
grosbach accepted this revision.Jun 11 2014, 5:17 PM
grosbach edited edge metadata.

This looks really good. Am I correct in assuming we already have testcases for codegen of these intrinsics and assembly/disassembly of all of the instructions modified?

A bit more in the commit message about why the instruction definitions are being split out from the multiclasses they currently use would be good. It looks like that's just a convenience thing due to them needing a different DAG node to match against. Is that right?

lib/Target/X86/X86InstrSSE.td
4421

Nipick. These define far more than just the SSE2 instructions. Perhaps update the comment(s) to better reflect modern reality?

chandlerc closed this revision.Jun 19 2014, 6:13 PM

Committed in r211332 with suggested tweaks and better commit log. Thanks!

lib/Target/X86/X86InstrSSE.td
4421

Sure, will do.