|
7 | 7 | ; RUN: opt < %s -mtriple=x86_64-unknown -mcpu=skx -passes=slp-vectorizer,instcombine -S | FileCheck %s --check-prefixes=CHECK,AVX512 |
8 | 8 |
|
9 | 9 | define <8 x float> @sitofp_uitofp(<8 x i32> %a) { |
10 | | -; SSE2-LABEL: @sitofp_uitofp( |
11 | | -; SSE2-NEXT: [[TMP1:%.*]] = shufflevector <8 x i32> [[A:%.*]], <8 x i32> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3> |
12 | | -; SSE2-NEXT: [[TMP2:%.*]] = sitofp <4 x i32> [[TMP1]] to <4 x float> |
13 | | -; SSE2-NEXT: [[TMP3:%.*]] = shufflevector <8 x i32> [[A]], <8 x i32> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7> |
14 | | -; SSE2-NEXT: [[TMP4:%.*]] = uitofp <4 x i32> [[TMP3]] to <4 x float> |
15 | | -; SSE2-NEXT: [[TMP5:%.*]] = shufflevector <4 x float> [[TMP2]], <4 x float> [[TMP4]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7> |
16 | | -; SSE2-NEXT: ret <8 x float> [[TMP5]] |
17 | | -; |
18 | | -; SLM-LABEL: @sitofp_uitofp( |
19 | | -; SLM-NEXT: [[TMP1:%.*]] = shufflevector <8 x i32> [[A:%.*]], <8 x i32> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3> |
20 | | -; SLM-NEXT: [[TMP2:%.*]] = sitofp <4 x i32> [[TMP1]] to <4 x float> |
21 | | -; SLM-NEXT: [[TMP3:%.*]] = shufflevector <8 x i32> [[A]], <8 x i32> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7> |
22 | | -; SLM-NEXT: [[TMP4:%.*]] = uitofp <4 x i32> [[TMP3]] to <4 x float> |
23 | | -; SLM-NEXT: [[TMP5:%.*]] = shufflevector <4 x float> [[TMP2]], <4 x float> [[TMP4]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7> |
24 | | -; SLM-NEXT: ret <8 x float> [[TMP5]] |
25 | | -; |
26 | | -; AVX-LABEL: @sitofp_uitofp( |
27 | | -; AVX-NEXT: [[TMP1:%.*]] = sitofp <8 x i32> [[A:%.*]] to <8 x float> |
28 | | -; AVX-NEXT: [[TMP2:%.*]] = uitofp <8 x i32> [[A]] to <8 x float> |
29 | | -; AVX-NEXT: [[TMP3:%.*]] = shufflevector <8 x float> [[TMP1]], <8 x float> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15> |
30 | | -; AVX-NEXT: ret <8 x float> [[TMP3]] |
31 | | -; |
32 | | -; AVX2-LABEL: @sitofp_uitofp( |
33 | | -; AVX2-NEXT: [[TMP1:%.*]] = sitofp <8 x i32> [[A:%.*]] to <8 x float> |
34 | | -; AVX2-NEXT: [[TMP2:%.*]] = uitofp <8 x i32> [[A]] to <8 x float> |
35 | | -; AVX2-NEXT: [[TMP3:%.*]] = shufflevector <8 x float> [[TMP1]], <8 x float> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15> |
36 | | -; AVX2-NEXT: ret <8 x float> [[TMP3]] |
37 | | -; |
38 | | -; AVX512-LABEL: @sitofp_uitofp( |
39 | | -; AVX512-NEXT: [[TMP1:%.*]] = sitofp <8 x i32> [[A:%.*]] to <8 x float> |
40 | | -; AVX512-NEXT: [[TMP2:%.*]] = uitofp <8 x i32> [[A]] to <8 x float> |
41 | | -; AVX512-NEXT: [[TMP3:%.*]] = shufflevector <8 x float> [[TMP1]], <8 x float> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15> |
42 | | -; AVX512-NEXT: ret <8 x float> [[TMP3]] |
| 10 | +; CHECK-LABEL: @sitofp_uitofp( |
| 11 | +; CHECK-NEXT: [[TMP1:%.*]] = sitofp <8 x i32> [[A:%.*]] to <8 x float> |
| 12 | +; CHECK-NEXT: [[TMP2:%.*]] = uitofp <8 x i32> [[A]] to <8 x float> |
| 13 | +; CHECK-NEXT: [[TMP3:%.*]] = shufflevector <8 x float> [[TMP1]], <8 x float> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15> |
| 14 | +; CHECK-NEXT: ret <8 x float> [[TMP3]] |
43 | 15 | ; |
44 | 16 | %a0 = extractelement <8 x i32> %a, i32 0 |
45 | 17 | %a1 = extractelement <8 x i32> %a, i32 1 |
@@ -69,39 +41,11 @@ define <8 x float> @sitofp_uitofp(<8 x i32> %a) { |
69 | 41 | } |
70 | 42 |
|
71 | 43 | define <8 x i32> @fptosi_fptoui(<8 x float> %a) { |
72 | | -; SSE2-LABEL: @fptosi_fptoui( |
73 | | -; SSE2-NEXT: [[TMP1:%.*]] = shufflevector <8 x float> [[A:%.*]], <8 x float> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3> |
74 | | -; SSE2-NEXT: [[TMP2:%.*]] = fptosi <4 x float> [[TMP1]] to <4 x i32> |
75 | | -; SSE2-NEXT: [[TMP3:%.*]] = shufflevector <8 x float> [[A]], <8 x float> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7> |
76 | | -; SSE2-NEXT: [[TMP4:%.*]] = fptoui <4 x float> [[TMP3]] to <4 x i32> |
77 | | -; SSE2-NEXT: [[TMP5:%.*]] = shufflevector <4 x i32> [[TMP2]], <4 x i32> [[TMP4]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7> |
78 | | -; SSE2-NEXT: ret <8 x i32> [[TMP5]] |
79 | | -; |
80 | | -; SLM-LABEL: @fptosi_fptoui( |
81 | | -; SLM-NEXT: [[TMP1:%.*]] = shufflevector <8 x float> [[A:%.*]], <8 x float> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3> |
82 | | -; SLM-NEXT: [[TMP2:%.*]] = fptosi <4 x float> [[TMP1]] to <4 x i32> |
83 | | -; SLM-NEXT: [[TMP3:%.*]] = shufflevector <8 x float> [[A]], <8 x float> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7> |
84 | | -; SLM-NEXT: [[TMP4:%.*]] = fptoui <4 x float> [[TMP3]] to <4 x i32> |
85 | | -; SLM-NEXT: [[TMP5:%.*]] = shufflevector <4 x i32> [[TMP2]], <4 x i32> [[TMP4]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7> |
86 | | -; SLM-NEXT: ret <8 x i32> [[TMP5]] |
87 | | -; |
88 | | -; AVX-LABEL: @fptosi_fptoui( |
89 | | -; AVX-NEXT: [[TMP1:%.*]] = fptosi <8 x float> [[A:%.*]] to <8 x i32> |
90 | | -; AVX-NEXT: [[TMP2:%.*]] = fptoui <8 x float> [[A]] to <8 x i32> |
91 | | -; AVX-NEXT: [[TMP3:%.*]] = shufflevector <8 x i32> [[TMP1]], <8 x i32> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15> |
92 | | -; AVX-NEXT: ret <8 x i32> [[TMP3]] |
93 | | -; |
94 | | -; AVX2-LABEL: @fptosi_fptoui( |
95 | | -; AVX2-NEXT: [[TMP1:%.*]] = fptosi <8 x float> [[A:%.*]] to <8 x i32> |
96 | | -; AVX2-NEXT: [[TMP2:%.*]] = fptoui <8 x float> [[A]] to <8 x i32> |
97 | | -; AVX2-NEXT: [[TMP3:%.*]] = shufflevector <8 x i32> [[TMP1]], <8 x i32> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15> |
98 | | -; AVX2-NEXT: ret <8 x i32> [[TMP3]] |
99 | | -; |
100 | | -; AVX512-LABEL: @fptosi_fptoui( |
101 | | -; AVX512-NEXT: [[TMP1:%.*]] = fptosi <8 x float> [[A:%.*]] to <8 x i32> |
102 | | -; AVX512-NEXT: [[TMP2:%.*]] = fptoui <8 x float> [[A]] to <8 x i32> |
103 | | -; AVX512-NEXT: [[TMP3:%.*]] = shufflevector <8 x i32> [[TMP1]], <8 x i32> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15> |
104 | | -; AVX512-NEXT: ret <8 x i32> [[TMP3]] |
| 44 | +; CHECK-LABEL: @fptosi_fptoui( |
| 45 | +; CHECK-NEXT: [[TMP1:%.*]] = fptosi <8 x float> [[A:%.*]] to <8 x i32> |
| 46 | +; CHECK-NEXT: [[TMP2:%.*]] = fptoui <8 x float> [[A]] to <8 x i32> |
| 47 | +; CHECK-NEXT: [[TMP3:%.*]] = shufflevector <8 x i32> [[TMP1]], <8 x i32> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15> |
| 48 | +; CHECK-NEXT: ret <8 x i32> [[TMP3]] |
105 | 49 | ; |
106 | 50 | %a0 = extractelement <8 x float> %a, i32 0 |
107 | 51 | %a1 = extractelement <8 x float> %a, i32 1 |
@@ -131,39 +75,11 @@ define <8 x i32> @fptosi_fptoui(<8 x float> %a) { |
131 | 75 | } |
132 | 76 |
|
133 | 77 | define <8 x float> @fneg_fabs(<8 x float> %a) { |
134 | | -; SSE2-LABEL: @fneg_fabs( |
135 | | -; SSE2-NEXT: [[TMP1:%.*]] = shufflevector <8 x float> [[A:%.*]], <8 x float> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3> |
136 | | -; SSE2-NEXT: [[TMP2:%.*]] = shufflevector <8 x float> [[A]], <8 x float> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7> |
137 | | -; SSE2-NEXT: [[TMP3:%.*]] = fneg <4 x float> [[TMP1]] |
138 | | -; SSE2-NEXT: [[TMP4:%.*]] = call <4 x float> @llvm.fabs.v4f32(<4 x float> [[TMP2]]) |
139 | | -; SSE2-NEXT: [[DOTUNCASTED:%.*]] = shufflevector <4 x float> [[TMP3]], <4 x float> [[TMP4]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7> |
140 | | -; SSE2-NEXT: ret <8 x float> [[DOTUNCASTED]] |
141 | | -; |
142 | | -; SLM-LABEL: @fneg_fabs( |
143 | | -; SLM-NEXT: [[TMP1:%.*]] = shufflevector <8 x float> [[A:%.*]], <8 x float> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3> |
144 | | -; SLM-NEXT: [[TMP2:%.*]] = shufflevector <8 x float> [[A]], <8 x float> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7> |
145 | | -; SLM-NEXT: [[TMP3:%.*]] = fneg <4 x float> [[TMP1]] |
146 | | -; SLM-NEXT: [[TMP4:%.*]] = call <4 x float> @llvm.fabs.v4f32(<4 x float> [[TMP2]]) |
147 | | -; SLM-NEXT: [[DOTUNCASTED:%.*]] = shufflevector <4 x float> [[TMP3]], <4 x float> [[TMP4]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7> |
148 | | -; SLM-NEXT: ret <8 x float> [[DOTUNCASTED]] |
149 | | -; |
150 | | -; AVX-LABEL: @fneg_fabs( |
151 | | -; AVX-NEXT: [[TMP1:%.*]] = fneg <8 x float> [[A:%.*]] |
152 | | -; AVX-NEXT: [[TMP2:%.*]] = call <8 x float> @llvm.fabs.v8f32(<8 x float> [[A]]) |
153 | | -; AVX-NEXT: [[DOTUNCASTED:%.*]] = shufflevector <8 x float> [[TMP1]], <8 x float> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15> |
154 | | -; AVX-NEXT: ret <8 x float> [[DOTUNCASTED]] |
155 | | -; |
156 | | -; AVX2-LABEL: @fneg_fabs( |
157 | | -; AVX2-NEXT: [[TMP1:%.*]] = fneg <8 x float> [[A:%.*]] |
158 | | -; AVX2-NEXT: [[TMP2:%.*]] = call <8 x float> @llvm.fabs.v8f32(<8 x float> [[A]]) |
159 | | -; AVX2-NEXT: [[DOTUNCASTED:%.*]] = shufflevector <8 x float> [[TMP1]], <8 x float> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15> |
160 | | -; AVX2-NEXT: ret <8 x float> [[DOTUNCASTED]] |
161 | | -; |
162 | | -; AVX512-LABEL: @fneg_fabs( |
163 | | -; AVX512-NEXT: [[TMP1:%.*]] = fneg <8 x float> [[A:%.*]] |
164 | | -; AVX512-NEXT: [[TMP2:%.*]] = call <8 x float> @llvm.fabs.v8f32(<8 x float> [[A]]) |
165 | | -; AVX512-NEXT: [[DOTUNCASTED:%.*]] = shufflevector <8 x float> [[TMP1]], <8 x float> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15> |
166 | | -; AVX512-NEXT: ret <8 x float> [[DOTUNCASTED]] |
| 78 | +; CHECK-LABEL: @fneg_fabs( |
| 79 | +; CHECK-NEXT: [[TMP1:%.*]] = fneg <8 x float> [[A:%.*]] |
| 80 | +; CHECK-NEXT: [[TMP2:%.*]] = call <8 x float> @llvm.fabs.v8f32(<8 x float> [[A]]) |
| 81 | +; CHECK-NEXT: [[DOTUNCASTED:%.*]] = shufflevector <8 x float> [[TMP1]], <8 x float> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15> |
| 82 | +; CHECK-NEXT: ret <8 x float> [[DOTUNCASTED]] |
167 | 83 | ; |
168 | 84 | %a0 = extractelement <8 x float> %a, i32 0 |
169 | 85 | %a1 = extractelement <8 x float> %a, i32 1 |
@@ -209,39 +125,11 @@ define <8 x float> @fneg_fabs(<8 x float> %a) { |
209 | 125 | } |
210 | 126 |
|
211 | 127 | define <8 x i32> @sext_zext(<8 x i16> %a) { |
212 | | -; SSE2-LABEL: @sext_zext( |
213 | | -; SSE2-NEXT: [[TMP1:%.*]] = shufflevector <8 x i16> [[A:%.*]], <8 x i16> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3> |
214 | | -; SSE2-NEXT: [[TMP2:%.*]] = sext <4 x i16> [[TMP1]] to <4 x i32> |
215 | | -; SSE2-NEXT: [[TMP3:%.*]] = shufflevector <8 x i16> [[A]], <8 x i16> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7> |
216 | | -; SSE2-NEXT: [[TMP4:%.*]] = zext <4 x i16> [[TMP3]] to <4 x i32> |
217 | | -; SSE2-NEXT: [[TMP5:%.*]] = shufflevector <4 x i32> [[TMP2]], <4 x i32> [[TMP4]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7> |
218 | | -; SSE2-NEXT: ret <8 x i32> [[TMP5]] |
219 | | -; |
220 | | -; SLM-LABEL: @sext_zext( |
221 | | -; SLM-NEXT: [[TMP1:%.*]] = shufflevector <8 x i16> [[A:%.*]], <8 x i16> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3> |
222 | | -; SLM-NEXT: [[TMP2:%.*]] = sext <4 x i16> [[TMP1]] to <4 x i32> |
223 | | -; SLM-NEXT: [[TMP3:%.*]] = shufflevector <8 x i16> [[A]], <8 x i16> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7> |
224 | | -; SLM-NEXT: [[TMP4:%.*]] = zext <4 x i16> [[TMP3]] to <4 x i32> |
225 | | -; SLM-NEXT: [[TMP5:%.*]] = shufflevector <4 x i32> [[TMP2]], <4 x i32> [[TMP4]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7> |
226 | | -; SLM-NEXT: ret <8 x i32> [[TMP5]] |
227 | | -; |
228 | | -; AVX-LABEL: @sext_zext( |
229 | | -; AVX-NEXT: [[TMP1:%.*]] = sext <8 x i16> [[A:%.*]] to <8 x i32> |
230 | | -; AVX-NEXT: [[TMP2:%.*]] = zext <8 x i16> [[A]] to <8 x i32> |
231 | | -; AVX-NEXT: [[TMP3:%.*]] = shufflevector <8 x i32> [[TMP1]], <8 x i32> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15> |
232 | | -; AVX-NEXT: ret <8 x i32> [[TMP3]] |
233 | | -; |
234 | | -; AVX2-LABEL: @sext_zext( |
235 | | -; AVX2-NEXT: [[TMP1:%.*]] = sext <8 x i16> [[A:%.*]] to <8 x i32> |
236 | | -; AVX2-NEXT: [[TMP2:%.*]] = zext <8 x i16> [[A]] to <8 x i32> |
237 | | -; AVX2-NEXT: [[TMP3:%.*]] = shufflevector <8 x i32> [[TMP1]], <8 x i32> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15> |
238 | | -; AVX2-NEXT: ret <8 x i32> [[TMP3]] |
239 | | -; |
240 | | -; AVX512-LABEL: @sext_zext( |
241 | | -; AVX512-NEXT: [[TMP1:%.*]] = sext <8 x i16> [[A:%.*]] to <8 x i32> |
242 | | -; AVX512-NEXT: [[TMP2:%.*]] = zext <8 x i16> [[A]] to <8 x i32> |
243 | | -; AVX512-NEXT: [[TMP3:%.*]] = shufflevector <8 x i32> [[TMP1]], <8 x i32> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15> |
244 | | -; AVX512-NEXT: ret <8 x i32> [[TMP3]] |
| 128 | +; CHECK-LABEL: @sext_zext( |
| 129 | +; CHECK-NEXT: [[TMP1:%.*]] = sext <8 x i16> [[A:%.*]] to <8 x i32> |
| 130 | +; CHECK-NEXT: [[TMP2:%.*]] = zext <8 x i16> [[A]] to <8 x i32> |
| 131 | +; CHECK-NEXT: [[TMP3:%.*]] = shufflevector <8 x i32> [[TMP1]], <8 x i32> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 12, i32 13, i32 14, i32 15> |
| 132 | +; CHECK-NEXT: ret <8 x i32> [[TMP3]] |
245 | 133 | ; |
246 | 134 | %a0 = extractelement <8 x i16> %a, i32 0 |
247 | 135 | %a1 = extractelement <8 x i16> %a, i32 1 |
@@ -352,3 +240,9 @@ define <8 x float> @sitofp_uitofp_4i32_8i16_16i8(<4 x i32> %a, <8 x i16> %b, <16 |
352 | 240 | %r7 = insertelement <8 x float> %r6, float %ab7, i32 7 |
353 | 241 | ret <8 x float> %r7 |
354 | 242 | } |
| 243 | +;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: |
| 244 | +; AVX: {{.*}} |
| 245 | +; AVX2: {{.*}} |
| 246 | +; AVX512: {{.*}} |
| 247 | +; SLM: {{.*}} |
| 248 | +; SSE2: {{.*}} |
0 commit comments