1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -mtriple=x86_64-unknown -passes=slp-vectorizer -S | FileCheck %s --check-prefix=CHECK --check-prefix=SSE
3 ; RUN: opt < %s -mtriple=x86_64-unknown -mcpu=corei7-avx -passes=slp-vectorizer -S | FileCheck %s --check-prefix=CHECK --check-prefix=AVX --check-prefix=AVX256NODQ
4 ; RUN: opt < %s -mtriple=x86_64-unknown -mcpu=bdver1 -passes=slp-vectorizer -S | FileCheck %s --check-prefix=CHECK --check-prefix=AVX --check-prefix=AVX256NODQ
5 ; RUN: opt < %s -mtriple=x86_64-unknown -mcpu=core-avx2 -passes=slp-vectorizer -S | FileCheck %s --check-prefix=CHECK --check-prefix=AVX --check-prefix=AVX256NODQ
6 ; RUN: opt < %s -mtriple=x86_64-unknown -mcpu=skylake-avx512 -mattr=-prefer-256-bit -passes=slp-vectorizer -S | FileCheck %s --check-prefix=CHECK --check-prefix=AVX --check-prefix=AVX512
7 ; RUN: opt < %s -mtriple=x86_64-unknown -mcpu=skylake-avx512 -mattr=+prefer-256-bit -passes=slp-vectorizer -S | FileCheck %s --check-prefix=CHECK --check-prefix=AVX --check-prefix=AVX256DQ
9 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
11 @src64 = common global [8 x double] zeroinitializer, align 64
12 @src32 = common global [16 x float] zeroinitializer, align 64
13 @dst64 = common global [8 x i64] zeroinitializer, align 64
14 @dst32 = common global [16 x i32] zeroinitializer, align 64
15 @dst16 = common global [32 x i16] zeroinitializer, align 64
16 @dst8 = common global [64 x i8] zeroinitializer, align 64
22 define void @fptosi_8f64_8i64() #0 {
23 ; SSE-LABEL: @fptosi_8f64_8i64(
24 ; SSE-NEXT: [[A0:%.*]] = load double, ptr @src64, align 8
25 ; SSE-NEXT: [[A1:%.*]] = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 1), align 8
26 ; SSE-NEXT: [[A2:%.*]] = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 2), align 8
27 ; SSE-NEXT: [[A3:%.*]] = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 3), align 8
28 ; SSE-NEXT: [[A4:%.*]] = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 4), align 8
29 ; SSE-NEXT: [[A5:%.*]] = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 5), align 8
30 ; SSE-NEXT: [[A6:%.*]] = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 6), align 8
31 ; SSE-NEXT: [[A7:%.*]] = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 7), align 8
32 ; SSE-NEXT: [[CVT0:%.*]] = fptosi double [[A0]] to i64
33 ; SSE-NEXT: [[CVT1:%.*]] = fptosi double [[A1]] to i64
34 ; SSE-NEXT: [[CVT2:%.*]] = fptosi double [[A2]] to i64
35 ; SSE-NEXT: [[CVT3:%.*]] = fptosi double [[A3]] to i64
36 ; SSE-NEXT: [[CVT4:%.*]] = fptosi double [[A4]] to i64
37 ; SSE-NEXT: [[CVT5:%.*]] = fptosi double [[A5]] to i64
38 ; SSE-NEXT: [[CVT6:%.*]] = fptosi double [[A6]] to i64
39 ; SSE-NEXT: [[CVT7:%.*]] = fptosi double [[A7]] to i64
40 ; SSE-NEXT: store i64 [[CVT0]], ptr @dst64, align 8
41 ; SSE-NEXT: store i64 [[CVT1]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 1), align 8
42 ; SSE-NEXT: store i64 [[CVT2]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 2), align 8
43 ; SSE-NEXT: store i64 [[CVT3]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 3), align 8
44 ; SSE-NEXT: store i64 [[CVT4]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 4), align 8
45 ; SSE-NEXT: store i64 [[CVT5]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 5), align 8
46 ; SSE-NEXT: store i64 [[CVT6]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 6), align 8
47 ; SSE-NEXT: store i64 [[CVT7]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 7), align 8
50 ; AVX256NODQ-LABEL: @fptosi_8f64_8i64(
51 ; AVX256NODQ-NEXT: [[A0:%.*]] = load double, ptr @src64, align 8
52 ; AVX256NODQ-NEXT: [[A1:%.*]] = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 1), align 8
53 ; AVX256NODQ-NEXT: [[A2:%.*]] = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 2), align 8
54 ; AVX256NODQ-NEXT: [[A3:%.*]] = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 3), align 8
55 ; AVX256NODQ-NEXT: [[A4:%.*]] = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 4), align 8
56 ; AVX256NODQ-NEXT: [[A5:%.*]] = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 5), align 8
57 ; AVX256NODQ-NEXT: [[A6:%.*]] = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 6), align 8
58 ; AVX256NODQ-NEXT: [[A7:%.*]] = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 7), align 8
59 ; AVX256NODQ-NEXT: [[CVT0:%.*]] = fptosi double [[A0]] to i64
60 ; AVX256NODQ-NEXT: [[CVT1:%.*]] = fptosi double [[A1]] to i64
61 ; AVX256NODQ-NEXT: [[CVT2:%.*]] = fptosi double [[A2]] to i64
62 ; AVX256NODQ-NEXT: [[CVT3:%.*]] = fptosi double [[A3]] to i64
63 ; AVX256NODQ-NEXT: [[CVT4:%.*]] = fptosi double [[A4]] to i64
64 ; AVX256NODQ-NEXT: [[CVT5:%.*]] = fptosi double [[A5]] to i64
65 ; AVX256NODQ-NEXT: [[CVT6:%.*]] = fptosi double [[A6]] to i64
66 ; AVX256NODQ-NEXT: [[CVT7:%.*]] = fptosi double [[A7]] to i64
67 ; AVX256NODQ-NEXT: store i64 [[CVT0]], ptr @dst64, align 8
68 ; AVX256NODQ-NEXT: store i64 [[CVT1]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 1), align 8
69 ; AVX256NODQ-NEXT: store i64 [[CVT2]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 2), align 8
70 ; AVX256NODQ-NEXT: store i64 [[CVT3]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 3), align 8
71 ; AVX256NODQ-NEXT: store i64 [[CVT4]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 4), align 8
72 ; AVX256NODQ-NEXT: store i64 [[CVT5]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 5), align 8
73 ; AVX256NODQ-NEXT: store i64 [[CVT6]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 6), align 8
74 ; AVX256NODQ-NEXT: store i64 [[CVT7]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 7), align 8
75 ; AVX256NODQ-NEXT: ret void
77 ; AVX512-LABEL: @fptosi_8f64_8i64(
78 ; AVX512-NEXT: [[TMP1:%.*]] = load <8 x double>, ptr @src64, align 8
79 ; AVX512-NEXT: [[TMP2:%.*]] = fptosi <8 x double> [[TMP1]] to <8 x i64>
80 ; AVX512-NEXT: store <8 x i64> [[TMP2]], ptr @dst64, align 8
81 ; AVX512-NEXT: ret void
83 ; AVX256DQ-LABEL: @fptosi_8f64_8i64(
84 ; AVX256DQ-NEXT: [[TMP1:%.*]] = load <4 x double>, ptr @src64, align 8
85 ; AVX256DQ-NEXT: [[TMP2:%.*]] = fptosi <4 x double> [[TMP1]] to <4 x i64>
86 ; AVX256DQ-NEXT: store <4 x i64> [[TMP2]], ptr @dst64, align 8
87 ; AVX256DQ-NEXT: [[TMP3:%.*]] = load <4 x double>, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 4), align 8
88 ; AVX256DQ-NEXT: [[TMP4:%.*]] = fptosi <4 x double> [[TMP3]] to <4 x i64>
89 ; AVX256DQ-NEXT: store <4 x i64> [[TMP4]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 4), align 8
90 ; AVX256DQ-NEXT: ret void
92 %a0 = load double, ptr @src64, align 8
93 %a1 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 1), align 8
94 %a2 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 2), align 8
95 %a3 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 3), align 8
96 %a4 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 4), align 8
97 %a5 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 5), align 8
98 %a6 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 6), align 8
99 %a7 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 7), align 8
100 %cvt0 = fptosi double %a0 to i64
101 %cvt1 = fptosi double %a1 to i64
102 %cvt2 = fptosi double %a2 to i64
103 %cvt3 = fptosi double %a3 to i64
104 %cvt4 = fptosi double %a4 to i64
105 %cvt5 = fptosi double %a5 to i64
106 %cvt6 = fptosi double %a6 to i64
107 %cvt7 = fptosi double %a7 to i64
108 store i64 %cvt0, ptr @dst64, align 8
109 store i64 %cvt1, ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 1), align 8
110 store i64 %cvt2, ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 2), align 8
111 store i64 %cvt3, ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 3), align 8
112 store i64 %cvt4, ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 4), align 8
113 store i64 %cvt5, ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 5), align 8
114 store i64 %cvt6, ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 6), align 8
115 store i64 %cvt7, ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 7), align 8
119 define void @fptosi_8f64_8i32() #0 {
120 ; SSE-LABEL: @fptosi_8f64_8i32(
121 ; SSE-NEXT: [[TMP1:%.*]] = load <4 x double>, ptr @src64, align 8
122 ; SSE-NEXT: [[TMP2:%.*]] = fptosi <4 x double> [[TMP1]] to <4 x i32>
123 ; SSE-NEXT: store <4 x i32> [[TMP2]], ptr @dst32, align 4
124 ; SSE-NEXT: [[TMP3:%.*]] = load <4 x double>, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 4), align 8
125 ; SSE-NEXT: [[TMP4:%.*]] = fptosi <4 x double> [[TMP3]] to <4 x i32>
126 ; SSE-NEXT: store <4 x i32> [[TMP4]], ptr getelementptr inbounds ([16 x i32], ptr @dst32, i32 0, i64 4), align 4
129 ; AVX-LABEL: @fptosi_8f64_8i32(
130 ; AVX-NEXT: [[TMP1:%.*]] = load <8 x double>, ptr @src64, align 8
131 ; AVX-NEXT: [[TMP2:%.*]] = fptosi <8 x double> [[TMP1]] to <8 x i32>
132 ; AVX-NEXT: store <8 x i32> [[TMP2]], ptr @dst32, align 4
135 %a0 = load double, ptr @src64, align 8
136 %a1 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 1), align 8
137 %a2 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 2), align 8
138 %a3 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 3), align 8
139 %a4 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 4), align 8
140 %a5 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 5), align 8
141 %a6 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 6), align 8
142 %a7 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 7), align 8
143 %cvt0 = fptosi double %a0 to i32
144 %cvt1 = fptosi double %a1 to i32
145 %cvt2 = fptosi double %a2 to i32
146 %cvt3 = fptosi double %a3 to i32
147 %cvt4 = fptosi double %a4 to i32
148 %cvt5 = fptosi double %a5 to i32
149 %cvt6 = fptosi double %a6 to i32
150 %cvt7 = fptosi double %a7 to i32
151 store i32 %cvt0, ptr @dst32, align 4
152 store i32 %cvt1, ptr getelementptr inbounds ([16 x i32], ptr @dst32, i32 0, i64 1), align 4
153 store i32 %cvt2, ptr getelementptr inbounds ([16 x i32], ptr @dst32, i32 0, i64 2), align 4
154 store i32 %cvt3, ptr getelementptr inbounds ([16 x i32], ptr @dst32, i32 0, i64 3), align 4
155 store i32 %cvt4, ptr getelementptr inbounds ([16 x i32], ptr @dst32, i32 0, i64 4), align 4
156 store i32 %cvt5, ptr getelementptr inbounds ([16 x i32], ptr @dst32, i32 0, i64 5), align 4
157 store i32 %cvt6, ptr getelementptr inbounds ([16 x i32], ptr @dst32, i32 0, i64 6), align 4
158 store i32 %cvt7, ptr getelementptr inbounds ([16 x i32], ptr @dst32, i32 0, i64 7), align 4
162 define void @fptosi_8f64_8i16() #0 {
163 ; CHECK-LABEL: @fptosi_8f64_8i16(
164 ; CHECK-NEXT: [[TMP1:%.*]] = load <8 x double>, ptr @src64, align 8
165 ; CHECK-NEXT: [[TMP2:%.*]] = fptosi <8 x double> [[TMP1]] to <8 x i16>
166 ; CHECK-NEXT: store <8 x i16> [[TMP2]], ptr @dst16, align 2
167 ; CHECK-NEXT: ret void
169 %a0 = load double, ptr @src64, align 8
170 %a1 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 1), align 8
171 %a2 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 2), align 8
172 %a3 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 3), align 8
173 %a4 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 4), align 8
174 %a5 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 5), align 8
175 %a6 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 6), align 8
176 %a7 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 7), align 8
177 %cvt0 = fptosi double %a0 to i16
178 %cvt1 = fptosi double %a1 to i16
179 %cvt2 = fptosi double %a2 to i16
180 %cvt3 = fptosi double %a3 to i16
181 %cvt4 = fptosi double %a4 to i16
182 %cvt5 = fptosi double %a5 to i16
183 %cvt6 = fptosi double %a6 to i16
184 %cvt7 = fptosi double %a7 to i16
185 store i16 %cvt0, ptr @dst16, align 2
186 store i16 %cvt1, ptr getelementptr inbounds ([32 x i16], ptr @dst16, i32 0, i64 1), align 2
187 store i16 %cvt2, ptr getelementptr inbounds ([32 x i16], ptr @dst16, i32 0, i64 2), align 2
188 store i16 %cvt3, ptr getelementptr inbounds ([32 x i16], ptr @dst16, i32 0, i64 3), align 2
189 store i16 %cvt4, ptr getelementptr inbounds ([32 x i16], ptr @dst16, i32 0, i64 4), align 2
190 store i16 %cvt5, ptr getelementptr inbounds ([32 x i16], ptr @dst16, i32 0, i64 5), align 2
191 store i16 %cvt6, ptr getelementptr inbounds ([32 x i16], ptr @dst16, i32 0, i64 6), align 2
192 store i16 %cvt7, ptr getelementptr inbounds ([32 x i16], ptr @dst16, i32 0, i64 7), align 2
196 define void @fptosi_8f64_8i8() #0 {
197 ; CHECK-LABEL: @fptosi_8f64_8i8(
198 ; CHECK-NEXT: [[TMP1:%.*]] = load <8 x double>, ptr @src64, align 8
199 ; CHECK-NEXT: [[TMP2:%.*]] = fptosi <8 x double> [[TMP1]] to <8 x i8>
200 ; CHECK-NEXT: store <8 x i8> [[TMP2]], ptr @dst8, align 1
201 ; CHECK-NEXT: ret void
203 %a0 = load double, ptr @src64, align 8
204 %a1 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 1), align 8
205 %a2 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 2), align 8
206 %a3 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 3), align 8
207 %a4 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 4), align 8
208 %a5 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 5), align 8
209 %a6 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 6), align 8
210 %a7 = load double, ptr getelementptr inbounds ([8 x double], ptr @src64, i32 0, i64 7), align 8
211 %cvt0 = fptosi double %a0 to i8
212 %cvt1 = fptosi double %a1 to i8
213 %cvt2 = fptosi double %a2 to i8
214 %cvt3 = fptosi double %a3 to i8
215 %cvt4 = fptosi double %a4 to i8
216 %cvt5 = fptosi double %a5 to i8
217 %cvt6 = fptosi double %a6 to i8
218 %cvt7 = fptosi double %a7 to i8
219 store i8 %cvt0, ptr @dst8, align 1
220 store i8 %cvt1, ptr getelementptr inbounds ([64 x i8], ptr @dst8, i32 0, i64 1), align 1
221 store i8 %cvt2, ptr getelementptr inbounds ([64 x i8], ptr @dst8, i32 0, i64 2), align 1
222 store i8 %cvt3, ptr getelementptr inbounds ([64 x i8], ptr @dst8, i32 0, i64 3), align 1
223 store i8 %cvt4, ptr getelementptr inbounds ([64 x i8], ptr @dst8, i32 0, i64 4), align 1
224 store i8 %cvt5, ptr getelementptr inbounds ([64 x i8], ptr @dst8, i32 0, i64 5), align 1
225 store i8 %cvt6, ptr getelementptr inbounds ([64 x i8], ptr @dst8, i32 0, i64 6), align 1
226 store i8 %cvt7, ptr getelementptr inbounds ([64 x i8], ptr @dst8, i32 0, i64 7), align 1
234 define void @fptosi_8f32_8i64() #0 {
235 ; SSE-LABEL: @fptosi_8f32_8i64(
236 ; SSE-NEXT: [[A0:%.*]] = load float, ptr @src32, align 4
237 ; SSE-NEXT: [[A1:%.*]] = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 1), align 4
238 ; SSE-NEXT: [[A2:%.*]] = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 2), align 4
239 ; SSE-NEXT: [[A3:%.*]] = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 3), align 4
240 ; SSE-NEXT: [[A4:%.*]] = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 4), align 4
241 ; SSE-NEXT: [[A5:%.*]] = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 5), align 4
242 ; SSE-NEXT: [[A6:%.*]] = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 6), align 4
243 ; SSE-NEXT: [[A7:%.*]] = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 7), align 4
244 ; SSE-NEXT: [[CVT0:%.*]] = fptosi float [[A0]] to i64
245 ; SSE-NEXT: [[CVT1:%.*]] = fptosi float [[A1]] to i64
246 ; SSE-NEXT: [[CVT2:%.*]] = fptosi float [[A2]] to i64
247 ; SSE-NEXT: [[CVT3:%.*]] = fptosi float [[A3]] to i64
248 ; SSE-NEXT: [[CVT4:%.*]] = fptosi float [[A4]] to i64
249 ; SSE-NEXT: [[CVT5:%.*]] = fptosi float [[A5]] to i64
250 ; SSE-NEXT: [[CVT6:%.*]] = fptosi float [[A6]] to i64
251 ; SSE-NEXT: [[CVT7:%.*]] = fptosi float [[A7]] to i64
252 ; SSE-NEXT: store i64 [[CVT0]], ptr @dst64, align 8
253 ; SSE-NEXT: store i64 [[CVT1]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 1), align 8
254 ; SSE-NEXT: store i64 [[CVT2]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 2), align 8
255 ; SSE-NEXT: store i64 [[CVT3]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 3), align 8
256 ; SSE-NEXT: store i64 [[CVT4]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 4), align 8
257 ; SSE-NEXT: store i64 [[CVT5]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 5), align 8
258 ; SSE-NEXT: store i64 [[CVT6]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 6), align 8
259 ; SSE-NEXT: store i64 [[CVT7]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 7), align 8
262 ; AVX256NODQ-LABEL: @fptosi_8f32_8i64(
263 ; AVX256NODQ-NEXT: [[A0:%.*]] = load float, ptr @src32, align 4
264 ; AVX256NODQ-NEXT: [[A1:%.*]] = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 1), align 4
265 ; AVX256NODQ-NEXT: [[A2:%.*]] = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 2), align 4
266 ; AVX256NODQ-NEXT: [[A3:%.*]] = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 3), align 4
267 ; AVX256NODQ-NEXT: [[A4:%.*]] = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 4), align 4
268 ; AVX256NODQ-NEXT: [[A5:%.*]] = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 5), align 4
269 ; AVX256NODQ-NEXT: [[A6:%.*]] = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 6), align 4
270 ; AVX256NODQ-NEXT: [[A7:%.*]] = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 7), align 4
271 ; AVX256NODQ-NEXT: [[CVT0:%.*]] = fptosi float [[A0]] to i64
272 ; AVX256NODQ-NEXT: [[CVT1:%.*]] = fptosi float [[A1]] to i64
273 ; AVX256NODQ-NEXT: [[CVT2:%.*]] = fptosi float [[A2]] to i64
274 ; AVX256NODQ-NEXT: [[CVT3:%.*]] = fptosi float [[A3]] to i64
275 ; AVX256NODQ-NEXT: [[CVT4:%.*]] = fptosi float [[A4]] to i64
276 ; AVX256NODQ-NEXT: [[CVT5:%.*]] = fptosi float [[A5]] to i64
277 ; AVX256NODQ-NEXT: [[CVT6:%.*]] = fptosi float [[A6]] to i64
278 ; AVX256NODQ-NEXT: [[CVT7:%.*]] = fptosi float [[A7]] to i64
279 ; AVX256NODQ-NEXT: store i64 [[CVT0]], ptr @dst64, align 8
280 ; AVX256NODQ-NEXT: store i64 [[CVT1]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 1), align 8
281 ; AVX256NODQ-NEXT: store i64 [[CVT2]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 2), align 8
282 ; AVX256NODQ-NEXT: store i64 [[CVT3]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 3), align 8
283 ; AVX256NODQ-NEXT: store i64 [[CVT4]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 4), align 8
284 ; AVX256NODQ-NEXT: store i64 [[CVT5]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 5), align 8
285 ; AVX256NODQ-NEXT: store i64 [[CVT6]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 6), align 8
286 ; AVX256NODQ-NEXT: store i64 [[CVT7]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 7), align 8
287 ; AVX256NODQ-NEXT: ret void
289 ; AVX512-LABEL: @fptosi_8f32_8i64(
290 ; AVX512-NEXT: [[TMP1:%.*]] = load <8 x float>, ptr @src32, align 4
291 ; AVX512-NEXT: [[TMP2:%.*]] = fptosi <8 x float> [[TMP1]] to <8 x i64>
292 ; AVX512-NEXT: store <8 x i64> [[TMP2]], ptr @dst64, align 8
293 ; AVX512-NEXT: ret void
295 ; AVX256DQ-LABEL: @fptosi_8f32_8i64(
296 ; AVX256DQ-NEXT: [[TMP1:%.*]] = load <4 x float>, ptr @src32, align 4
297 ; AVX256DQ-NEXT: [[TMP2:%.*]] = fptosi <4 x float> [[TMP1]] to <4 x i64>
298 ; AVX256DQ-NEXT: store <4 x i64> [[TMP2]], ptr @dst64, align 8
299 ; AVX256DQ-NEXT: [[TMP3:%.*]] = load <4 x float>, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 4), align 4
300 ; AVX256DQ-NEXT: [[TMP4:%.*]] = fptosi <4 x float> [[TMP3]] to <4 x i64>
301 ; AVX256DQ-NEXT: store <4 x i64> [[TMP4]], ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 4), align 8
302 ; AVX256DQ-NEXT: ret void
304 %a0 = load float, ptr @src32, align 4
305 %a1 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 1), align 4
306 %a2 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 2), align 4
307 %a3 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 3), align 4
308 %a4 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 4), align 4
309 %a5 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 5), align 4
310 %a6 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 6), align 4
311 %a7 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 7), align 4
312 %cvt0 = fptosi float %a0 to i64
313 %cvt1 = fptosi float %a1 to i64
314 %cvt2 = fptosi float %a2 to i64
315 %cvt3 = fptosi float %a3 to i64
316 %cvt4 = fptosi float %a4 to i64
317 %cvt5 = fptosi float %a5 to i64
318 %cvt6 = fptosi float %a6 to i64
319 %cvt7 = fptosi float %a7 to i64
320 store i64 %cvt0, ptr @dst64, align 8
321 store i64 %cvt1, ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 1), align 8
322 store i64 %cvt2, ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 2), align 8
323 store i64 %cvt3, ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 3), align 8
324 store i64 %cvt4, ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 4), align 8
325 store i64 %cvt5, ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 5), align 8
326 store i64 %cvt6, ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 6), align 8
327 store i64 %cvt7, ptr getelementptr inbounds ([8 x i64], ptr @dst64, i32 0, i64 7), align 8
331 define void @fptosi_8f32_8i32() #0 {
332 ; SSE-LABEL: @fptosi_8f32_8i32(
333 ; SSE-NEXT: [[TMP1:%.*]] = load <4 x float>, ptr @src32, align 4
334 ; SSE-NEXT: [[TMP2:%.*]] = fptosi <4 x float> [[TMP1]] to <4 x i32>
335 ; SSE-NEXT: store <4 x i32> [[TMP2]], ptr @dst32, align 4
336 ; SSE-NEXT: [[TMP3:%.*]] = load <4 x float>, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 4), align 4
337 ; SSE-NEXT: [[TMP4:%.*]] = fptosi <4 x float> [[TMP3]] to <4 x i32>
338 ; SSE-NEXT: store <4 x i32> [[TMP4]], ptr getelementptr inbounds ([16 x i32], ptr @dst32, i32 0, i64 4), align 4
341 ; AVX-LABEL: @fptosi_8f32_8i32(
342 ; AVX-NEXT: [[TMP1:%.*]] = load <8 x float>, ptr @src32, align 4
343 ; AVX-NEXT: [[TMP2:%.*]] = fptosi <8 x float> [[TMP1]] to <8 x i32>
344 ; AVX-NEXT: store <8 x i32> [[TMP2]], ptr @dst32, align 4
347 %a0 = load float, ptr @src32, align 4
348 %a1 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 1), align 4
349 %a2 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 2), align 4
350 %a3 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 3), align 4
351 %a4 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 4), align 4
352 %a5 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 5), align 4
353 %a6 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 6), align 4
354 %a7 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 7), align 4
355 %cvt0 = fptosi float %a0 to i32
356 %cvt1 = fptosi float %a1 to i32
357 %cvt2 = fptosi float %a2 to i32
358 %cvt3 = fptosi float %a3 to i32
359 %cvt4 = fptosi float %a4 to i32
360 %cvt5 = fptosi float %a5 to i32
361 %cvt6 = fptosi float %a6 to i32
362 %cvt7 = fptosi float %a7 to i32
363 store i32 %cvt0, ptr @dst32, align 4
364 store i32 %cvt1, ptr getelementptr inbounds ([16 x i32], ptr @dst32, i32 0, i64 1), align 4
365 store i32 %cvt2, ptr getelementptr inbounds ([16 x i32], ptr @dst32, i32 0, i64 2), align 4
366 store i32 %cvt3, ptr getelementptr inbounds ([16 x i32], ptr @dst32, i32 0, i64 3), align 4
367 store i32 %cvt4, ptr getelementptr inbounds ([16 x i32], ptr @dst32, i32 0, i64 4), align 4
368 store i32 %cvt5, ptr getelementptr inbounds ([16 x i32], ptr @dst32, i32 0, i64 5), align 4
369 store i32 %cvt6, ptr getelementptr inbounds ([16 x i32], ptr @dst32, i32 0, i64 6), align 4
370 store i32 %cvt7, ptr getelementptr inbounds ([16 x i32], ptr @dst32, i32 0, i64 7), align 4
374 define void @fptosi_8f32_8i16() #0 {
375 ; CHECK-LABEL: @fptosi_8f32_8i16(
376 ; CHECK-NEXT: [[TMP1:%.*]] = load <8 x float>, ptr @src32, align 4
377 ; CHECK-NEXT: [[TMP2:%.*]] = fptosi <8 x float> [[TMP1]] to <8 x i16>
378 ; CHECK-NEXT: store <8 x i16> [[TMP2]], ptr @dst16, align 2
379 ; CHECK-NEXT: ret void
381 %a0 = load float, ptr @src32, align 4
382 %a1 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 1), align 4
383 %a2 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 2), align 4
384 %a3 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 3), align 4
385 %a4 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 4), align 4
386 %a5 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 5), align 4
387 %a6 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 6), align 4
388 %a7 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 7), align 4
389 %cvt0 = fptosi float %a0 to i16
390 %cvt1 = fptosi float %a1 to i16
391 %cvt2 = fptosi float %a2 to i16
392 %cvt3 = fptosi float %a3 to i16
393 %cvt4 = fptosi float %a4 to i16
394 %cvt5 = fptosi float %a5 to i16
395 %cvt6 = fptosi float %a6 to i16
396 %cvt7 = fptosi float %a7 to i16
397 store i16 %cvt0, ptr @dst16, align 2
398 store i16 %cvt1, ptr getelementptr inbounds ([32 x i16], ptr @dst16, i32 0, i64 1), align 2
399 store i16 %cvt2, ptr getelementptr inbounds ([32 x i16], ptr @dst16, i32 0, i64 2), align 2
400 store i16 %cvt3, ptr getelementptr inbounds ([32 x i16], ptr @dst16, i32 0, i64 3), align 2
401 store i16 %cvt4, ptr getelementptr inbounds ([32 x i16], ptr @dst16, i32 0, i64 4), align 2
402 store i16 %cvt5, ptr getelementptr inbounds ([32 x i16], ptr @dst16, i32 0, i64 5), align 2
403 store i16 %cvt6, ptr getelementptr inbounds ([32 x i16], ptr @dst16, i32 0, i64 6), align 2
404 store i16 %cvt7, ptr getelementptr inbounds ([32 x i16], ptr @dst16, i32 0, i64 7), align 2
408 define void @fptosi_8f32_8i8() #0 {
409 ; CHECK-LABEL: @fptosi_8f32_8i8(
410 ; CHECK-NEXT: [[TMP1:%.*]] = load <8 x float>, ptr @src32, align 4
411 ; CHECK-NEXT: [[TMP2:%.*]] = fptosi <8 x float> [[TMP1]] to <8 x i8>
412 ; CHECK-NEXT: store <8 x i8> [[TMP2]], ptr @dst8, align 1
413 ; CHECK-NEXT: ret void
415 %a0 = load float, ptr @src32, align 4
416 %a1 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 1), align 4
417 %a2 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 2), align 4
418 %a3 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 3), align 4
419 %a4 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 4), align 4
420 %a5 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 5), align 4
421 %a6 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 6), align 4
422 %a7 = load float, ptr getelementptr inbounds ([16 x float], ptr @src32, i32 0, i64 7), align 4
423 %cvt0 = fptosi float %a0 to i8
424 %cvt1 = fptosi float %a1 to i8
425 %cvt2 = fptosi float %a2 to i8
426 %cvt3 = fptosi float %a3 to i8
427 %cvt4 = fptosi float %a4 to i8
428 %cvt5 = fptosi float %a5 to i8
429 %cvt6 = fptosi float %a6 to i8
430 %cvt7 = fptosi float %a7 to i8
431 store i8 %cvt0, ptr @dst8, align 1
432 store i8 %cvt1, ptr getelementptr inbounds ([64 x i8], ptr @dst8, i32 0, i64 1), align 1
433 store i8 %cvt2, ptr getelementptr inbounds ([64 x i8], ptr @dst8, i32 0, i64 2), align 1
434 store i8 %cvt3, ptr getelementptr inbounds ([64 x i8], ptr @dst8, i32 0, i64 3), align 1
435 store i8 %cvt4, ptr getelementptr inbounds ([64 x i8], ptr @dst8, i32 0, i64 4), align 1
436 store i8 %cvt5, ptr getelementptr inbounds ([64 x i8], ptr @dst8, i32 0, i64 5), align 1
437 store i8 %cvt6, ptr getelementptr inbounds ([64 x i8], ptr @dst8, i32 0, i64 6), align 1
438 store i8 %cvt7, ptr getelementptr inbounds ([64 x i8], ptr @dst8, i32 0, i64 7), align 1
446 define <4 x i32> @fptosi_4xf64_4i32(double %a0, double %a1, double %a2, double %a3) #0 {
447 ; CHECK-LABEL: @fptosi_4xf64_4i32(
448 ; CHECK-NEXT: [[TMP1:%.*]] = insertelement <4 x double> poison, double [[A0:%.*]], i32 0
449 ; CHECK-NEXT: [[TMP2:%.*]] = insertelement <4 x double> [[TMP1]], double [[A1:%.*]], i32 1
450 ; CHECK-NEXT: [[TMP3:%.*]] = insertelement <4 x double> [[TMP2]], double [[A2:%.*]], i32 2
451 ; CHECK-NEXT: [[TMP4:%.*]] = insertelement <4 x double> [[TMP3]], double [[A3:%.*]], i32 3
452 ; CHECK-NEXT: [[TMP5:%.*]] = fptosi <4 x double> [[TMP4]] to <4 x i32>
453 ; CHECK-NEXT: ret <4 x i32> [[TMP5]]
455 %cvt0 = fptosi double %a0 to i32
456 %cvt1 = fptosi double %a1 to i32
457 %cvt2 = fptosi double %a2 to i32
458 %cvt3 = fptosi double %a3 to i32
459 %res0 = insertelement <4 x i32> poison, i32 %cvt0, i32 0
460 %res1 = insertelement <4 x i32> %res0, i32 %cvt1, i32 1
461 %res2 = insertelement <4 x i32> %res1, i32 %cvt2, i32 2
462 %res3 = insertelement <4 x i32> %res2, i32 %cvt3, i32 3
466 define <4 x i32> @fptosi_4xf32_4i32(float %a0, float %a1, float %a2, float %a3) #0 {
467 ; CHECK-LABEL: @fptosi_4xf32_4i32(
468 ; CHECK-NEXT: [[TMP1:%.*]] = insertelement <4 x float> poison, float [[A0:%.*]], i32 0
469 ; CHECK-NEXT: [[TMP2:%.*]] = insertelement <4 x float> [[TMP1]], float [[A1:%.*]], i32 1
470 ; CHECK-NEXT: [[TMP3:%.*]] = insertelement <4 x float> [[TMP2]], float [[A2:%.*]], i32 2
471 ; CHECK-NEXT: [[TMP4:%.*]] = insertelement <4 x float> [[TMP3]], float [[A3:%.*]], i32 3
472 ; CHECK-NEXT: [[TMP5:%.*]] = fptosi <4 x float> [[TMP4]] to <4 x i32>
473 ; CHECK-NEXT: ret <4 x i32> [[TMP5]]
475 %cvt0 = fptosi float %a0 to i32
476 %cvt1 = fptosi float %a1 to i32
477 %cvt2 = fptosi float %a2 to i32
478 %cvt3 = fptosi float %a3 to i32
479 %res0 = insertelement <4 x i32> poison, i32 %cvt0, i32 0
480 %res1 = insertelement <4 x i32> %res0, i32 %cvt1, i32 1
481 %res2 = insertelement <4 x i32> %res1, i32 %cvt2, i32 2
482 %res3 = insertelement <4 x i32> %res2, i32 %cvt3, i32 3
486 attributes #0 = { nounwind }