xref: /llvm-project/llvm/test/Analysis/CostModel/X86/sse-itoi.ll (revision 68c50b111d74afb9489cf97770fa917d0a1c7f77)
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2; RUN: opt < %s -mtriple=x86_64-apple-darwin -passes="print<cost-model>" 2>&1 -disable-output -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,SSE2
3; RUN: opt < %s -mtriple=x86_64-apple-darwin -passes="print<cost-model>" 2>&1 -disable-output -mattr=+sse4.1 | FileCheck %s --check-prefixes=CHECK,SSE41
4
5define void @zext_v4i8_to_v4i64(ptr %a) {
6; SSE2-LABEL: 'zext_v4i8_to_v4i64'
7; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i8>, ptr %a, align 4
8; SSE2-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %2 = zext <4 x i8> %1 to <4 x i64>
9; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> %2, ptr undef, align 4
10; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
11;
12; SSE41-LABEL: 'zext_v4i8_to_v4i64'
13; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i8>, ptr %a, align 4
14; SSE41-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %2 = zext <4 x i8> %1 to <4 x i64>
15; SSE41-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> %2, ptr undef, align 4
16; SSE41-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
17;
18  %1 = load <4 x i8>, ptr %a
19  %2 = zext <4 x i8> %1 to <4 x i64>
20  store <4 x i64> %2, ptr undef, align 4
21  ret void
22}
23
24define void @sext_v4i8_to_v4i64(ptr %a) {
25; SSE2-LABEL: 'sext_v4i8_to_v4i64'
26; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i8>, ptr %a, align 4
27; SSE2-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %2 = sext <4 x i8> %1 to <4 x i64>
28; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> %2, ptr undef, align 4
29; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
30;
31; SSE41-LABEL: 'sext_v4i8_to_v4i64'
32; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i8>, ptr %a, align 4
33; SSE41-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %2 = sext <4 x i8> %1 to <4 x i64>
34; SSE41-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> %2, ptr undef, align 4
35; SSE41-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
36;
37  %1 = load <4 x i8>, ptr %a
38  %2 = sext <4 x i8> %1 to <4 x i64>
39  store <4 x i64> %2, ptr undef, align 4
40  ret void
41}
42
43define void @zext_v4i16_to_v4i64(ptr %a) {
44; SSE2-LABEL: 'zext_v4i16_to_v4i64'
45; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i16>, ptr %a, align 8
46; SSE2-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %2 = zext <4 x i16> %1 to <4 x i64>
47; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> %2, ptr undef, align 4
48; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
49;
50; SSE41-LABEL: 'zext_v4i16_to_v4i64'
51; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i16>, ptr %a, align 8
52; SSE41-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %2 = zext <4 x i16> %1 to <4 x i64>
53; SSE41-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> %2, ptr undef, align 4
54; SSE41-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
55;
56  %1 = load <4 x i16>, ptr %a
57  %2 = zext <4 x i16> %1 to <4 x i64>
58  store <4 x i64> %2, ptr undef, align 4
59  ret void
60}
61
62define void @sext_v4i16_to_v4i64(ptr %a) {
63; SSE2-LABEL: 'sext_v4i16_to_v4i64'
64; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i16>, ptr %a, align 8
65; SSE2-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %2 = sext <4 x i16> %1 to <4 x i64>
66; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> %2, ptr undef, align 4
67; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
68;
69; SSE41-LABEL: 'sext_v4i16_to_v4i64'
70; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i16>, ptr %a, align 8
71; SSE41-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %2 = sext <4 x i16> %1 to <4 x i64>
72; SSE41-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> %2, ptr undef, align 4
73; SSE41-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
74;
75  %1 = load <4 x i16>, ptr %a
76  %2 = sext <4 x i16> %1 to <4 x i64>
77  store <4 x i64> %2, ptr undef, align 4
78  ret void
79}
80
81
82define void @zext_v4i32_to_v4i64(ptr %a) {
83; CHECK-LABEL: 'zext_v4i32_to_v4i64'
84; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i32>, ptr %a, align 16
85; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %2 = zext <4 x i32> %1 to <4 x i64>
86; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> %2, ptr undef, align 4
87; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
88;
89  %1 = load <4 x i32>, ptr %a
90  %2 = zext <4 x i32> %1 to <4 x i64>
91  store <4 x i64> %2, ptr undef, align 4
92  ret void
93}
94
95define void @sext_v4i32_to_v4i64(ptr %a) {
96; SSE2-LABEL: 'sext_v4i32_to_v4i64'
97; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i32>, ptr %a, align 16
98; SSE2-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %2 = sext <4 x i32> %1 to <4 x i64>
99; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> %2, ptr undef, align 4
100; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
101;
102; SSE41-LABEL: 'sext_v4i32_to_v4i64'
103; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i32>, ptr %a, align 16
104; SSE41-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %2 = sext <4 x i32> %1 to <4 x i64>
105; SSE41-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: store <4 x i64> %2, ptr undef, align 4
106; SSE41-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
107;
108  %1 = load <4 x i32>, ptr %a
109  %2 = sext <4 x i32> %1 to <4 x i64>
110  store <4 x i64> %2, ptr undef, align 4
111  ret void
112}
113
114define void @zext_v16i16_to_v16i32(ptr %a) {
115; CHECK-LABEL: 'zext_v16i16_to_v16i32'
116; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %1 = load <16 x i16>, ptr %a, align 32
117; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %2 = zext <16 x i16> %1 to <16 x i32>
118; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: store <16 x i32> %2, ptr undef, align 4
119; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
120;
121  %1 = load <16 x i16>, ptr %a
122  %2 = zext <16 x i16> %1 to <16 x i32>
123  store <16 x i32> %2, ptr undef, align 4
124  ret void
125}
126
127define void @sext_v16i16_to_v16i32(ptr %a) {
128; SSE2-LABEL: 'sext_v16i16_to_v16i32'
129; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %1 = load <16 x i16>, ptr %a, align 32
130; SSE2-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %2 = sext <16 x i16> %1 to <16 x i32>
131; SSE2-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: store <16 x i32> %2, ptr undef, align 4
132; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
133;
134; SSE41-LABEL: 'sext_v16i16_to_v16i32'
135; SSE41-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %1 = load <16 x i16>, ptr %a, align 32
136; SSE41-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %2 = sext <16 x i16> %1 to <16 x i32>
137; SSE41-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: store <16 x i32> %2, ptr undef, align 4
138; SSE41-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
139;
140  %1 = load <16 x i16>, ptr %a
141  %2 = sext <16 x i16> %1 to <16 x i32>
142  store <16 x i32> %2, ptr undef, align 4
143  ret void
144}
145
146define void @zext_v8i16_to_v8i32(ptr %a) {
147; CHECK-LABEL: 'zext_v8i16_to_v8i32'
148; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <8 x i16>, ptr %a, align 16
149; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %2 = zext <8 x i16> %1 to <8 x i32>
150; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: store <8 x i32> %2, ptr undef, align 4
151; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
152;
153  %1 = load <8 x i16>, ptr %a
154  %2 = zext <8 x i16> %1 to <8 x i32>
155  store <8 x i32> %2, ptr undef, align 4
156  ret void
157}
158
159define void @sext_v8i16_to_v8i32(ptr %a) {
160; SSE2-LABEL: 'sext_v8i16_to_v8i32'
161; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <8 x i16>, ptr %a, align 16
162; SSE2-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %2 = sext <8 x i16> %1 to <8 x i32>
163; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: store <8 x i32> %2, ptr undef, align 4
164; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
165;
166; SSE41-LABEL: 'sext_v8i16_to_v8i32'
167; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <8 x i16>, ptr %a, align 16
168; SSE41-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %2 = sext <8 x i16> %1 to <8 x i32>
169; SSE41-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: store <8 x i32> %2, ptr undef, align 4
170; SSE41-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
171;
172  %1 = load <8 x i16>, ptr %a
173  %2 = sext <8 x i16> %1 to <8 x i32>
174  store <8 x i32> %2, ptr undef, align 4
175  ret void
176}
177
178define void @zext_v4i16_to_v4i32(ptr %a) {
179; CHECK-LABEL: 'zext_v4i16_to_v4i32'
180; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i16>, ptr %a, align 8
181; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %2 = zext <4 x i16> %1 to <4 x i32>
182; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> %2, ptr undef, align 4
183; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
184;
185  %1 = load <4 x i16>, ptr %a
186  %2 = zext <4 x i16> %1 to <4 x i32>
187  store <4 x i32> %2, ptr undef, align 4
188  ret void
189}
190
191define void @sext_v4i16_to_v4i32(ptr %a) {
192; SSE2-LABEL: 'sext_v4i16_to_v4i32'
193; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i16>, ptr %a, align 8
194; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %2 = sext <4 x i16> %1 to <4 x i32>
195; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> %2, ptr undef, align 4
196; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
197;
198; SSE41-LABEL: 'sext_v4i16_to_v4i32'
199; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i16>, ptr %a, align 8
200; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %2 = sext <4 x i16> %1 to <4 x i32>
201; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> %2, ptr undef, align 4
202; SSE41-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
203;
204  %1 = load <4 x i16>, ptr %a
205  %2 = sext <4 x i16> %1 to <4 x i32>
206  store <4 x i32> %2, ptr undef, align 4
207  ret void
208}
209
210define void @zext_v16i8_to_v16i32(ptr %a) {
211; SSE2-LABEL: 'zext_v16i8_to_v16i32'
212; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <16 x i8>, ptr %a, align 16
213; SSE2-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %2 = zext <16 x i8> %1 to <16 x i32>
214; SSE2-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: store <16 x i32> %2, ptr undef, align 4
215; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
216;
217; SSE41-LABEL: 'zext_v16i8_to_v16i32'
218; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <16 x i8>, ptr %a, align 16
219; SSE41-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %2 = zext <16 x i8> %1 to <16 x i32>
220; SSE41-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: store <16 x i32> %2, ptr undef, align 4
221; SSE41-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
222;
223  %1 = load <16 x i8>, ptr %a
224  %2 = zext <16 x i8> %1 to <16 x i32>
225  store <16 x i32> %2, ptr undef, align 4
226  ret void
227}
228
229define void @sext_v16i8_to_v16i32(ptr %a) {
230; SSE2-LABEL: 'sext_v16i8_to_v16i32'
231; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <16 x i8>, ptr %a, align 16
232; SSE2-NEXT:  Cost Model: Found an estimated cost of 12 for instruction: %2 = sext <16 x i8> %1 to <16 x i32>
233; SSE2-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: store <16 x i32> %2, ptr undef, align 4
234; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
235;
236; SSE41-LABEL: 'sext_v16i8_to_v16i32'
237; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <16 x i8>, ptr %a, align 16
238; SSE41-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %2 = sext <16 x i8> %1 to <16 x i32>
239; SSE41-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: store <16 x i32> %2, ptr undef, align 4
240; SSE41-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
241;
242  %1 = load <16 x i8>, ptr %a
243  %2 = sext <16 x i8> %1 to <16 x i32>
244  store <16 x i32> %2, ptr undef, align 4
245  ret void
246}
247
248define void @zext_v8i8_to_v8i32(ptr %a) {
249; SSE2-LABEL: 'zext_v8i8_to_v8i32'
250; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <8 x i8>, ptr %a, align 8
251; SSE2-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %2 = zext <8 x i8> %1 to <8 x i32>
252; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: store <8 x i32> %2, ptr undef, align 4
253; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
254;
255; SSE41-LABEL: 'zext_v8i8_to_v8i32'
256; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <8 x i8>, ptr %a, align 8
257; SSE41-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %2 = zext <8 x i8> %1 to <8 x i32>
258; SSE41-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: store <8 x i32> %2, ptr undef, align 4
259; SSE41-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
260;
261  %1 = load <8 x i8>, ptr %a
262  %2 = zext <8 x i8> %1 to <8 x i32>
263  store <8 x i32> %2, ptr undef, align 4
264  ret void
265}
266
267define void @sext_v8i8_to_v8i32(ptr %a) {
268; SSE2-LABEL: 'sext_v8i8_to_v8i32'
269; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <8 x i8>, ptr %a, align 8
270; SSE2-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %2 = sext <8 x i8> %1 to <8 x i32>
271; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: store <8 x i32> %2, ptr undef, align 4
272; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
273;
274; SSE41-LABEL: 'sext_v8i8_to_v8i32'
275; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <8 x i8>, ptr %a, align 8
276; SSE41-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %2 = sext <8 x i8> %1 to <8 x i32>
277; SSE41-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: store <8 x i32> %2, ptr undef, align 4
278; SSE41-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
279;
280  %1 = load <8 x i8>, ptr %a
281  %2 = sext <8 x i8> %1 to <8 x i32>
282  store <8 x i32> %2, ptr undef, align 4
283  ret void
284}
285
286define void @zext_v4i8_to_v4i32(ptr %a) {
287; SSE2-LABEL: 'zext_v4i8_to_v4i32'
288; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i8>, ptr %a, align 4
289; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %2 = zext <4 x i8> %1 to <4 x i32>
290; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> %2, ptr undef, align 4
291; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
292;
293; SSE41-LABEL: 'zext_v4i8_to_v4i32'
294; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i8>, ptr %a, align 4
295; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %2 = zext <4 x i8> %1 to <4 x i32>
296; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> %2, ptr undef, align 4
297; SSE41-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
298;
299  %1 = load <4 x i8>, ptr %a
300  %2 = zext <4 x i8> %1 to <4 x i32>
301  store <4 x i32> %2, ptr undef, align 4
302  ret void
303}
304
305define void @sext_v4i8_to_v4i32(ptr %a) {
306; SSE2-LABEL: 'sext_v4i8_to_v4i32'
307; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i8>, ptr %a, align 4
308; SSE2-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %2 = sext <4 x i8> %1 to <4 x i32>
309; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> %2, ptr undef, align 4
310; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
311;
312; SSE41-LABEL: 'sext_v4i8_to_v4i32'
313; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i8>, ptr %a, align 4
314; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %2 = sext <4 x i8> %1 to <4 x i32>
315; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store <4 x i32> %2, ptr undef, align 4
316; SSE41-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
317;
318  %1 = load <4 x i8>, ptr %a
319  %2 = sext <4 x i8> %1 to <4 x i32>
320  store <4 x i32> %2, ptr undef, align 4
321  ret void
322}
323
324define void @zext_v16i8_to_v16i16(ptr %a) {
325; CHECK-LABEL: 'zext_v16i8_to_v16i16'
326; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <16 x i8>, ptr %a, align 16
327; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %2 = zext <16 x i8> %1 to <16 x i16>
328; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: store <16 x i16> %2, ptr undef, align 4
329; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
330;
331  %1 = load <16 x i8>, ptr %a
332  %2 = zext <16 x i8> %1 to <16 x i16>
333  store <16 x i16> %2, ptr undef, align 4
334  ret void
335}
336
337define void @sext_v16i8_to_v16i16(ptr %a) {
338; SSE2-LABEL: 'sext_v16i8_to_v16i16'
339; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <16 x i8>, ptr %a, align 16
340; SSE2-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %2 = sext <16 x i8> %1 to <16 x i16>
341; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: store <16 x i16> %2, ptr undef, align 4
342; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
343;
344; SSE41-LABEL: 'sext_v16i8_to_v16i16'
345; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <16 x i8>, ptr %a, align 16
346; SSE41-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %2 = sext <16 x i8> %1 to <16 x i16>
347; SSE41-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: store <16 x i16> %2, ptr undef, align 4
348; SSE41-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
349;
350  %1 = load <16 x i8>, ptr %a
351  %2 = sext <16 x i8> %1 to <16 x i16>
352  store <16 x i16> %2, ptr undef, align 4
353  ret void
354}
355
356define void @zext_v8i8_to_v8i16(ptr %a) {
357; CHECK-LABEL: 'zext_v8i8_to_v8i16'
358; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <8 x i8>, ptr %a, align 8
359; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %2 = zext <8 x i8> %1 to <8 x i16>
360; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store <8 x i16> %2, ptr undef, align 4
361; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
362;
363  %1 = load <8 x i8>, ptr %a
364  %2 = zext <8 x i8> %1 to <8 x i16>
365  store <8 x i16> %2, ptr undef, align 4
366  ret void
367}
368
369define void @sext_v8i8_to_v8i16(ptr %a) {
370; SSE2-LABEL: 'sext_v8i8_to_v8i16'
371; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <8 x i8>, ptr %a, align 8
372; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %2 = sext <8 x i8> %1 to <8 x i16>
373; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store <8 x i16> %2, ptr undef, align 4
374; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
375;
376; SSE41-LABEL: 'sext_v8i8_to_v8i16'
377; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <8 x i8>, ptr %a, align 8
378; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %2 = sext <8 x i8> %1 to <8 x i16>
379; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store <8 x i16> %2, ptr undef, align 4
380; SSE41-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
381;
382  %1 = load <8 x i8>, ptr %a
383  %2 = sext <8 x i8> %1 to <8 x i16>
384  store <8 x i16> %2, ptr undef, align 4
385  ret void
386}
387
388define void @zext_v4i8_to_v4i16(ptr %a) {
389; CHECK-LABEL: 'zext_v4i8_to_v4i16'
390; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i8>, ptr %a, align 4
391; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %2 = zext <4 x i8> %1 to <4 x i16>
392; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store <4 x i16> %2, ptr undef, align 4
393; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
394;
395  %1 = load <4 x i8>, ptr %a
396  %2 = zext <4 x i8> %1 to <4 x i16>
397  store <4 x i16> %2, ptr undef, align 4
398  ret void
399}
400
401define void @sext_v4i8_to_v4i16(ptr %a) {
402; SSE2-LABEL: 'sext_v4i8_to_v4i16'
403; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i8>, ptr %a, align 4
404; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %2 = sext <4 x i8> %1 to <4 x i16>
405; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store <4 x i16> %2, ptr undef, align 4
406; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
407;
408; SSE41-LABEL: 'sext_v4i8_to_v4i16'
409; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i8>, ptr %a, align 4
410; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %2 = sext <4 x i8> %1 to <4 x i16>
411; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store <4 x i16> %2, ptr undef, align 4
412; SSE41-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
413;
414  %1 = load <4 x i8>, ptr %a
415  %2 = sext <4 x i8> %1 to <4 x i16>
416  store <4 x i16> %2, ptr undef, align 4
417  ret void
418}
419
420define void @truncate_v16i32_to_v16i16(ptr %a) {
421; CHECK-LABEL: 'truncate_v16i32_to_v16i16'
422; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %1 = load <16 x i32>, ptr %a, align 64
423; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %2 = trunc <16 x i32> %1 to <16 x i16>
424; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: store <16 x i16> %2, ptr undef, align 4
425; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
426;
427  %1 = load <16 x i32>, ptr %a
428  %2 = trunc <16 x i32> %1 to <16 x i16>
429  store <16 x i16> %2, ptr undef, align 4
430  ret void
431}
432
433define void @truncate_v8i32_to_v8i16(ptr %a) {
434; CHECK-LABEL: 'truncate_v8i32_to_v8i16'
435; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %1 = load <8 x i32>, ptr %a, align 32
436; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %2 = trunc <8 x i32> %1 to <8 x i16>
437; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store <8 x i16> %2, ptr undef, align 4
438; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
439;
440  %1 = load <8 x i32>, ptr %a
441  %2 = trunc <8 x i32> %1 to <8 x i16>
442  store <8 x i16> %2, ptr undef, align 4
443  ret void
444}
445
446define void @truncate_v4i32_to_v4i16(ptr %a) {
447; SSE2-LABEL: 'truncate_v4i32_to_v4i16'
448; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i32>, ptr %a, align 16
449; SSE2-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %2 = trunc <4 x i32> %1 to <4 x i16>
450; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store <4 x i16> %2, ptr undef, align 4
451; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
452;
453; SSE41-LABEL: 'truncate_v4i32_to_v4i16'
454; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i32>, ptr %a, align 16
455; SSE41-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %2 = trunc <4 x i32> %1 to <4 x i16>
456; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store <4 x i16> %2, ptr undef, align 4
457; SSE41-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
458;
459  %1 = load <4 x i32>, ptr %a
460  %2 = trunc <4 x i32> %1 to <4 x i16>
461  store <4 x i16> %2, ptr undef, align 4
462  ret void
463}
464
465define void @truncate_v16i32_to_v16i8(ptr %a) {
466; CHECK-LABEL: 'truncate_v16i32_to_v16i8'
467; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %1 = load <16 x i32>, ptr %a, align 64
468; CHECK-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %2 = trunc <16 x i32> %1 to <16 x i8>
469; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store <16 x i8> %2, ptr undef, align 4
470; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
471;
472  %1 = load <16 x i32>, ptr %a
473  %2 = trunc <16 x i32> %1 to <16 x i8>
474  store <16 x i8> %2, ptr undef, align 4
475  ret void
476}
477
478define void @truncate_v8i32_to_v8i8(ptr %a) {
479; SSE2-LABEL: 'truncate_v8i32_to_v8i8'
480; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %1 = load <8 x i32>, ptr %a, align 32
481; SSE2-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %2 = trunc <8 x i32> %1 to <8 x i8>
482; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store <8 x i8> %2, ptr undef, align 4
483; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
484;
485; SSE41-LABEL: 'truncate_v8i32_to_v8i8'
486; SSE41-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %1 = load <8 x i32>, ptr %a, align 32
487; SSE41-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %2 = trunc <8 x i32> %1 to <8 x i8>
488; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store <8 x i8> %2, ptr undef, align 4
489; SSE41-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
490;
491  %1 = load <8 x i32>, ptr %a
492  %2 = trunc <8 x i32> %1 to <8 x i8>
493  store <8 x i8> %2, ptr undef, align 4
494  ret void
495}
496
497define void @truncate_v4i32_to_v4i8(ptr %a) {
498; SSE2-LABEL: 'truncate_v4i32_to_v4i8'
499; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i32>, ptr %a, align 16
500; SSE2-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %2 = trunc <4 x i32> %1 to <4 x i8>
501; SSE2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store <4 x i8> %2, ptr undef, align 4
502; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
503;
504; SSE41-LABEL: 'truncate_v4i32_to_v4i8'
505; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i32>, ptr %a, align 16
506; SSE41-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %2 = trunc <4 x i32> %1 to <4 x i8>
507; SSE41-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store <4 x i8> %2, ptr undef, align 4
508; SSE41-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
509;
510  %1 = load <4 x i32>, ptr %a
511  %2 = trunc <4 x i32> %1 to <4 x i8>
512  store <4 x i8> %2, ptr undef, align 4
513  ret void
514}
515
516define void @truncate_v16i16_to_v16i8(ptr %a) {
517; CHECK-LABEL: 'truncate_v16i16_to_v16i8'
518; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %1 = load <16 x i16>, ptr %a, align 32
519; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %2 = trunc <16 x i16> %1 to <16 x i8>
520; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store <16 x i8> %2, ptr undef, align 4
521; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
522;
523  %1 = load <16 x i16>, ptr %a
524  %2 = trunc <16 x i16> %1 to <16 x i8>
525  store <16 x i8> %2, ptr undef, align 4
526  ret void
527}
528
529define void @truncate_v8i16_to_v8i8(ptr %a) {
530; CHECK-LABEL: 'truncate_v8i16_to_v8i8'
531; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <8 x i16>, ptr %a, align 16
532; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %2 = trunc <8 x i16> %1 to <8 x i8>
533; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store <8 x i8> %2, ptr undef, align 4
534; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
535;
536  %1 = load <8 x i16>, ptr %a
537  %2 = trunc <8 x i16> %1 to <8 x i8>
538  store <8 x i8> %2, ptr undef, align 4
539  ret void
540}
541
542define void @truncate_v4i16_to_v4i8(ptr %a) {
543; CHECK-LABEL: 'truncate_v4i16_to_v4i8'
544; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %1 = load <4 x i16>, ptr %a, align 8
545; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %2 = trunc <4 x i16> %1 to <4 x i8>
546; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store <4 x i8> %2, ptr undef, align 4
547; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
548;
549  %1 = load <4 x i16>, ptr %a
550  %2 = trunc <4 x i16> %1 to <4 x i8>
551  store <4 x i8> %2, ptr undef, align 4
552  ret void
553}
554