[X86] Add ISD nodes for masked truncate so we can properly represent when the output...
authorCraig Topper <craig.topper@intel.com>
Sat, 12 Jan 2019 00:55:27 +0000 (00:55 +0000)
committerCraig Topper <craig.topper@intel.com>
Sat, 12 Jan 2019 00:55:27 +0000 (00:55 +0000)
commitabe6ef8d09d169da259e0f629df05a44d716dc7f
tree80244b083694b8eacfcd8775218108cc8f6a8850
parentde82b5bef1222b210c68e6807d20dc112512ef1b
[X86] Add ISD nodes for masked truncate so we can properly represent when the output has more elements than the input due to needing to be 128 bits.

We can't properly represent this with a vselect since the upper elements of the result are supposed to be zeroed regardless of the mask.

This also reuses the new nodes even when the result type fits in 128 bits if the input is q/d and the result is w/b since vselect w/b using k-register condition isn't legal without avx512bw. Currently we're doing this even when avx512bw is enabled, but I might change that.

This fixes some of PR34877

llvm-svn: 350985
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Target/X86/X86ISelLowering.h
llvm/lib/Target/X86/X86InstrAVX512.td
llvm/lib/Target/X86/X86InstrFragmentsSIMD.td
llvm/lib/Target/X86/X86IntrinsicsInfo.h
llvm/test/CodeGen/X86/avx512-intrinsics.ll
llvm/test/CodeGen/X86/avx512bwvl-intrinsics.ll
llvm/test/CodeGen/X86/avx512vl-intrinsics.ll
llvm/test/CodeGen/X86/pr37499.ll