xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/commuted-blend-mask.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=x86_64-unknown-unknown -mattr=+sse4.1 < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker; When commuting the operands of a SSE blend, make sure that the resulting blend
4*9880d681SAndroid Build Coastguard Worker; mask can be encoded as a imm8.
5*9880d681SAndroid Build Coastguard Worker; Before, when commuting the operands to the shuffle in function @test, the backend
6*9880d681SAndroid Build Coastguard Worker; produced the following assembly:
7*9880d681SAndroid Build Coastguard Worker;   pblendw $4294967103, %xmm1, %xmm0
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Workerdefine <4 x i32> @test(<4 x i32> %a, <4 x i32> %b) {
10*9880d681SAndroid Build Coastguard Worker  ;CHECK: pblendw $63, %xmm1, %xmm0
11*9880d681SAndroid Build Coastguard Worker  %shuffle = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 4, i32 5, i32 6, i32 3>
12*9880d681SAndroid Build Coastguard Worker  ret <4 x i32> %shuffle
13*9880d681SAndroid Build Coastguard Worker}
14