[X86][SSE] SimplifyDemandedBitsForTargetNode - Add initial PACKSS support
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 7 Apr 2019 10:40:01 +0000 (10:40 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 7 Apr 2019 10:40:01 +0000 (10:40 +0000)
commit07adb6abdadfed379a9998e53beb82ce1e253b0e
treea1656b1a8d452b69f8cd08a3767a00526756e571
parent47a7662e29b669358e8b8d193f59e5c8d68568e8
[X86][SSE] SimplifyDemandedBitsForTargetNode - Add initial PACKSS support

In the case where we only want the sign bit (e.g. when using PACKSS truncation of comparison results for MOVMSK) then we can just demand the sign bit of the source operands.

This makes use of the fact that PACKSS saturates out of range values to the min/max int values - so the sign bit is always preserved.

Differential Revision: https://reviews.llvm.org/D60333

llvm-svn: 357859
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/bitcast-and-setcc-512.ll
llvm/test/CodeGen/X86/bitcast-setcc-128.ll
llvm/test/CodeGen/X86/bitcast-setcc-256.ll
llvm/test/CodeGen/X86/bitcast-setcc-512.ll
llvm/test/CodeGen/X86/movmsk-cmp.ll