[X86][SSE] Add PACKUS support to LowerTruncate
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 1 Nov 2017 21:52:29 +0000 (21:52 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 1 Nov 2017 21:52:29 +0000 (21:52 +0000)
commite152c2c4473f305d46963dbda3254aa737404803
treea69c69b5eadacdbd90c35476a5c77935dbbaf1e1
parenta16fe65b724538eb346322ec7aa88ac029881907
[X86][SSE] Add PACKUS support to LowerTruncate

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: 317128
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/avg.ll
llvm/test/CodeGen/X86/combine-srl.ll
llvm/test/CodeGen/X86/pr31773.ll
llvm/test/CodeGen/X86/psubus.ll
llvm/test/CodeGen/X86/vector-trunc.ll