[X86] Use ZERO_EXTEND instead of ANY_EXTEND when extending the shift amount for a...
authorCraig Topper <craig.topper@intel.com>
Tue, 19 Dec 2017 04:52:04 +0000 (04:52 +0000)
committerCraig Topper <craig.topper@intel.com>
Tue, 19 Dec 2017 04:52:04 +0000 (04:52 +0000)
commitad3a554889adfe97e60f937800b8393e591083f0
tree0e44a296f74786742a533580723bc57eec6601a3
parent768d6dd08783440606da83dac490889329619898
[X86] Use ZERO_EXTEND instead of ANY_EXTEND when extending the shift amount for a non-uniform shift.

My reading of the SDM says that all bits of the shift amount are used. If the value of the element is larger than the number of bits the result the shift result is zero. So I think we need to zero_extend here to avoid garbage in the upper bits.

In reality we lower any_extend as zero_extend so in most cases it would be hard to hit this.

llvm-svn: 321055
llvm/lib/Target/X86/X86ISelLowering.cpp