[X86] When commuting SSE immediate blend, make sure that the new blend mask is a...
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Thu, 6 Nov 2014 14:36:45 +0000 (14:36 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Thu, 6 Nov 2014 14:36:45 +0000 (14:36 +0000)
commit7ecd22ca4a205788ce8228d60bf5e67bb06fdfb6
tree22a32e11fe9e73d6e56bcd585febad1a7c547c3e
parente77ffe35bf8565d859df807d2a0507def5096c8a
[X86] When commuting SSE immediate blend, make sure that the new blend mask is a valid imm8.

Example:
define <4 x i32> @test(<4 x i32> %a, <4 x i32> %b) {
  %shuffle = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 4, i32 5, i32 6, i32 3>
  ret <4 x i32> %shuffle
}

Before llc (-mattr=+sse4.1), produced the following assembly instruction:
  pblendw $4294967103, %xmm1, %xmm0

After
  pblendw $63, %xmm1, %xmm0

llvm-svn: 221455
llvm/lib/Target/X86/X86InstrInfo.cpp
llvm/test/CodeGen/X86/commuted-blend-mask.ll [new file with mode: 0644]