1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown -mcpu=skx | FileCheck %s
4 define <8 x float> @select_and_v8i1(<8 x i1> %a, <8 x i1> %b, <8 x i1> %c, <8 x float> %d) {
5 ; CHECK-LABEL: select_and_v8i1:
7 ; CHECK-NEXT: vpternlogq $200, %xmm1, %xmm2, %xmm0
8 ; CHECK-NEXT: vpsllw $15, %xmm0, %xmm0
9 ; CHECK-NEXT: vpmovw2m %xmm0, %k1
10 ; CHECK-NEXT: vbroadcastss {{.*#+}} ymm0 = [1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0]
11 ; CHECK-NEXT: vmovaps %ymm3, %ymm0 {%k1}
13 %t2 = select <8 x i1> %a, <8 x i1> <i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1>, <8 x i1> %b
14 %t3 = and <8 x i1> %c, %t2
15 %t4= select <8 x i1> %t3, <8 x float> %d, <8 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>
19 define <8 x float> @select_and_v8i1_2(i8 %m1, i8 %m2, i8 %m3, <8 x float> %d) {
20 ; CHECK-LABEL: select_and_v8i1_2:
22 ; CHECK-NEXT: orl %esi, %edi
23 ; CHECK-NEXT: andl %edx, %edi
24 ; CHECK-NEXT: kmovd %edi, %k1
25 ; CHECK-NEXT: vbroadcastss {{.*#+}} ymm1 = [1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0]
26 ; CHECK-NEXT: vmovaps %ymm0, %ymm1 {%k1}
27 ; CHECK-NEXT: vmovaps %ymm1, %ymm0
29 %a = bitcast i8 %m1 to <8 x i1>
30 %b = bitcast i8 %m2 to <8 x i1>
31 %c = bitcast i8 %m3 to <8 x i1>
32 %t2 = select <8 x i1> %a, <8 x i1> <i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1>, <8 x i1> %b
33 %t3 = and <8 x i1> %c, %t2
34 %t4= select <8 x i1> %t3, <8 x float> %d, <8 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>
38 define <8 x float> @select_and_v8i1_3(<8 x i16> %m1, <8 x i16> %m2, <8 x i16> %m3, <8 x float> %d) {
39 ; CHECK-LABEL: select_and_v8i1_3:
41 ; CHECK-NEXT: vpcmpeqw %xmm1, %xmm0, %k0
42 ; CHECK-NEXT: vpcmpeqw %xmm2, %xmm0, %k1
43 ; CHECK-NEXT: korb %k1, %k0, %k1
44 ; CHECK-NEXT: vpcmpeqw %xmm2, %xmm1, %k1 {%k1}
45 ; CHECK-NEXT: vbroadcastss {{.*#+}} ymm0 = [1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0]
46 ; CHECK-NEXT: vmovaps %ymm3, %ymm0 {%k1}
48 %a = icmp eq <8 x i16> %m1, %m2
49 %b = icmp eq <8 x i16> %m1, %m3
50 %c = icmp eq <8 x i16> %m2, %m3
51 %t2 = select <8 x i1> %a, <8 x i1> <i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1, i1 -1>, <8 x i1> %b
52 %t3 = and <8 x i1> %c, %t2
53 %t4= select <8 x i1> %t3, <8 x float> %d, <8 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>
57 define <8 x float> @select_or_v8i1(<8 x i1> %a, <8 x i1> %b, <8 x i1> %c, <8 x float> %d) {
58 ; CHECK-LABEL: select_or_v8i1:
60 ; CHECK-NEXT: vpsllw $15, %xmm2, %xmm2
61 ; CHECK-NEXT: vpmovw2m %xmm2, %k0
62 ; CHECK-NEXT: vpsllw $15, %xmm1, %xmm1
63 ; CHECK-NEXT: vpmovw2m %xmm1, %k1
64 ; CHECK-NEXT: vpsllw $15, %xmm0, %xmm0
65 ; CHECK-NEXT: vpmovw2m %xmm0, %k2
66 ; CHECK-NEXT: kandnb %k1, %k2, %k1
67 ; CHECK-NEXT: korb %k1, %k0, %k1
68 ; CHECK-NEXT: vbroadcastss {{.*#+}} ymm0 = [1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0]
69 ; CHECK-NEXT: vmovaps %ymm3, %ymm0 {%k1}
71 %t2 = select <8 x i1> %a, <8 x i1> <i1 0, i1 0, i1 0, i1 0, i1 0, i1 0, i1 0, i1 0>, <8 x i1> %b
72 %t3 = or <8 x i1> %c, %t2
73 %t4= select <8 x i1> %t3, <8 x float> %d, <8 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>
77 define <8 x float> @select_or_v8i1_2(i8 %m1, i8 %m2, i8 %m3, <8 x float> %d) {
78 ; CHECK-LABEL: select_or_v8i1_2:
80 ; CHECK-NEXT: kmovd %edi, %k0
81 ; CHECK-NEXT: kmovd %esi, %k1
82 ; CHECK-NEXT: kmovd %edx, %k2
83 ; CHECK-NEXT: kandnb %k1, %k0, %k0
84 ; CHECK-NEXT: korb %k0, %k2, %k1
85 ; CHECK-NEXT: vbroadcastss {{.*#+}} ymm1 = [1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0]
86 ; CHECK-NEXT: vmovaps %ymm0, %ymm1 {%k1}
87 ; CHECK-NEXT: vmovaps %ymm1, %ymm0
89 %a = bitcast i8 %m1 to <8 x i1>
90 %b = bitcast i8 %m2 to <8 x i1>
91 %c = bitcast i8 %m3 to <8 x i1>
92 %t2 = select <8 x i1> %a, <8 x i1> <i1 0, i1 0, i1 0, i1 0, i1 0, i1 0, i1 0, i1 0>, <8 x i1> %b
93 %t3 = or <8 x i1> %c, %t2
94 %t4= select <8 x i1> %t3, <8 x float> %d, <8 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>
98 define <8 x float> @select_or_v8i1_3(<8 x i16> %m1, <8 x i16> %m2, <8 x i16> %m3, <8 x float> %d) {
99 ; CHECK-LABEL: select_or_v8i1_3:
101 ; CHECK-NEXT: vpcmpneqw %xmm1, %xmm0, %k1
102 ; CHECK-NEXT: vpcmpeqw %xmm2, %xmm1, %k0
103 ; CHECK-NEXT: vpcmpeqw %xmm2, %xmm0, %k1 {%k1}
104 ; CHECK-NEXT: korb %k1, %k0, %k1
105 ; CHECK-NEXT: vbroadcastss {{.*#+}} ymm0 = [1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0,1.0E+0]
106 ; CHECK-NEXT: vmovaps %ymm3, %ymm0 {%k1}
108 %a = icmp eq <8 x i16> %m1, %m2
109 %b = icmp eq <8 x i16> %m1, %m3
110 %c = icmp eq <8 x i16> %m2, %m3
111 %t2 = select <8 x i1> %a, <8 x i1> <i1 0, i1 0, i1 0, i1 0, i1 0, i1 0, i1 0, i1 0>, <8 x i1> %b
112 %t3 = or <8 x i1> %c, %t2
113 %t4= select <8 x i1> %t3, <8 x float> %d, <8 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>