[X86][SSE] Add PACKUS support to combineVectorTruncation
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 3 Nov 2017 11:33:48 +0000 (11:33 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 3 Nov 2017 11:33:48 +0000 (11:33 +0000)
commitae1f0134954fd267bc030b7f690db69e53aa66cb
tree56d8fa085db420df686b00d7f9d8de4b70d510d9
parent41e32bfd6880ee74b68436772bf16aad05272e0f
[X86][SSE] Add PACKUS support to combineVectorTruncation

Similar to the existing code to lower to PACKSS, we can use PACKUS if the input vector's leading zero bits extend all the way to the packed/truncated value.

We have to account for pre-SSE41 targets not supporting PACKUSDW

llvm-svn: 317315
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/avg.ll
llvm/test/CodeGen/X86/combine-srl.ll
llvm/test/CodeGen/X86/vector-trunc.ll