llvm.org GIT mirror llvm / 25c80fb
[X86][SSE] Classify AND bitmasks as variable shuffle masks They are loading the bitmasks from the constant pool so the cost is similar to loading a shuffle mask. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288367 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Pilgrim 3 years ago
2 changed file(s) with 4 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
40604060 static bool isTargetShuffleVariableMask(unsigned Opcode) {
40614061 switch (Opcode) {
40624062 default: return false;
4063 // Target Shuffles.
40634064 case X86ISD::PSHUFB:
40644065 case X86ISD::VPERMILPV:
40654066 case X86ISD::VPERMIL2:
40674068 case X86ISD::VPERMV:
40684069 case X86ISD::VPERMV3:
40694070 case X86ISD::VPERMIV3:
4071 return true;
4072 // 'Faux' Target Shuffles.
4073 case ISD::AND:
40704074 return true;
40714075 }
40724076 }
939939 define <2 x i64> @shuffle_v2i64_bitcast_z123(<2 x i64> %x) {
940940 ; SSE2-LABEL: shuffle_v2i64_bitcast_z123:
941941 ; SSE2: # BB#0:
942 ; SSE2-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero
943 ; SSE2-NEXT: movss {{.*#+}} xmm0 = xmm1[0],xmm0[1,2,3]
944942 ; SSE2-NEXT: andps {{.*}}(%rip), %xmm0
945943 ; SSE2-NEXT: retq
946944 ;
947945 ; SSE3-LABEL: shuffle_v2i64_bitcast_z123:
948946 ; SSE3: # BB#0:
949 ; SSE3-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero
950 ; SSE3-NEXT: movss {{.*#+}} xmm0 = xmm1[0],xmm0[1,2,3]
951947 ; SSE3-NEXT: andps {{.*}}(%rip), %xmm0
952948 ; SSE3-NEXT: retq
953949 ;
954950 ; SSSE3-LABEL: shuffle_v2i64_bitcast_z123:
955951 ; SSSE3: # BB#0:
956 ; SSSE3-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero
957 ; SSSE3-NEXT: movss {{.*#+}} xmm0 = xmm1[0],xmm0[1,2,3]
958952 ; SSSE3-NEXT: andps {{.*}}(%rip), %xmm0
959953 ; SSSE3-NEXT: retq
960954 ;