2017-05-04 21:08:09 +08:00
|
|
|
; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+sse4.1 | FileCheck %s
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse4.1 | FileCheck %s
|
[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
2014-11-06 22:36:45 +08:00
|
|
|
|
|
|
|
; When commuting the operands of a SSE blend, make sure that the resulting blend
|
|
|
|
; mask can be encoded as a imm8.
|
|
|
|
; Before, when commuting the operands to the shuffle in function @test, the backend
|
|
|
|
; produced the following assembly:
|
|
|
|
; pblendw $4294967103, %xmm1, %xmm0
|
|
|
|
|
|
|
|
define <4 x i32> @test(<4 x i32> %a, <4 x i32> %b) {
|
2017-05-04 21:08:09 +08:00
|
|
|
; CHECK: pblendw $63, %xmm1, %xmm0
|
[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
2014-11-06 22:36:45 +08:00
|
|
|
%shuffle = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 4, i32 5, i32 6, i32 3>
|
2018-01-16 06:18:45 +08:00
|
|
|
; add forces execution domain
|
|
|
|
%sum = add <4 x i32> %shuffle, %shuffle
|
|
|
|
ret <4 x i32> %sum
|
[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
2014-11-06 22:36:45 +08:00
|
|
|
}
|