1 ; RUN: opt -cost-model -analyze -mtriple aarch64-linux-gnu -mattr=+sve -o - -S < %s | FileCheck %s
3 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
4 target triple = "aarch64-unknown-linux-gnu"
6 define void @sve-fptoi() {
7 ; CHECK-LABEL: 'sve-fptoi'
8 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %nv1f16_to_si8 = fptosi <vscale x 1 x half> undef to <vscale x 1 x i8>
9 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %nv1f16_to_ui8 = fptoui <vscale x 1 x half> undef to <vscale x 1 x i8>
10 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %nv1f16_to_si32 = fptosi <vscale x 1 x half> undef to <vscale x 1 x i32>
11 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %nv1f16_to_ui32 = fptoui <vscale x 1 x half> undef to <vscale x 1 x i32>
12 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %nv1f16_to_si64 = fptosi <vscale x 1 x half> undef to <vscale x 1 x i64>
13 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %nv1f16_to_ui64 = fptoui <vscale x 1 x half> undef to <vscale x 1 x i64>
14 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %nv1f32_to_si8 = fptosi <vscale x 1 x float> undef to <vscale x 1 x i8>
15 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %nv1f32_to_ui8 = fptoui <vscale x 1 x float> undef to <vscale x 1 x i8>
16 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %nv1f32_to_si16 = fptosi <vscale x 1 x float> undef to <vscale x 1 x i16>
17 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %nv1f32_to_ui16 = fptoui <vscale x 1 x float> undef to <vscale x 1 x i16>
18 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %nv1f32_to_si64 = fptosi <vscale x 1 x float> undef to <vscale x 1 x i64>
19 ; CHECK-NEXT: Cost Model: Invalid cost for instruction: %nv1f32_to_ui64 = fptoui <vscale x 1 x float> undef to <vscale x 1 x i64>
20 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv1f64_to_si8 = fptosi <vscale x 1 x double> undef to <vscale x 1 x i8>
21 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv1f64_to_ui8 = fptoui <vscale x 1 x double> undef to <vscale x 1 x i8>
22 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv1f64_to_si16 = fptosi <vscale x 1 x double> undef to <vscale x 1 x i16>
23 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv1f64_to_ui16 = fptoui <vscale x 1 x double> undef to <vscale x 1 x i16>
24 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv1f64_to_si32 = fptosi <vscale x 1 x double> undef to <vscale x 1 x i32>
25 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv1f64_to_ui32 = fptoui <vscale x 1 x double> undef to <vscale x 1 x i32>
26 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f16_to_si8 = fptosi <vscale x 2 x half> undef to <vscale x 2 x i8>
27 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f16_to_ui8 = fptoui <vscale x 2 x half> undef to <vscale x 2 x i8>
28 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f16_to_si32 = fptosi <vscale x 2 x half> undef to <vscale x 2 x i32>
29 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f16_to_ui32 = fptoui <vscale x 2 x half> undef to <vscale x 2 x i32>
30 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f16_to_si64 = fptosi <vscale x 2 x half> undef to <vscale x 2 x i64>
31 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f16_to_ui64 = fptoui <vscale x 2 x half> undef to <vscale x 2 x i64>
32 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f32_to_si8 = fptosi <vscale x 2 x float> undef to <vscale x 2 x i8>
33 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f32_to_ui8 = fptoui <vscale x 2 x float> undef to <vscale x 2 x i8>
34 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f32_to_si16 = fptosi <vscale x 2 x float> undef to <vscale x 2 x i16>
35 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f32_to_ui16 = fptoui <vscale x 2 x float> undef to <vscale x 2 x i16>
36 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f32_to_si64 = fptosi <vscale x 2 x float> undef to <vscale x 2 x i64>
37 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f32_to_ui64 = fptoui <vscale x 2 x float> undef to <vscale x 2 x i64>
38 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f64_to_si8 = fptosi <vscale x 2 x double> undef to <vscale x 2 x i8>
39 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f64_to_ui8 = fptoui <vscale x 2 x double> undef to <vscale x 2 x i8>
40 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f64_to_si16 = fptosi <vscale x 2 x double> undef to <vscale x 2 x i16>
41 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f64_to_ui16 = fptoui <vscale x 2 x double> undef to <vscale x 2 x i16>
42 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f64_to_si32 = fptosi <vscale x 2 x double> undef to <vscale x 2 x i32>
43 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv2f64_to_ui32 = fptoui <vscale x 2 x double> undef to <vscale x 2 x i32>
44 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv4f16_to_si8 = fptosi <vscale x 4 x half> undef to <vscale x 4 x i8>
45 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv4f16_to_ui8 = fptoui <vscale x 4 x half> undef to <vscale x 4 x i8>
46 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv4f16_to_si32 = fptosi <vscale x 4 x half> undef to <vscale x 4 x i32>
47 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv4f16_to_ui32 = fptoui <vscale x 4 x half> undef to <vscale x 4 x i32>
48 ; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %nv4f16_to_si64 = fptosi <vscale x 4 x half> undef to <vscale x 4 x i64>
49 ; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %nv4f16_to_ui64 = fptoui <vscale x 4 x half> undef to <vscale x 4 x i64>
50 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv4f32_to_si8 = fptosi <vscale x 4 x float> undef to <vscale x 4 x i8>
51 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv4f32_to_ui8 = fptoui <vscale x 4 x float> undef to <vscale x 4 x i8>
52 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv4f32_to_si16 = fptosi <vscale x 4 x float> undef to <vscale x 4 x i16>
53 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv4f32_to_ui16 = fptoui <vscale x 4 x float> undef to <vscale x 4 x i16>
54 ; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %nv4f32_to_si64 = fptosi <vscale x 4 x float> undef to <vscale x 4 x i64>
55 ; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %nv4f32_to_ui64 = fptoui <vscale x 4 x float> undef to <vscale x 4 x i64>
56 ; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nv4f64_to_si8 = fptosi <vscale x 4 x double> undef to <vscale x 4 x i8>
57 ; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nv4f64_to_ui8 = fptoui <vscale x 4 x double> undef to <vscale x 4 x i8>
58 ; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nv4f64_to_si16 = fptosi <vscale x 4 x double> undef to <vscale x 4 x i16>
59 ; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nv4f64_to_ui16 = fptoui <vscale x 4 x double> undef to <vscale x 4 x i16>
60 ; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nv4f64_to_si32 = fptosi <vscale x 4 x double> undef to <vscale x 4 x i32>
61 ; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nv4f64_to_ui32 = fptoui <vscale x 4 x double> undef to <vscale x 4 x i32>
62 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv8f16_to_si8 = fptosi <vscale x 8 x half> undef to <vscale x 8 x i8>
63 ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %nv8f16_to_ui8 = fptoui <vscale x 8 x half> undef to <vscale x 8 x i8>
64 ; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %nv8f16_to_si32 = fptosi <vscale x 8 x half> undef to <vscale x 8 x i32>
65 ; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %nv8f16_to_ui32 = fptoui <vscale x 8 x half> undef to <vscale x 8 x i32>
66 ; CHECK-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %nv8f16_to_si64 = fptosi <vscale x 8 x half> undef to <vscale x 8 x i64>
67 ; CHECK-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %nv8f16_to_ui64 = fptoui <vscale x 8 x half> undef to <vscale x 8 x i64>
68 ; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nv8f32_to_si8 = fptosi <vscale x 8 x float> undef to <vscale x 8 x i8>
69 ; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nv8f32_to_ui8 = fptoui <vscale x 8 x float> undef to <vscale x 8 x i8>
70 ; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nv8f32_to_si16 = fptosi <vscale x 8 x float> undef to <vscale x 8 x i16>
71 ; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %nv8f32_to_ui16 = fptoui <vscale x 8 x float> undef to <vscale x 8 x i16>
72 ; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %nv8f32_to_si64 = fptosi <vscale x 8 x float> undef to <vscale x 8 x i64>
73 ; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %nv8f32_to_ui64 = fptoui <vscale x 8 x float> undef to <vscale x 8 x i64>
74 ; CHECK-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %nv8f64_to_si8 = fptosi <vscale x 8 x double> undef to <vscale x 8 x i8>
75 ; CHECK-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %nv8f64_to_ui8 = fptoui <vscale x 8 x double> undef to <vscale x 8 x i8>
76 ; CHECK-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %nv8f64_to_si16 = fptosi <vscale x 8 x double> undef to <vscale x 8 x i16>
77 ; CHECK-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %nv8f64_to_ui16 = fptoui <vscale x 8 x double> undef to <vscale x 8 x i16>
78 ; CHECK-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %nv8f64_to_si32 = fptosi <vscale x 8 x double> undef to <vscale x 8 x i32>
79 ; CHECK-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %nv8f64_to_ui32 = fptoui <vscale x 8 x double> undef to <vscale x 8 x i32>
80 %nv1f16_to_si8 = fptosi <vscale x 1 x half> undef to <vscale x 1 x i8>
81 %nv1f16_to_ui8 = fptoui <vscale x 1 x half> undef to <vscale x 1 x i8>
82 %nv1f16_to_si32 = fptosi <vscale x 1 x half> undef to <vscale x 1 x i32>
83 %nv1f16_to_ui32 = fptoui <vscale x 1 x half> undef to <vscale x 1 x i32>
84 %nv1f16_to_si64 = fptosi <vscale x 1 x half> undef to <vscale x 1 x i64>
85 %nv1f16_to_ui64 = fptoui <vscale x 1 x half> undef to <vscale x 1 x i64>
87 %nv1f32_to_si8 = fptosi <vscale x 1 x float> undef to <vscale x 1 x i8>
88 %nv1f32_to_ui8 = fptoui <vscale x 1 x float> undef to <vscale x 1 x i8>
89 %nv1f32_to_si16 = fptosi <vscale x 1 x float> undef to <vscale x 1 x i16>
90 %nv1f32_to_ui16 = fptoui <vscale x 1 x float> undef to <vscale x 1 x i16>
91 %nv1f32_to_si64 = fptosi <vscale x 1 x float> undef to <vscale x 1 x i64>
92 %nv1f32_to_ui64 = fptoui <vscale x 1 x float> undef to <vscale x 1 x i64>
94 %nv1f64_to_si8 = fptosi <vscale x 1 x double> undef to <vscale x 1 x i8>
95 %nv1f64_to_ui8 = fptoui <vscale x 1 x double> undef to <vscale x 1 x i8>
96 %nv1f64_to_si16 = fptosi <vscale x 1 x double> undef to <vscale x 1 x i16>
97 %nv1f64_to_ui16 = fptoui <vscale x 1 x double> undef to <vscale x 1 x i16>
98 %nv1f64_to_si32 = fptosi <vscale x 1 x double> undef to <vscale x 1 x i32>
99 %nv1f64_to_ui32 = fptoui <vscale x 1 x double> undef to <vscale x 1 x i32>
101 %nv2f16_to_si8 = fptosi <vscale x 2 x half> undef to <vscale x 2 x i8>
102 %nv2f16_to_ui8 = fptoui <vscale x 2 x half> undef to <vscale x 2 x i8>
103 %nv2f16_to_si32 = fptosi <vscale x 2 x half> undef to <vscale x 2 x i32>
104 %nv2f16_to_ui32 = fptoui <vscale x 2 x half> undef to <vscale x 2 x i32>
105 %nv2f16_to_si64 = fptosi <vscale x 2 x half> undef to <vscale x 2 x i64>
106 %nv2f16_to_ui64 = fptoui <vscale x 2 x half> undef to <vscale x 2 x i64>
108 %nv2f32_to_si8 = fptosi <vscale x 2 x float> undef to <vscale x 2 x i8>
109 %nv2f32_to_ui8 = fptoui <vscale x 2 x float> undef to <vscale x 2 x i8>
110 %nv2f32_to_si16 = fptosi <vscale x 2 x float> undef to <vscale x 2 x i16>
111 %nv2f32_to_ui16 = fptoui <vscale x 2 x float> undef to <vscale x 2 x i16>
112 %nv2f32_to_si64 = fptosi <vscale x 2 x float> undef to <vscale x 2 x i64>
113 %nv2f32_to_ui64 = fptoui <vscale x 2 x float> undef to <vscale x 2 x i64>
115 %nv2f64_to_si8 = fptosi <vscale x 2 x double> undef to <vscale x 2 x i8>
116 %nv2f64_to_ui8 = fptoui <vscale x 2 x double> undef to <vscale x 2 x i8>
117 %nv2f64_to_si16 = fptosi <vscale x 2 x double> undef to <vscale x 2 x i16>
118 %nv2f64_to_ui16 = fptoui <vscale x 2 x double> undef to <vscale x 2 x i16>
119 %nv2f64_to_si32 = fptosi <vscale x 2 x double> undef to <vscale x 2 x i32>
120 %nv2f64_to_ui32 = fptoui <vscale x 2 x double> undef to <vscale x 2 x i32>
122 %nv4f16_to_si8 = fptosi <vscale x 4 x half> undef to <vscale x 4 x i8>
123 %nv4f16_to_ui8 = fptoui <vscale x 4 x half> undef to <vscale x 4 x i8>
124 %nv4f16_to_si32 = fptosi <vscale x 4 x half> undef to <vscale x 4 x i32>
125 %nv4f16_to_ui32 = fptoui <vscale x 4 x half> undef to <vscale x 4 x i32>
126 %nv4f16_to_si64 = fptosi <vscale x 4 x half> undef to <vscale x 4 x i64>
127 %nv4f16_to_ui64 = fptoui <vscale x 4 x half> undef to <vscale x 4 x i64>
129 %nv4f32_to_si8 = fptosi <vscale x 4 x float> undef to <vscale x 4 x i8>
130 %nv4f32_to_ui8 = fptoui <vscale x 4 x float> undef to <vscale x 4 x i8>
131 %nv4f32_to_si16 = fptosi <vscale x 4 x float> undef to <vscale x 4 x i16>
132 %nv4f32_to_ui16 = fptoui <vscale x 4 x float> undef to <vscale x 4 x i16>
133 %nv4f32_to_si64 = fptosi <vscale x 4 x float> undef to <vscale x 4 x i64>
134 %nv4f32_to_ui64 = fptoui <vscale x 4 x float> undef to <vscale x 4 x i64>
136 %nv4f64_to_si8 = fptosi <vscale x 4 x double> undef to <vscale x 4 x i8>
137 %nv4f64_to_ui8 = fptoui <vscale x 4 x double> undef to <vscale x 4 x i8>
138 %nv4f64_to_si16 = fptosi <vscale x 4 x double> undef to <vscale x 4 x i16>
139 %nv4f64_to_ui16 = fptoui <vscale x 4 x double> undef to <vscale x 4 x i16>
140 %nv4f64_to_si32 = fptosi <vscale x 4 x double> undef to <vscale x 4 x i32>
141 %nv4f64_to_ui32 = fptoui <vscale x 4 x double> undef to <vscale x 4 x i32>
143 %nv8f16_to_si8 = fptosi <vscale x 8 x half> undef to <vscale x 8 x i8>
144 %nv8f16_to_ui8 = fptoui <vscale x 8 x half> undef to <vscale x 8 x i8>
145 %nv8f16_to_si32 = fptosi <vscale x 8 x half> undef to <vscale x 8 x i32>
146 %nv8f16_to_ui32 = fptoui <vscale x 8 x half> undef to <vscale x 8 x i32>
147 %nv8f16_to_si64 = fptosi <vscale x 8 x half> undef to <vscale x 8 x i64>
148 %nv8f16_to_ui64 = fptoui <vscale x 8 x half> undef to <vscale x 8 x i64>
150 %nv8f32_to_si8 = fptosi <vscale x 8 x float> undef to <vscale x 8 x i8>
151 %nv8f32_to_ui8 = fptoui <vscale x 8 x float> undef to <vscale x 8 x i8>
152 %nv8f32_to_si16 = fptosi <vscale x 8 x float> undef to <vscale x 8 x i16>
153 %nv8f32_to_ui16 = fptoui <vscale x 8 x float> undef to <vscale x 8 x i16>
154 %nv8f32_to_si64 = fptosi <vscale x 8 x float> undef to <vscale x 8 x i64>
155 %nv8f32_to_ui64 = fptoui <vscale x 8 x float> undef to <vscale x 8 x i64>
157 %nv8f64_to_si8 = fptosi <vscale x 8 x double> undef to <vscale x 8 x i8>
158 %nv8f64_to_ui8 = fptoui <vscale x 8 x double> undef to <vscale x 8 x i8>
159 %nv8f64_to_si16 = fptosi <vscale x 8 x double> undef to <vscale x 8 x i16>
160 %nv8f64_to_ui16 = fptoui <vscale x 8 x double> undef to <vscale x 8 x i16>
161 %nv8f64_to_si32 = fptosi <vscale x 8 x double> undef to <vscale x 8 x i32>
162 %nv8f64_to_ui32 = fptoui <vscale x 8 x double> undef to <vscale x 8 x i32>