2 // RUN: mlir-opt %s -convert-math-to-libm -canonicalize | FileCheck %s
4 // CHECK-DAG: @acos(f64) -> f64 attributes {llvm.readnone}
5 // CHECK-DAG: @acosf(f32) -> f32 attributes {llvm.readnone}
6 // CHECK-DAG: @acosh(f64) -> f64 attributes {llvm.readnone}
7 // CHECK-DAG: @acoshf(f32) -> f32 attributes {llvm.readnone}
8 // CHECK-DAG: @asin(f64) -> f64 attributes {llvm.readnone}
9 // CHECK-DAG: @asinf(f32) -> f32 attributes {llvm.readnone}
10 // CHECK-DAG: @asinh(f64) -> f64 attributes {llvm.readnone}
11 // CHECK-DAG: @asinhf(f32) -> f32 attributes {llvm.readnone}
12 // CHECK-DAG: @atan(f64) -> f64 attributes {llvm.readnone}
13 // CHECK-DAG: @atanf(f32) -> f32 attributes {llvm.readnone}
14 // CHECK-DAG: @atanh(f64) -> f64 attributes {llvm.readnone}
15 // CHECK-DAG: @atanhf(f32) -> f32 attributes {llvm.readnone}
16 // CHECK-DAG: @erf(f64) -> f64 attributes {llvm.readnone}
17 // CHECK-DAG: @erff(f32) -> f32 attributes {llvm.readnone}
18 // CHECK-DAG: @exp(f64) -> f64 attributes {llvm.readnone}
19 // CHECK-DAG: @expf(f32) -> f32 attributes {llvm.readnone}
20 // CHECK-DAG: @exp2(f64) -> f64 attributes {llvm.readnone}
21 // CHECK-DAG: @exp2f(f32) -> f32 attributes {llvm.readnone}
22 // CHECK-DAG: @expm1(f64) -> f64 attributes {llvm.readnone}
23 // CHECK-DAG: @expm1f(f32) -> f32 attributes {llvm.readnone}
24 // CHECK-DAG: @log(f64) -> f64 attributes {llvm.readnone}
25 // CHECK-DAG: @logf(f32) -> f32 attributes {llvm.readnone}
26 // CHECK-DAG: @log2(f64) -> f64 attributes {llvm.readnone}
27 // CHECK-DAG: @log2f(f32) -> f32 attributes {llvm.readnone}
28 // CHECK-DAG: @log10(f64) -> f64 attributes {llvm.readnone}
29 // CHECK-DAG: @log10f(f32) -> f32 attributes {llvm.readnone}
30 // CHECK-DAG: @log1p(f64) -> f64 attributes {llvm.readnone}
31 // CHECK-DAG: @log1pf(f32) -> f32 attributes {llvm.readnone}
32 // CHECK-DAG: @fabs(f64) -> f64 attributes {llvm.readnone}
33 // CHECK-DAG: @fabsf(f32) -> f32 attributes {llvm.readnone}
34 // CHECK-DAG: @fma(f64, f64, f64) -> f64 attributes {llvm.readnone}
35 // CHECK-DAG: @fmaf(f32, f32, f32) -> f32 attributes {llvm.readnone}
36 // CHECK-DAG: @atan2(f64, f64) -> f64 attributes {llvm.readnone}
37 // CHECK-DAG: @atan2f(f32, f32) -> f32 attributes {llvm.readnone}
38 // CHECK-DAG: @cbrt(f64) -> f64 attributes {llvm.readnone}
39 // CHECK-DAG: @cbrtf(f32) -> f32 attributes {llvm.readnone}
40 // CHECK-DAG: @tan(f64) -> f64 attributes {llvm.readnone}
41 // CHECK-DAG: @tanf(f32) -> f32 attributes {llvm.readnone}
42 // CHECK-DAG: @tanh(f64) -> f64 attributes {llvm.readnone}
43 // CHECK-DAG: @tanhf(f32) -> f32 attributes {llvm.readnone}
44 // CHECK-DAG: @round(f64) -> f64 attributes {llvm.readnone}
45 // CHECK-DAG: @roundf(f32) -> f32 attributes {llvm.readnone}
46 // CHECK-DAG: @roundeven(f64) -> f64 attributes {llvm.readnone}
47 // CHECK-DAG: @roundevenf(f32) -> f32 attributes {llvm.readnone}
48 // CHECK-DAG: @trunc(f64) -> f64 attributes {llvm.readnone}
49 // CHECK-DAG: @truncf(f32) -> f32 attributes {llvm.readnone}
50 // CHECK-DAG: @cos(f64) -> f64 attributes {llvm.readnone}
51 // CHECK-DAG: @cosf(f32) -> f32 attributes {llvm.readnone}
52 // CHECK-DAG: @cosh(f64) -> f64 attributes {llvm.readnone}
53 // CHECK-DAG: @coshf(f32) -> f32 attributes {llvm.readnone}
54 // CHECK-DAG: @sin(f64) -> f64 attributes {llvm.readnone}
55 // CHECK-DAG: @sinf(f32) -> f32 attributes {llvm.readnone}
56 // CHECK-DAG: @floor(f64) -> f64 attributes {llvm.readnone}
57 // CHECK-DAG: @floorf(f32) -> f32 attributes {llvm.readnone}
58 // CHECK-DAG: @ceil(f64) -> f64 attributes {llvm.readnone}
59 // CHECK-DAG: @ceilf(f32) -> f32 attributes {llvm.readnone}
60 // CHECK-DAG: @sqrt(f64) -> f64 attributes {llvm.readnone}
61 // CHECK-DAG: @sqrtf(f32) -> f32 attributes {llvm.readnone}
62 // CHECK-DAG: @rsqrt(f64) -> f64 attributes {llvm.readnone}
63 // CHECK-DAG: @rsqrtf(f32) -> f32 attributes {llvm.readnone}
64 // CHECK-DAG: @pow(f64, f64) -> f64 attributes {llvm.readnone}
65 // CHECK-DAG: @powf(f32, f32) -> f32 attributes {llvm.readnone}
67 // CHECK-LABEL: func @absf_caller
68 // CHECK-SAME: %[[FLOAT:.*]]: f32
69 // CHECK-SAME: %[[DOUBLE:.*]]: f64
70 func.func @absf_caller(%float: f32, %double: f64) -> (f32, f64) {
71 // CHECK-DAG: %[[FLOAT_RESULT:.*]] = call @fabsf(%[[FLOAT]]) : (f32) -> f32
72 %float_result = math.absf %float : f32
73 // CHECK-DAG: %[[DOUBLE_RESULT:.*]] = call @fabs(%[[DOUBLE]]) : (f64) -> f64
74 %double_result = math.absf %double : f64
75 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
76 return %float_result, %double_result : f32, f64
79 // CHECK-LABEL: func @absf_vec_caller(
80 // CHECK-SAME: %[[VAL_0:.*]]: vector<2xf32>,
81 // CHECK-SAME: %[[VAL_1:.*]]: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
82 // CHECK-DAG: %[[CVF:.*]] = arith.constant dense<0.000000e+00> : vector<2xf32>
83 // CHECK-DAG: %[[CVD:.*]] = arith.constant dense<0.000000e+00> : vector<2xf64>
84 // CHECK: %[[IN0_F32:.*]] = vector.extract %[[VAL_0]][0] : f32 from vector<2xf32>
85 // CHECK: %[[OUT0_F32:.*]] = call @fabsf(%[[IN0_F32]]) : (f32) -> f32
86 // CHECK: %[[VAL_8:.*]] = vector.insert %[[OUT0_F32]], %[[CVF]] [0] : f32 into vector<2xf32>
87 // CHECK: %[[IN1_F32:.*]] = vector.extract %[[VAL_0]][1] : f32 from vector<2xf32>
88 // CHECK: %[[OUT1_F32:.*]] = call @fabsf(%[[IN1_F32]]) : (f32) -> f32
89 // CHECK: %[[VAL_11:.*]] = vector.insert %[[OUT1_F32]], %[[VAL_8]] [1] : f32 into vector<2xf32>
90 // CHECK: %[[IN0_F64:.*]] = vector.extract %[[VAL_1]][0] : f64 from vector<2xf64>
91 // CHECK: %[[OUT0_F64:.*]] = call @fabs(%[[IN0_F64]]) : (f64) -> f64
92 // CHECK: %[[VAL_14:.*]] = vector.insert %[[OUT0_F64]], %[[CVD]] [0] : f64 into vector<2xf64>
93 // CHECK: %[[IN1_F64:.*]] = vector.extract %[[VAL_1]][1] : f64 from vector<2xf64>
94 // CHECK: %[[OUT1_F64:.*]] = call @fabs(%[[IN1_F64]]) : (f64) -> f64
95 // CHECK: %[[VAL_17:.*]] = vector.insert %[[OUT1_F64]], %[[VAL_14]] [1] : f64 into vector<2xf64>
96 // CHECK: return %[[VAL_11]], %[[VAL_17]] : vector<2xf32>, vector<2xf64>
98 func.func @absf_vec_caller(%float: vector<2xf32>, %double: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
99 %float_result = math.absf %float : vector<2xf32>
100 %double_result = math.absf %double : vector<2xf64>
101 return %float_result, %double_result : vector<2xf32>, vector<2xf64>
104 // CHECK-LABEL: func @acos_caller
105 // CHECK-SAME: %[[FLOAT:.*]]: f32
106 // CHECK-SAME: %[[DOUBLE:.*]]: f64
107 func.func @acos_caller(%float: f32, %double: f64) -> (f32, f64) {
108 // CHECK-DAG: %[[FLOAT_RESULT:.*]] = call @acosf(%[[FLOAT]]) : (f32) -> f32
109 %float_result = math.acos %float : f32
110 // CHECK-DAG: %[[DOUBLE_RESULT:.*]] = call @acos(%[[DOUBLE]]) : (f64) -> f64
111 %double_result = math.acos %double : f64
112 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
113 return %float_result, %double_result : f32, f64
116 // CHECK-LABEL: func @acos_vec_caller(
117 // CHECK-SAME: %[[VAL_0:.*]]: vector<2xf32>,
118 // CHECK-SAME: %[[VAL_1:.*]]: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
119 // CHECK-DAG: %[[CVF:.*]] = arith.constant dense<0.000000e+00> : vector<2xf32>
120 // CHECK-DAG: %[[CVD:.*]] = arith.constant dense<0.000000e+00> : vector<2xf64>
121 // CHECK: %[[IN0_F32:.*]] = vector.extract %[[VAL_0]][0] : f32 from vector<2xf32>
122 // CHECK: %[[OUT0_F32:.*]] = call @acosf(%[[IN0_F32]]) : (f32) -> f32
123 // CHECK: %[[VAL_8:.*]] = vector.insert %[[OUT0_F32]], %[[CVF]] [0] : f32 into vector<2xf32>
124 // CHECK: %[[IN1_F32:.*]] = vector.extract %[[VAL_0]][1] : f32 from vector<2xf32>
125 // CHECK: %[[OUT1_F32:.*]] = call @acosf(%[[IN1_F32]]) : (f32) -> f32
126 // CHECK: %[[VAL_11:.*]] = vector.insert %[[OUT1_F32]], %[[VAL_8]] [1] : f32 into vector<2xf32>
127 // CHECK: %[[IN0_F64:.*]] = vector.extract %[[VAL_1]][0] : f64 from vector<2xf64>
128 // CHECK: %[[OUT0_F64:.*]] = call @acos(%[[IN0_F64]]) : (f64) -> f64
129 // CHECK: %[[VAL_14:.*]] = vector.insert %[[OUT0_F64]], %[[CVD]] [0] : f64 into vector<2xf64>
130 // CHECK: %[[IN1_F64:.*]] = vector.extract %[[VAL_1]][1] : f64 from vector<2xf64>
131 // CHECK: %[[OUT1_F64:.*]] = call @acos(%[[IN1_F64]]) : (f64) -> f64
132 // CHECK: %[[VAL_17:.*]] = vector.insert %[[OUT1_F64]], %[[VAL_14]] [1] : f64 into vector<2xf64>
133 // CHECK: return %[[VAL_11]], %[[VAL_17]] : vector<2xf32>, vector<2xf64>
135 func.func @acos_vec_caller(%float: vector<2xf32>, %double: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
136 %float_result = math.acos %float : vector<2xf32>
137 %double_result = math.acos %double : vector<2xf64>
138 return %float_result, %double_result : vector<2xf32>, vector<2xf64>
141 // CHECK-LABEL: func @acosh_caller
142 // CHECK-SAME: %[[FLOAT:.*]]: f32
143 // CHECK-SAME: %[[DOUBLE:.*]]: f64
144 func.func @acosh_caller(%float: f32, %double: f64) -> (f32, f64) {
145 // CHECK-DAG: %[[FLOAT_RESULT:.*]] = call @acoshf(%[[FLOAT]]) : (f32) -> f32
146 %float_result = math.acosh %float : f32
147 // CHECK-DAG: %[[DOUBLE_RESULT:.*]] = call @acosh(%[[DOUBLE]]) : (f64) -> f64
148 %double_result = math.acosh %double : f64
149 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
150 return %float_result, %double_result : f32, f64
153 // CHECK-LABEL: func @acosh_vec_caller(
154 // CHECK-SAME: %[[VAL_0:.*]]: vector<2xf32>,
155 // CHECK-SAME: %[[VAL_1:.*]]: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
156 // CHECK-DAG: %[[CVF:.*]] = arith.constant dense<0.000000e+00> : vector<2xf32>
157 // CHECK-DAG: %[[CVD:.*]] = arith.constant dense<0.000000e+00> : vector<2xf64>
158 // CHECK: %[[IN0_F32:.*]] = vector.extract %[[VAL_0]][0] : f32 from vector<2xf32>
159 // CHECK: %[[OUT0_F32:.*]] = call @acoshf(%[[IN0_F32]]) : (f32) -> f32
160 // CHECK: %[[VAL_8:.*]] = vector.insert %[[OUT0_F32]], %[[CVF]] [0] : f32 into vector<2xf32>
161 // CHECK: %[[IN1_F32:.*]] = vector.extract %[[VAL_0]][1] : f32 from vector<2xf32>
162 // CHECK: %[[OUT1_F32:.*]] = call @acoshf(%[[IN1_F32]]) : (f32) -> f32
163 // CHECK: %[[VAL_11:.*]] = vector.insert %[[OUT1_F32]], %[[VAL_8]] [1] : f32 into vector<2xf32>
164 // CHECK: %[[IN0_F64:.*]] = vector.extract %[[VAL_1]][0] : f64 from vector<2xf64>
165 // CHECK: %[[OUT0_F64:.*]] = call @acosh(%[[IN0_F64]]) : (f64) -> f64
166 // CHECK: %[[VAL_14:.*]] = vector.insert %[[OUT0_F64]], %[[CVD]] [0] : f64 into vector<2xf64>
167 // CHECK: %[[IN1_F64:.*]] = vector.extract %[[VAL_1]][1] : f64 from vector<2xf64>
168 // CHECK: %[[OUT1_F64:.*]] = call @acosh(%[[IN1_F64]]) : (f64) -> f64
169 // CHECK: %[[VAL_17:.*]] = vector.insert %[[OUT1_F64]], %[[VAL_14]] [1] : f64 into vector<2xf64>
170 // CHECK: return %[[VAL_11]], %[[VAL_17]] : vector<2xf32>, vector<2xf64>
172 func.func @acosh_vec_caller(%float: vector<2xf32>, %double: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
173 %float_result = math.acosh %float : vector<2xf32>
174 %double_result = math.acosh %double : vector<2xf64>
175 return %float_result, %double_result : vector<2xf32>, vector<2xf64>
178 // CHECK-LABEL: func @asin_caller
179 // CHECK-SAME: %[[FLOAT:.*]]: f32
180 // CHECK-SAME: %[[DOUBLE:.*]]: f64
181 func.func @asin_caller(%float: f32, %double: f64) -> (f32, f64) {
182 // CHECK-DAG: %[[FLOAT_RESULT:.*]] = call @asinf(%[[FLOAT]]) : (f32) -> f32
183 %float_result = math.asin %float : f32
184 // CHECK-DAG: %[[DOUBLE_RESULT:.*]] = call @asin(%[[DOUBLE]]) : (f64) -> f64
185 %double_result = math.asin %double : f64
186 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
187 return %float_result, %double_result : f32, f64
190 // CHECK-LABEL: func @asin_vec_caller(
191 // CHECK-SAME: %[[VAL_0:.*]]: vector<2xf32>,
192 // CHECK-SAME: %[[VAL_1:.*]]: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
193 // CHECK-DAG: %[[CVF:.*]] = arith.constant dense<0.000000e+00> : vector<2xf32>
194 // CHECK-DAG: %[[CVD:.*]] = arith.constant dense<0.000000e+00> : vector<2xf64>
195 // CHECK: %[[IN0_F32:.*]] = vector.extract %[[VAL_0]][0] : f32 from vector<2xf32>
196 // CHECK: %[[OUT0_F32:.*]] = call @asinf(%[[IN0_F32]]) : (f32) -> f32
197 // CHECK: %[[VAL_8:.*]] = vector.insert %[[OUT0_F32]], %[[CVF]] [0] : f32 into vector<2xf32>
198 // CHECK: %[[IN1_F32:.*]] = vector.extract %[[VAL_0]][1] : f32 from vector<2xf32>
199 // CHECK: %[[OUT1_F32:.*]] = call @asinf(%[[IN1_F32]]) : (f32) -> f32
200 // CHECK: %[[VAL_11:.*]] = vector.insert %[[OUT1_F32]], %[[VAL_8]] [1] : f32 into vector<2xf32>
201 // CHECK: %[[IN0_F64:.*]] = vector.extract %[[VAL_1]][0] : f64 from vector<2xf64>
202 // CHECK: %[[OUT0_F64:.*]] = call @asin(%[[IN0_F64]]) : (f64) -> f64
203 // CHECK: %[[VAL_14:.*]] = vector.insert %[[OUT0_F64]], %[[CVD]] [0] : f64 into vector<2xf64>
204 // CHECK: %[[IN1_F64:.*]] = vector.extract %[[VAL_1]][1] : f64 from vector<2xf64>
205 // CHECK: %[[OUT1_F64:.*]] = call @asin(%[[IN1_F64]]) : (f64) -> f64
206 // CHECK: %[[VAL_17:.*]] = vector.insert %[[OUT1_F64]], %[[VAL_14]] [1] : f64 into vector<2xf64>
207 // CHECK: return %[[VAL_11]], %[[VAL_17]] : vector<2xf32>, vector<2xf64>
209 func.func @asin_vec_caller(%float: vector<2xf32>, %double: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
210 %float_result = math.asin %float : vector<2xf32>
211 %double_result = math.asin %double : vector<2xf64>
212 return %float_result, %double_result : vector<2xf32>, vector<2xf64>
215 // CHECK-LABEL: func @asinh_caller
216 // CHECK-SAME: %[[FLOAT:.*]]: f32
217 // CHECK-SAME: %[[DOUBLE:.*]]: f64
218 func.func @asinh_caller(%float: f32, %double: f64) -> (f32, f64) {
219 // CHECK-DAG: %[[FLOAT_RESULT:.*]] = call @asinhf(%[[FLOAT]]) : (f32) -> f32
220 %float_result = math.asinh %float : f32
221 // CHECK-DAG: %[[DOUBLE_RESULT:.*]] = call @asinh(%[[DOUBLE]]) : (f64) -> f64
222 %double_result = math.asinh %double : f64
223 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
224 return %float_result, %double_result : f32, f64
227 // CHECK-LABEL: func @asinh_vec_caller(
228 // CHECK-SAME: %[[VAL_0:.*]]: vector<2xf32>,
229 // CHECK-SAME: %[[VAL_1:.*]]: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
230 // CHECK-DAG: %[[CVF:.*]] = arith.constant dense<0.000000e+00> : vector<2xf32>
231 // CHECK-DAG: %[[CVD:.*]] = arith.constant dense<0.000000e+00> : vector<2xf64>
232 // CHECK: %[[IN0_F32:.*]] = vector.extract %[[VAL_0]][0] : f32 from vector<2xf32>
233 // CHECK: %[[OUT0_F32:.*]] = call @asinhf(%[[IN0_F32]]) : (f32) -> f32
234 // CHECK: %[[VAL_8:.*]] = vector.insert %[[OUT0_F32]], %[[CVF]] [0] : f32 into vector<2xf32>
235 // CHECK: %[[IN1_F32:.*]] = vector.extract %[[VAL_0]][1] : f32 from vector<2xf32>
236 // CHECK: %[[OUT1_F32:.*]] = call @asinhf(%[[IN1_F32]]) : (f32) -> f32
237 // CHECK: %[[VAL_11:.*]] = vector.insert %[[OUT1_F32]], %[[VAL_8]] [1] : f32 into vector<2xf32>
238 // CHECK: %[[IN0_F64:.*]] = vector.extract %[[VAL_1]][0] : f64 from vector<2xf64>
239 // CHECK: %[[OUT0_F64:.*]] = call @asinh(%[[IN0_F64]]) : (f64) -> f64
240 // CHECK: %[[VAL_14:.*]] = vector.insert %[[OUT0_F64]], %[[CVD]] [0] : f64 into vector<2xf64>
241 // CHECK: %[[IN1_F64:.*]] = vector.extract %[[VAL_1]][1] : f64 from vector<2xf64>
242 // CHECK: %[[OUT1_F64:.*]] = call @asinh(%[[IN1_F64]]) : (f64) -> f64
243 // CHECK: %[[VAL_17:.*]] = vector.insert %[[OUT1_F64]], %[[VAL_14]] [1] : f64 into vector<2xf64>
244 // CHECK: return %[[VAL_11]], %[[VAL_17]] : vector<2xf32>, vector<2xf64>
246 func.func @asinh_vec_caller(%float: vector<2xf32>, %double: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
247 %float_result = math.asinh %float : vector<2xf32>
248 %double_result = math.asinh %double : vector<2xf64>
249 return %float_result, %double_result : vector<2xf32>, vector<2xf64>
252 // CHECK-LABEL: func @atan_caller
253 // CHECK-SAME: %[[FLOAT:.*]]: f32
254 // CHECK-SAME: %[[DOUBLE:.*]]: f64
255 // CHECK-SAME: %[[HALF:.*]]: f16
256 // CHECK-SAME: %[[BFLOAT:.*]]: bf16
257 func.func @atan_caller(%float: f32, %double: f64, %half: f16, %bfloat: bf16) -> (f32, f64, f16, bf16) {
258 // CHECK: %[[FLOAT_RESULT:.*]] = call @atanf(%[[FLOAT]]) : (f32) -> f32
259 %float_result = math.atan %float : f32
260 // CHECK: %[[DOUBLE_RESULT:.*]] = call @atan(%[[DOUBLE]]) : (f64) -> f64
261 %double_result = math.atan %double : f64
262 // CHECK: %[[HALF_PROMOTED:.*]] = arith.extf %[[HALF]] : f16 to f32
263 // CHECK: %[[HALF_CALL:.*]] = call @atanf(%[[HALF_PROMOTED]]) : (f32) -> f32
264 // CHECK: %[[HALF_RESULT:.*]] = arith.truncf %[[HALF_CALL]] : f32 to f16
265 %half_result = math.atan %half : f16
266 // CHECK: %[[BFLOAT_PROMOTED:.*]] = arith.extf %[[BFLOAT]] : bf16 to f32
267 // CHECK: %[[BFLOAT_CALL:.*]] = call @atanf(%[[BFLOAT_PROMOTED]]) : (f32) -> f32
268 // CHECK: %[[BFLOAT_RESULT:.*]] = arith.truncf %[[BFLOAT_CALL]] : f32 to bf16
269 %bfloat_result = math.atan %bfloat : bf16
270 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]], %[[HALF_RESULT]], %[[BFLOAT_RESULT]]
271 return %float_result, %double_result, %half_result, %bfloat_result : f32, f64, f16, bf16
274 // CHECK-LABEL: func @atan_vec_caller(
275 // CHECK-SAME: %[[VAL_0:.*]]: vector<2xf32>,
276 // CHECK-SAME: %[[VAL_1:.*]]: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
277 // CHECK-DAG: %[[CVF:.*]] = arith.constant dense<0.000000e+00> : vector<2xf32>
278 // CHECK-DAG: %[[CVD:.*]] = arith.constant dense<0.000000e+00> : vector<2xf64>
279 // CHECK: %[[IN0_F32:.*]] = vector.extract %[[VAL_0]][0] : f32 from vector<2xf32>
280 // CHECK: %[[OUT0_F32:.*]] = call @atanf(%[[IN0_F32]]) : (f32) -> f32
281 // CHECK: %[[VAL_8:.*]] = vector.insert %[[OUT0_F32]], %[[CVF]] [0] : f32 into vector<2xf32>
282 // CHECK: %[[IN1_F32:.*]] = vector.extract %[[VAL_0]][1] : f32 from vector<2xf32>
283 // CHECK: %[[OUT1_F32:.*]] = call @atanf(%[[IN1_F32]]) : (f32) -> f32
284 // CHECK: %[[VAL_11:.*]] = vector.insert %[[OUT1_F32]], %[[VAL_8]] [1] : f32 into vector<2xf32>
285 // CHECK: %[[IN0_F64:.*]] = vector.extract %[[VAL_1]][0] : f64 from vector<2xf64>
286 // CHECK: %[[OUT0_F64:.*]] = call @atan(%[[IN0_F64]]) : (f64) -> f64
287 // CHECK: %[[VAL_14:.*]] = vector.insert %[[OUT0_F64]], %[[CVD]] [0] : f64 into vector<2xf64>
288 // CHECK: %[[IN1_F64:.*]] = vector.extract %[[VAL_1]][1] : f64 from vector<2xf64>
289 // CHECK: %[[OUT1_F64:.*]] = call @atan(%[[IN1_F64]]) : (f64) -> f64
290 // CHECK: %[[VAL_17:.*]] = vector.insert %[[OUT1_F64]], %[[VAL_14]] [1] : f64 into vector<2xf64>
291 // CHECK: return %[[VAL_11]], %[[VAL_17]] : vector<2xf32>, vector<2xf64>
293 func.func @atan_vec_caller(%float: vector<2xf32>, %double: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
294 %float_result = math.atan %float : vector<2xf32>
295 %double_result = math.atan %double : vector<2xf64>
296 return %float_result, %double_result : vector<2xf32>, vector<2xf64>
299 // CHECK-LABEL: func @atanh_caller
300 // CHECK-SAME: %[[FLOAT:.*]]: f32
301 // CHECK-SAME: %[[DOUBLE:.*]]: f64
302 // CHECK-SAME: %[[HALF:.*]]: f16
303 // CHECK-SAME: %[[BFLOAT:.*]]: bf16
304 func.func @atanh_caller(%float: f32, %double: f64, %half: f16, %bfloat: bf16) -> (f32, f64, f16, bf16) {
305 // CHECK: %[[FLOAT_RESULT:.*]] = call @atanhf(%[[FLOAT]]) : (f32) -> f32
306 %float_result = math.atanh %float : f32
307 // CHECK: %[[DOUBLE_RESULT:.*]] = call @atanh(%[[DOUBLE]]) : (f64) -> f64
308 %double_result = math.atanh %double : f64
309 // CHECK: %[[HALF_PROMOTED:.*]] = arith.extf %[[HALF]] : f16 to f32
310 // CHECK: %[[HALF_CALL:.*]] = call @atanhf(%[[HALF_PROMOTED]]) : (f32) -> f32
311 // CHECK: %[[HALF_RESULT:.*]] = arith.truncf %[[HALF_CALL]] : f32 to f16
312 %half_result = math.atanh %half : f16
313 // CHECK: %[[BFLOAT_PROMOTED:.*]] = arith.extf %[[BFLOAT]] : bf16 to f32
314 // CHECK: %[[BFLOAT_CALL:.*]] = call @atanhf(%[[BFLOAT_PROMOTED]]) : (f32) -> f32
315 // CHECK: %[[BFLOAT_RESULT:.*]] = arith.truncf %[[BFLOAT_CALL]] : f32 to bf16
316 %bfloat_result = math.atanh %bfloat : bf16
317 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]], %[[HALF_RESULT]], %[[BFLOAT_RESULT]]
318 return %float_result, %double_result, %half_result, %bfloat_result : f32, f64, f16, bf16
321 // CHECK-LABEL: func @atanh_vec_caller(
322 // CHECK-SAME: %[[VAL_0:.*]]: vector<2xf32>,
323 // CHECK-SAME: %[[VAL_1:.*]]: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
324 // CHECK-DAG: %[[CVF:.*]] = arith.constant dense<0.000000e+00> : vector<2xf32>
325 // CHECK-DAG: %[[CVD:.*]] = arith.constant dense<0.000000e+00> : vector<2xf64>
326 // CHECK: %[[IN0_F32:.*]] = vector.extract %[[VAL_0]][0] : f32 from vector<2xf32>
327 // CHECK: %[[OUT0_F32:.*]] = call @atanhf(%[[IN0_F32]]) : (f32) -> f32
328 // CHECK: %[[VAL_8:.*]] = vector.insert %[[OUT0_F32]], %[[CVF]] [0] : f32 into vector<2xf32>
329 // CHECK: %[[IN1_F32:.*]] = vector.extract %[[VAL_0]][1] : f32 from vector<2xf32>
330 // CHECK: %[[OUT1_F32:.*]] = call @atanhf(%[[IN1_F32]]) : (f32) -> f32
331 // CHECK: %[[VAL_11:.*]] = vector.insert %[[OUT1_F32]], %[[VAL_8]] [1] : f32 into vector<2xf32>
332 // CHECK: %[[IN0_F64:.*]] = vector.extract %[[VAL_1]][0] : f64 from vector<2xf64>
333 // CHECK: %[[OUT0_F64:.*]] = call @atanh(%[[IN0_F64]]) : (f64) -> f64
334 // CHECK: %[[VAL_14:.*]] = vector.insert %[[OUT0_F64]], %[[CVD]] [0] : f64 into vector<2xf64>
335 // CHECK: %[[IN1_F64:.*]] = vector.extract %[[VAL_1]][1] : f64 from vector<2xf64>
336 // CHECK: %[[OUT1_F64:.*]] = call @atanh(%[[IN1_F64]]) : (f64) -> f64
337 // CHECK: %[[VAL_17:.*]] = vector.insert %[[OUT1_F64]], %[[VAL_14]] [1] : f64 into vector<2xf64>
338 // CHECK: return %[[VAL_11]], %[[VAL_17]] : vector<2xf32>, vector<2xf64>
340 func.func @atanh_vec_caller(%float: vector<2xf32>, %double: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
341 %float_result = math.atanh %float : vector<2xf32>
342 %double_result = math.atanh %double : vector<2xf64>
343 return %float_result, %double_result : vector<2xf32>, vector<2xf64>
346 // CHECK-LABEL: func @tanh_caller
347 // CHECK-SAME: %[[FLOAT:.*]]: f32
348 // CHECK-SAME: %[[DOUBLE:.*]]: f64
349 func.func @tanh_caller(%float: f32, %double: f64) -> (f32, f64) {
350 // CHECK-DAG: %[[FLOAT_RESULT:.*]] = call @tanhf(%[[FLOAT]]) : (f32) -> f32
351 %float_result = math.tanh %float : f32
352 // CHECK-DAG: %[[DOUBLE_RESULT:.*]] = call @tanh(%[[DOUBLE]]) : (f64) -> f64
353 %double_result = math.tanh %double : f64
354 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
355 return %float_result, %double_result : f32, f64
358 // CHECK-LABEL: func @cosh_caller
359 // CHECK-SAME: %[[FLOAT:.*]]: f32
360 // CHECK-SAME: %[[DOUBLE:.*]]: f64
361 func.func @cosh_caller(%float: f32, %double: f64) -> (f32, f64) {
362 // CHECK-DAG: %[[FLOAT_RESULT:.*]] = call @coshf(%[[FLOAT]]) : (f32) -> f32
363 %float_result = math.cosh %float : f32
364 // CHECK-DAG: %[[DOUBLE_RESULT:.*]] = call @cosh(%[[DOUBLE]]) : (f64) -> f64
365 %double_result = math.cosh %double : f64
366 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
367 return %float_result, %double_result : f32, f64
370 // CHECK-LABEL: func @sinh_caller
371 // CHECK-SAME: %[[FLOAT:.*]]: f32
372 // CHECK-SAME: %[[DOUBLE:.*]]: f64
373 func.func @sinh_caller(%float: f32, %double: f64) -> (f32, f64) {
374 // CHECK-DAG: %[[FLOAT_RESULT:.*]] = call @sinhf(%[[FLOAT]]) : (f32) -> f32
375 %float_result = math.sinh %float : f32
376 // CHECK-DAG: %[[DOUBLE_RESULT:.*]] = call @sinh(%[[DOUBLE]]) : (f64) -> f64
377 %double_result = math.sinh %double : f64
378 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
379 return %float_result, %double_result : f32, f64
382 // CHECK-LABEL: func @atan2_caller
383 // CHECK-SAME: %[[FLOAT:.*]]: f32
384 // CHECK-SAME: %[[DOUBLE:.*]]: f64
385 // CHECK-SAME: %[[HALF:.*]]: f16
386 // CHECK-SAME: %[[BFLOAT:.*]]: bf16
387 func.func @atan2_caller(%float: f32, %double: f64, %half: f16, %bfloat: bf16) -> (f32, f64, f16, bf16) {
388 // CHECK: %[[FLOAT_RESULT:.*]] = call @atan2f(%[[FLOAT]], %[[FLOAT]]) : (f32, f32) -> f32
389 %float_result = math.atan2 %float, %float : f32
390 // CHECK: %[[DOUBLE_RESULT:.*]] = call @atan2(%[[DOUBLE]], %[[DOUBLE]]) : (f64, f64) -> f64
391 %double_result = math.atan2 %double, %double : f64
392 // CHECK: %[[HALF_PROMOTED1:.*]] = arith.extf %[[HALF]] : f16 to f32
393 // CHECK: %[[HALF_PROMOTED2:.*]] = arith.extf %[[HALF]] : f16 to f32
394 // CHECK: %[[HALF_CALL:.*]] = call @atan2f(%[[HALF_PROMOTED1]], %[[HALF_PROMOTED2]]) : (f32, f32) -> f32
395 // CHECK: %[[HALF_RESULT:.*]] = arith.truncf %[[HALF_CALL]] : f32 to f16
396 %half_result = math.atan2 %half, %half : f16
397 // CHECK: %[[BFLOAT_PROMOTED1:.*]] = arith.extf %[[BFLOAT]] : bf16 to f32
398 // CHECK: %[[BFLOAT_PROMOTED2:.*]] = arith.extf %[[BFLOAT]] : bf16 to f32
399 // CHECK: %[[BFLOAT_CALL:.*]] = call @atan2f(%[[BFLOAT_PROMOTED1]], %[[BFLOAT_PROMOTED2]]) : (f32, f32) -> f32
400 // CHECK: %[[BFLOAT_RESULT:.*]] = arith.truncf %[[BFLOAT_CALL]] : f32 to bf16
401 %bfloat_result = math.atan2 %bfloat, %bfloat : bf16
402 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]], %[[HALF_RESULT]], %[[BFLOAT_RESULT]]
403 return %float_result, %double_result, %half_result, %bfloat_result : f32, f64, f16, bf16
406 // CHECK-LABEL: func @erf_caller
407 // CHECK-SAME: %[[FLOAT:.*]]: f32
408 // CHECK-SAME: %[[DOUBLE:.*]]: f64
409 func.func @erf_caller(%float: f32, %double: f64) -> (f32, f64) {
410 // CHECK-DAG: %[[FLOAT_RESULT:.*]] = call @erff(%[[FLOAT]]) : (f32) -> f32
411 %float_result = math.erf %float : f32
412 // CHECK-DAG: %[[DOUBLE_RESULT:.*]] = call @erf(%[[DOUBLE]]) : (f64) -> f64
413 %double_result = math.erf %double : f64
414 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
415 return %float_result, %double_result : f32, f64
418 // CHECK-LABEL: func @erf_vec_caller(
419 // CHECK-SAME: %[[VAL_0:.*]]: vector<2xf32>,
420 // CHECK-SAME: %[[VAL_1:.*]]: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
421 func.func @erf_vec_caller(%float: vector<2xf32>, %double: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
422 // CHECK-DAG: %[[CVF:.*]] = arith.constant dense<0.000000e+00> : vector<2xf32>
423 // CHECK-DAG: %[[CVD:.*]] = arith.constant dense<0.000000e+00> : vector<2xf64>
424 // CHECK: %[[IN0_F32:.*]] = vector.extract %[[VAL_0]][0] : f32 from vector<2xf32>
425 // CHECK: %[[OUT0_F32:.*]] = call @erff(%[[IN0_F32]]) : (f32) -> f32
426 // CHECK: %[[VAL_8:.*]] = vector.insert %[[OUT0_F32]], %[[CVF]] [0] : f32 into vector<2xf32>
427 // CHECK: %[[IN1_F32:.*]] = vector.extract %[[VAL_0]][1] : f32 from vector<2xf32>
428 // CHECK: %[[OUT1_F32:.*]] = call @erff(%[[IN1_F32]]) : (f32) -> f32
429 // CHECK: %[[VAL_11:.*]] = vector.insert %[[OUT1_F32]], %[[VAL_8]] [1] : f32 into vector<2xf32>
430 %float_result = math.erf %float : vector<2xf32>
431 // CHECK: %[[IN0_F64:.*]] = vector.extract %[[VAL_1]][0] : f64 from vector<2xf64>
432 // CHECK: %[[OUT0_F64:.*]] = call @erf(%[[IN0_F64]]) : (f64) -> f64
433 // CHECK: %[[VAL_14:.*]] = vector.insert %[[OUT0_F64]], %[[CVD]] [0] : f64 into vector<2xf64>
434 // CHECK: %[[IN1_F64:.*]] = vector.extract %[[VAL_1]][1] : f64 from vector<2xf64>
435 // CHECK: %[[OUT1_F64:.*]] = call @erf(%[[IN1_F64]]) : (f64) -> f64
436 // CHECK: %[[VAL_17:.*]] = vector.insert %[[OUT1_F64]], %[[VAL_14]] [1] : f64 into vector<2xf64>
437 %double_result = math.erf %double : vector<2xf64>
438 // CHECK: return %[[VAL_11]], %[[VAL_17]] : vector<2xf32>, vector<2xf64>
439 return %float_result, %double_result : vector<2xf32>, vector<2xf64>
442 // CHECK-LABEL: func @exp_caller
443 // CHECK-SAME: %[[FLOAT:.*]]: f32
444 // CHECK-SAME: %[[DOUBLE:.*]]: f64
445 func.func @exp_caller(%float: f32, %double: f64) -> (f32, f64) {
446 // CHECK-DAG: %[[FLOAT_RESULT:.*]] = call @expf(%[[FLOAT]]) : (f32) -> f32
447 %float_result = math.exp %float : f32
448 // CHECK-DAG: %[[DOUBLE_RESULT:.*]] = call @exp(%[[DOUBLE]]) : (f64) -> f64
449 %double_result = math.exp %double : f64
450 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
451 return %float_result, %double_result : f32, f64
454 func.func @exp_vec_caller(%float: vector<2xf32>, %double: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
455 %float_result = math.exp %float : vector<2xf32>
456 %double_result = math.exp %double : vector<2xf64>
457 return %float_result, %double_result : vector<2xf32>, vector<2xf64>
459 // CHECK-LABEL: func @exp_vec_caller(
460 // CHECK-SAME: %[[VAL_0:.*]]: vector<2xf32>,
461 // CHECK-SAME: %[[VAL_1:.*]]: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
462 // CHECK-DAG: %[[CVF:.*]] = arith.constant dense<0.000000e+00> : vector<2xf32>
463 // CHECK-DAG: %[[CVD:.*]] = arith.constant dense<0.000000e+00> : vector<2xf64>
464 // CHECK: %[[IN0_F32:.*]] = vector.extract %[[VAL_0]][0] : f32 from vector<2xf32>
465 // CHECK: %[[OUT0_F32:.*]] = call @expf(%[[IN0_F32]]) : (f32) -> f32
466 // CHECK: %[[VAL_8:.*]] = vector.insert %[[OUT0_F32]], %[[CVF]] [0] : f32 into vector<2xf32>
467 // CHECK: %[[IN1_F32:.*]] = vector.extract %[[VAL_0]][1] : f32 from vector<2xf32>
468 // CHECK: %[[OUT1_F32:.*]] = call @expf(%[[IN1_F32]]) : (f32) -> f32
469 // CHECK: %[[VAL_11:.*]] = vector.insert %[[OUT1_F32]], %[[VAL_8]] [1] : f32 into vector<2xf32>
470 // CHECK: %[[IN0_F64:.*]] = vector.extract %[[VAL_1]][0] : f64 from vector<2xf64>
471 // CHECK: %[[OUT0_F64:.*]] = call @exp(%[[IN0_F64]]) : (f64) -> f64
472 // CHECK: %[[VAL_14:.*]] = vector.insert %[[OUT0_F64]], %[[CVD]] [0] : f64 into vector<2xf64>
473 // CHECK: %[[IN1_F64:.*]] = vector.extract %[[VAL_1]][1] : f64 from vector<2xf64>
474 // CHECK: %[[OUT1_F64:.*]] = call @exp(%[[IN1_F64]]) : (f64) -> f64
475 // CHECK: %[[VAL_17:.*]] = vector.insert %[[OUT1_F64]], %[[VAL_14]] [1] : f64 into vector<2xf64>
476 // CHECK: return %[[VAL_11]], %[[VAL_17]] : vector<2xf32>, vector<2xf64>
479 // CHECK-LABEL: func @exp2_caller
480 // CHECK-SAME: %[[FLOAT:.*]]: f32
481 // CHECK-SAME: %[[DOUBLE:.*]]: f64
482 func.func @exp2_caller(%float: f32, %double: f64) -> (f32, f64) {
483 // CHECK-DAG: %[[FLOAT_RESULT:.*]] = call @exp2f(%[[FLOAT]]) : (f32) -> f32
484 %float_result = math.exp2 %float : f32
485 // CHECK-DAG: %[[DOUBLE_RESULT:.*]] = call @exp2(%[[DOUBLE]]) : (f64) -> f64
486 %double_result = math.exp2 %double : f64
487 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
488 return %float_result, %double_result : f32, f64
491 func.func @exp2_vec_caller(%float: vector<2xf32>, %double: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
492 %float_result = math.exp2 %float : vector<2xf32>
493 %double_result = math.exp2 %double : vector<2xf64>
494 return %float_result, %double_result : vector<2xf32>, vector<2xf64>
496 // CHECK-LABEL: func @exp2_vec_caller(
497 // CHECK-SAME: %[[VAL_0:.*]]: vector<2xf32>,
498 // CHECK-SAME: %[[VAL_1:.*]]: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
499 // CHECK-DAG: %[[CVF:.*]] = arith.constant dense<0.000000e+00> : vector<2xf32>
500 // CHECK-DAG: %[[CVD:.*]] = arith.constant dense<0.000000e+00> : vector<2xf64>
501 // CHECK: %[[IN0_F32:.*]] = vector.extract %[[VAL_0]][0] : f32 from vector<2xf32>
502 // CHECK: %[[OUT0_F32:.*]] = call @exp2f(%[[IN0_F32]]) : (f32) -> f32
503 // CHECK: %[[VAL_8:.*]] = vector.insert %[[OUT0_F32]], %[[CVF]] [0] : f32 into vector<2xf32>
504 // CHECK: %[[IN1_F32:.*]] = vector.extract %[[VAL_0]][1] : f32 from vector<2xf32>
505 // CHECK: %[[OUT1_F32:.*]] = call @exp2f(%[[IN1_F32]]) : (f32) -> f32
506 // CHECK: %[[VAL_11:.*]] = vector.insert %[[OUT1_F32]], %[[VAL_8]] [1] : f32 into vector<2xf32>
507 // CHECK: %[[IN0_F64:.*]] = vector.extract %[[VAL_1]][0] : f64 from vector<2xf64>
508 // CHECK: %[[OUT0_F64:.*]] = call @exp2(%[[IN0_F64]]) : (f64) -> f64
509 // CHECK: %[[VAL_14:.*]] = vector.insert %[[OUT0_F64]], %[[CVD]] [0] : f64 into vector<2xf64>
510 // CHECK: %[[IN1_F64:.*]] = vector.extract %[[VAL_1]][1] : f64 from vector<2xf64>
511 // CHECK: %[[OUT1_F64:.*]] = call @exp2(%[[IN1_F64]]) : (f64) -> f64
512 // CHECK: %[[VAL_17:.*]] = vector.insert %[[OUT1_F64]], %[[VAL_14]] [1] : f64 into vector<2xf64>
513 // CHECK: return %[[VAL_11]], %[[VAL_17]] : vector<2xf32>, vector<2xf64>
516 // CHECK-LABEL: func @log_caller
517 // CHECK-SAME: %[[FLOAT:.*]]: f32
518 // CHECK-SAME: %[[DOUBLE:.*]]: f64
519 func.func @log_caller(%float: f32, %double: f64) -> (f32, f64) {
520 // CHECK-DAG: %[[FLOAT_RESULT:.*]] = call @logf(%[[FLOAT]]) : (f32) -> f32
521 %float_result = math.log %float : f32
522 // CHECK-DAG: %[[DOUBLE_RESULT:.*]] = call @log(%[[DOUBLE]]) : (f64) -> f64
523 %double_result = math.log %double : f64
524 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
525 return %float_result, %double_result : f32, f64
528 func.func @log_vec_caller(%float: vector<2xf32>, %double: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
529 %float_result = math.log %float : vector<2xf32>
530 %double_result = math.log %double : vector<2xf64>
531 return %float_result, %double_result : vector<2xf32>, vector<2xf64>
533 // CHECK-LABEL: func @log_vec_caller(
534 // CHECK-SAME: %[[VAL_0:.*]]: vector<2xf32>,
535 // CHECK-SAME: %[[VAL_1:.*]]: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
536 // CHECK-DAG: %[[CVF:.*]] = arith.constant dense<0.000000e+00> : vector<2xf32>
537 // CHECK-DAG: %[[CVD:.*]] = arith.constant dense<0.000000e+00> : vector<2xf64>
538 // CHECK: %[[IN0_F32:.*]] = vector.extract %[[VAL_0]][0] : f32 from vector<2xf32>
539 // CHECK: %[[OUT0_F32:.*]] = call @logf(%[[IN0_F32]]) : (f32) -> f32
540 // CHECK: %[[VAL_8:.*]] = vector.insert %[[OUT0_F32]], %[[CVF]] [0] : f32 into vector<2xf32>
541 // CHECK: %[[IN1_F32:.*]] = vector.extract %[[VAL_0]][1] : f32 from vector<2xf32>
542 // CHECK: %[[OUT1_F32:.*]] = call @logf(%[[IN1_F32]]) : (f32) -> f32
543 // CHECK: %[[VAL_11:.*]] = vector.insert %[[OUT1_F32]], %[[VAL_8]] [1] : f32 into vector<2xf32>
544 // CHECK: %[[IN0_F64:.*]] = vector.extract %[[VAL_1]][0] : f64 from vector<2xf64>
545 // CHECK: %[[OUT0_F64:.*]] = call @log(%[[IN0_F64]]) : (f64) -> f64
546 // CHECK: %[[VAL_14:.*]] = vector.insert %[[OUT0_F64]], %[[CVD]] [0] : f64 into vector<2xf64>
547 // CHECK: %[[IN1_F64:.*]] = vector.extract %[[VAL_1]][1] : f64 from vector<2xf64>
548 // CHECK: %[[OUT1_F64:.*]] = call @log(%[[IN1_F64]]) : (f64) -> f64
549 // CHECK: %[[VAL_17:.*]] = vector.insert %[[OUT1_F64]], %[[VAL_14]] [1] : f64 into vector<2xf64>
550 // CHECK: return %[[VAL_11]], %[[VAL_17]] : vector<2xf32>, vector<2xf64>
553 // CHECK-LABEL: func @log2_caller
554 // CHECK-SAME: %[[FLOAT:.*]]: f32
555 // CHECK-SAME: %[[DOUBLE:.*]]: f64
556 func.func @log2_caller(%float: f32, %double: f64) -> (f32, f64) {
557 // CHECK-DAG: %[[FLOAT_RESULT:.*]] = call @log2f(%[[FLOAT]]) : (f32) -> f32
558 %float_result = math.log2 %float : f32
559 // CHECK-DAG: %[[DOUBLE_RESULT:.*]] = call @log2(%[[DOUBLE]]) : (f64) -> f64
560 %double_result = math.log2 %double : f64
561 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
562 return %float_result, %double_result : f32, f64
565 func.func @log2_vec_caller(%float: vector<2xf32>, %double: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
566 %float_result = math.log2 %float : vector<2xf32>
567 %double_result = math.log2 %double : vector<2xf64>
568 return %float_result, %double_result : vector<2xf32>, vector<2xf64>
570 // CHECK-LABEL: func @log2_vec_caller(
571 // CHECK-SAME: %[[VAL_0:.*]]: vector<2xf32>,
572 // CHECK-SAME: %[[VAL_1:.*]]: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
573 // CHECK-DAG: %[[CVF:.*]] = arith.constant dense<0.000000e+00> : vector<2xf32>
574 // CHECK-DAG: %[[CVD:.*]] = arith.constant dense<0.000000e+00> : vector<2xf64>
575 // CHECK: %[[IN0_F32:.*]] = vector.extract %[[VAL_0]][0] : f32 from vector<2xf32>
576 // CHECK: %[[OUT0_F32:.*]] = call @log2f(%[[IN0_F32]]) : (f32) -> f32
577 // CHECK: %[[VAL_8:.*]] = vector.insert %[[OUT0_F32]], %[[CVF]] [0] : f32 into vector<2xf32>
578 // CHECK: %[[IN1_F32:.*]] = vector.extract %[[VAL_0]][1] : f32 from vector<2xf32>
579 // CHECK: %[[OUT1_F32:.*]] = call @log2f(%[[IN1_F32]]) : (f32) -> f32
580 // CHECK: %[[VAL_11:.*]] = vector.insert %[[OUT1_F32]], %[[VAL_8]] [1] : f32 into vector<2xf32>
581 // CHECK: %[[IN0_F64:.*]] = vector.extract %[[VAL_1]][0] : f64 from vector<2xf64>
582 // CHECK: %[[OUT0_F64:.*]] = call @log2(%[[IN0_F64]]) : (f64) -> f64
583 // CHECK: %[[VAL_14:.*]] = vector.insert %[[OUT0_F64]], %[[CVD]] [0] : f64 into vector<2xf64>
584 // CHECK: %[[IN1_F64:.*]] = vector.extract %[[VAL_1]][1] : f64 from vector<2xf64>
585 // CHECK: %[[OUT1_F64:.*]] = call @log2(%[[IN1_F64]]) : (f64) -> f64
586 // CHECK: %[[VAL_17:.*]] = vector.insert %[[OUT1_F64]], %[[VAL_14]] [1] : f64 into vector<2xf64>
587 // CHECK: return %[[VAL_11]], %[[VAL_17]] : vector<2xf32>, vector<2xf64>
590 // CHECK-LABEL: func @log10_caller
591 // CHECK-SAME: %[[FLOAT:.*]]: f32
592 // CHECK-SAME: %[[DOUBLE:.*]]: f64
593 func.func @log10_caller(%float: f32, %double: f64) -> (f32, f64) {
594 // CHECK-DAG: %[[FLOAT_RESULT:.*]] = call @log10f(%[[FLOAT]]) : (f32) -> f32
595 %float_result = math.log10 %float : f32
596 // CHECK-DAG: %[[DOUBLE_RESULT:.*]] = call @log10(%[[DOUBLE]]) : (f64) -> f64
597 %double_result = math.log10 %double : f64
598 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
599 return %float_result, %double_result : f32, f64
602 func.func @log10_vec_caller(%float: vector<2xf32>, %double: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
603 %float_result = math.log10 %float : vector<2xf32>
604 %double_result = math.log10 %double : vector<2xf64>
605 return %float_result, %double_result : vector<2xf32>, vector<2xf64>
607 // CHECK-LABEL: func @log10_vec_caller(
608 // CHECK-SAME: %[[VAL_0:.*]]: vector<2xf32>,
609 // CHECK-SAME: %[[VAL_1:.*]]: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
610 // CHECK-DAG: %[[CVF:.*]] = arith.constant dense<0.000000e+00> : vector<2xf32>
611 // CHECK-DAG: %[[CVD:.*]] = arith.constant dense<0.000000e+00> : vector<2xf64>
612 // CHECK: %[[IN0_F32:.*]] = vector.extract %[[VAL_0]][0] : f32 from vector<2xf32>
613 // CHECK: %[[OUT0_F32:.*]] = call @log10f(%[[IN0_F32]]) : (f32) -> f32
614 // CHECK: %[[VAL_8:.*]] = vector.insert %[[OUT0_F32]], %[[CVF]] [0] : f32 into vector<2xf32>
615 // CHECK: %[[IN1_F32:.*]] = vector.extract %[[VAL_0]][1] : f32 from vector<2xf32>
616 // CHECK: %[[OUT1_F32:.*]] = call @log10f(%[[IN1_F32]]) : (f32) -> f32
617 // CHECK: %[[VAL_11:.*]] = vector.insert %[[OUT1_F32]], %[[VAL_8]] [1] : f32 into vector<2xf32>
618 // CHECK: %[[IN0_F64:.*]] = vector.extract %[[VAL_1]][0] : f64 from vector<2xf64>
619 // CHECK: %[[OUT0_F64:.*]] = call @log10(%[[IN0_F64]]) : (f64) -> f64
620 // CHECK: %[[VAL_14:.*]] = vector.insert %[[OUT0_F64]], %[[CVD]] [0] : f64 into vector<2xf64>
621 // CHECK: %[[IN1_F64:.*]] = vector.extract %[[VAL_1]][1] : f64 from vector<2xf64>
622 // CHECK: %[[OUT1_F64:.*]] = call @log10(%[[IN1_F64]]) : (f64) -> f64
623 // CHECK: %[[VAL_17:.*]] = vector.insert %[[OUT1_F64]], %[[VAL_14]] [1] : f64 into vector<2xf64>
624 // CHECK: return %[[VAL_11]], %[[VAL_17]] : vector<2xf32>, vector<2xf64>
627 // CHECK-LABEL: func @expm1_caller
628 // CHECK-SAME: %[[FLOAT:.*]]: f32
629 // CHECK-SAME: %[[DOUBLE:.*]]: f64
630 func.func @expm1_caller(%float: f32, %double: f64) -> (f32, f64) {
631 // CHECK-DAG: %[[FLOAT_RESULT:.*]] = call @expm1f(%[[FLOAT]]) : (f32) -> f32
632 %float_result = math.expm1 %float : f32
633 // CHECK-DAG: %[[DOUBLE_RESULT:.*]] = call @expm1(%[[DOUBLE]]) : (f64) -> f64
634 %double_result = math.expm1 %double : f64
635 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
636 return %float_result, %double_result : f32, f64
639 func.func @expm1_vec_caller(%float: vector<2xf32>, %double: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
640 %float_result = math.expm1 %float : vector<2xf32>
641 %double_result = math.expm1 %double : vector<2xf64>
642 return %float_result, %double_result : vector<2xf32>, vector<2xf64>
644 // CHECK-LABEL: func @expm1_vec_caller(
645 // CHECK-SAME: %[[VAL_0:.*]]: vector<2xf32>,
646 // CHECK-SAME: %[[VAL_1:.*]]: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
647 // CHECK-DAG: %[[CVF:.*]] = arith.constant dense<0.000000e+00> : vector<2xf32>
648 // CHECK-DAG: %[[CVD:.*]] = arith.constant dense<0.000000e+00> : vector<2xf64>
649 // CHECK: %[[IN0_F32:.*]] = vector.extract %[[VAL_0]][0] : f32 from vector<2xf32>
650 // CHECK: %[[OUT0_F32:.*]] = call @expm1f(%[[IN0_F32]]) : (f32) -> f32
651 // CHECK: %[[VAL_8:.*]] = vector.insert %[[OUT0_F32]], %[[CVF]] [0] : f32 into vector<2xf32>
652 // CHECK: %[[IN1_F32:.*]] = vector.extract %[[VAL_0]][1] : f32 from vector<2xf32>
653 // CHECK: %[[OUT1_F32:.*]] = call @expm1f(%[[IN1_F32]]) : (f32) -> f32
654 // CHECK: %[[VAL_11:.*]] = vector.insert %[[OUT1_F32]], %[[VAL_8]] [1] : f32 into vector<2xf32>
655 // CHECK: %[[IN0_F64:.*]] = vector.extract %[[VAL_1]][0] : f64 from vector<2xf64>
656 // CHECK: %[[OUT0_F64:.*]] = call @expm1(%[[IN0_F64]]) : (f64) -> f64
657 // CHECK: %[[VAL_14:.*]] = vector.insert %[[OUT0_F64]], %[[CVD]] [0] : f64 into vector<2xf64>
658 // CHECK: %[[IN1_F64:.*]] = vector.extract %[[VAL_1]][1] : f64 from vector<2xf64>
659 // CHECK: %[[OUT1_F64:.*]] = call @expm1(%[[IN1_F64]]) : (f64) -> f64
660 // CHECK: %[[VAL_17:.*]] = vector.insert %[[OUT1_F64]], %[[VAL_14]] [1] : f64 into vector<2xf64>
661 // CHECK: return %[[VAL_11]], %[[VAL_17]] : vector<2xf32>, vector<2xf64>
664 func.func @expm1_multidim_vec_caller(%float: vector<2x2xf32>) -> (vector<2x2xf32>) {
665 %result = math.expm1 %float : vector<2x2xf32>
666 return %result : vector<2x2xf32>
668 // CHECK-LABEL: func @expm1_multidim_vec_caller(
669 // CHECK-SAME: %[[VAL:.*]]: vector<2x2xf32>
670 // CHECK-DAG: %[[CVF:.*]] = arith.constant dense<0.000000e+00> : vector<2x2xf32>
671 // CHECK: %[[IN0_0_F32:.*]] = vector.extract %[[VAL]][0, 0] : f32 from vector<2x2xf32>
672 // CHECK: %[[OUT0_0_F32:.*]] = call @expm1f(%[[IN0_0_F32]]) : (f32) -> f32
673 // CHECK: %[[VAL_1:.*]] = vector.insert %[[OUT0_0_F32]], %[[CVF]] [0, 0] : f32 into vector<2x2xf32>
674 // CHECK: %[[IN0_1_F32:.*]] = vector.extract %[[VAL]][0, 1] : f32 from vector<2x2xf32>
675 // CHECK: %[[OUT0_1_F32:.*]] = call @expm1f(%[[IN0_1_F32]]) : (f32) -> f32
676 // CHECK: %[[VAL_2:.*]] = vector.insert %[[OUT0_1_F32]], %[[VAL_1]] [0, 1] : f32 into vector<2x2xf32>
677 // CHECK: %[[IN1_0_F32:.*]] = vector.extract %[[VAL]][1, 0] : f32 from vector<2x2xf32>
678 // CHECK: %[[OUT1_0_F32:.*]] = call @expm1f(%[[IN1_0_F32]]) : (f32) -> f32
679 // CHECK: %[[VAL_3:.*]] = vector.insert %[[OUT1_0_F32]], %[[VAL_2]] [1, 0] : f32 into vector<2x2xf32>
680 // CHECK: %[[IN1_1_F32:.*]] = vector.extract %[[VAL]][1, 1] : f32 from vector<2x2xf32>
681 // CHECK: %[[OUT1_1_F32:.*]] = call @expm1f(%[[IN1_1_F32]]) : (f32) -> f32
682 // CHECK: %[[VAL_4:.*]] = vector.insert %[[OUT1_1_F32]], %[[VAL_3]] [1, 1] : f32 into vector<2x2xf32>
683 // CHECK: return %[[VAL_4]] : vector<2x2xf32>
686 // CHECK-LABEL: func @fma_caller(
687 // CHECK-SAME: %[[FLOATA:.*]]: f32, %[[FLOATB:.*]]: f32, %[[FLOATC:.*]]: f32
688 // CHECK-SAME: %[[DOUBLEA:.*]]: f64, %[[DOUBLEB:.*]]: f64, %[[DOUBLEC:.*]]: f64
689 func.func @fma_caller(%float_a: f32, %float_b: f32, %float_c: f32, %double_a: f64, %double_b: f64, %double_c: f64) -> (f32, f64) {
690 // CHECK-DAG: %[[FLOAT_RESULT:.*]] = call @fmaf(%[[FLOATA]], %[[FLOATB]], %[[FLOATC]]) : (f32, f32, f32) -> f32
691 %float_result = math.fma %float_a, %float_b, %float_c : f32
692 // CHECK-DAG: %[[DOUBLE_RESULT:.*]] = call @fma(%[[DOUBLEA]], %[[DOUBLEB]], %[[DOUBLEC]]) : (f64, f64, f64) -> f64
693 %double_result = math.fma %double_a, %double_b, %double_c : f64
694 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
695 return %float_result, %double_result : f32, f64
698 func.func @fma_vec_caller(%float_a: vector<2xf32>, %float_b: vector<2xf32>, %float_c: vector<2xf32>, %double_a: vector<2xf64>, %double_b: vector<2xf64>, %double_c: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
699 %float_result = math.fma %float_a, %float_b, %float_c : vector<2xf32>
700 %double_result = math.fma %double_a, %double_b, %double_c : vector<2xf64>
701 return %float_result, %double_result : vector<2xf32>, vector<2xf64>
703 // CHECK-LABEL: func @fma_vec_caller(
704 // CHECK-SAME: %[[VAL_0A:.*]]: vector<2xf32>, %[[VAL_0B:.*]]: vector<2xf32>, %[[VAL_0C:.*]]: vector<2xf32>,
705 // CHECK-SAME: %[[VAL_1A:.*]]: vector<2xf64>, %[[VAL_1B:.*]]: vector<2xf64>, %[[VAL_1C:.*]]: vector<2xf64>
706 // CHECK-SAME: ) -> (vector<2xf32>, vector<2xf64>) {
707 // CHECK-DAG: %[[CVF:.*]] = arith.constant dense<0.000000e+00> : vector<2xf32>
708 // CHECK-DAG: %[[CVD:.*]] = arith.constant dense<0.000000e+00> : vector<2xf64>
709 // CHECK: %[[IN0_F32A:.*]] = vector.extract %[[VAL_0A]][0] : f32 from vector<2xf32>
710 // CHECK: %[[IN0_F32B:.*]] = vector.extract %[[VAL_0B]][0] : f32 from vector<2xf32>
711 // CHECK: %[[IN0_F32C:.*]] = vector.extract %[[VAL_0C]][0] : f32 from vector<2xf32>
712 // CHECK: %[[OUT0_F32:.*]] = call @fmaf(%[[IN0_F32A]], %[[IN0_F32B]], %[[IN0_F32C]]) : (f32, f32, f32) -> f32
713 // CHECK: %[[VAL_8:.*]] = vector.insert %[[OUT0_F32]], %[[CVF]] [0] : f32 into vector<2xf32>
714 // CHECK: %[[IN1_F32A:.*]] = vector.extract %[[VAL_0A]][1] : f32 from vector<2xf32>
715 // CHECK: %[[IN1_F32B:.*]] = vector.extract %[[VAL_0B]][1] : f32 from vector<2xf32>
716 // CHECK: %[[IN1_F32C:.*]] = vector.extract %[[VAL_0C]][1] : f32 from vector<2xf32>
717 // CHECK: %[[OUT1_F32:.*]] = call @fmaf(%[[IN1_F32A]], %[[IN1_F32B]], %[[IN1_F32C]]) : (f32, f32, f32) -> f32
718 // CHECK: %[[VAL_11:.*]] = vector.insert %[[OUT1_F32]], %[[VAL_8]] [1] : f32 into vector<2xf32>
719 // CHECK: %[[IN0_F64A:.*]] = vector.extract %[[VAL_1A]][0] : f64 from vector<2xf64>
720 // CHECK: %[[IN0_F64B:.*]] = vector.extract %[[VAL_1B]][0] : f64 from vector<2xf64>
721 // CHECK: %[[IN0_F64C:.*]] = vector.extract %[[VAL_1C]][0] : f64 from vector<2xf64>
722 // CHECK: %[[OUT0_F64:.*]] = call @fma(%[[IN0_F64A]], %[[IN0_F64B]], %[[IN0_F64C]]) : (f64, f64, f64) -> f64
723 // CHECK: %[[VAL_14:.*]] = vector.insert %[[OUT0_F64]], %[[CVD]] [0] : f64 into vector<2xf64>
724 // CHECK: %[[IN1_F64A:.*]] = vector.extract %[[VAL_1A]][1] : f64 from vector<2xf64>
725 // CHECK: %[[IN1_F64B:.*]] = vector.extract %[[VAL_1B]][1] : f64 from vector<2xf64>
726 // CHECK: %[[IN1_F64C:.*]] = vector.extract %[[VAL_1C]][1] : f64 from vector<2xf64>
727 // CHECK: %[[OUT1_F64:.*]] = call @fma(%[[IN1_F64A]], %[[IN1_F64B]], %[[IN1_F64C]]) : (f64, f64, f64) -> f64
728 // CHECK: %[[VAL_17:.*]] = vector.insert %[[OUT1_F64]], %[[VAL_14]] [1] : f64 into vector<2xf64>
729 // CHECK: return %[[VAL_11]], %[[VAL_17]] : vector<2xf32>, vector<2xf64>
732 // CHECK-LABEL: func @round_caller
733 // CHECK-SAME: %[[FLOAT:.*]]: f32
734 // CHECK-SAME: %[[DOUBLE:.*]]: f64
735 func.func @round_caller(%float: f32, %double: f64) -> (f32, f64) {
736 // CHECK-DAG: %[[FLOAT_RESULT:.*]] = call @roundf(%[[FLOAT]]) : (f32) -> f32
737 %float_result = math.round %float : f32
738 // CHECK-DAG: %[[DOUBLE_RESULT:.*]] = call @round(%[[DOUBLE]]) : (f64) -> f64
739 %double_result = math.round %double : f64
740 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
741 return %float_result, %double_result : f32, f64
744 // CHECK-LABEL: func @roundeven_caller
745 // CHECK-SAME: %[[FLOAT:.*]]: f32
746 // CHECK-SAME: %[[DOUBLE:.*]]: f64
747 func.func @roundeven_caller(%float: f32, %double: f64) -> (f32, f64) {
748 // CHECK-DAG: %[[FLOAT_RESULT:.*]] = call @roundevenf(%[[FLOAT]]) : (f32) -> f32
749 %float_result = math.roundeven %float : f32
750 // CHECK-DAG: %[[DOUBLE_RESULT:.*]] = call @roundeven(%[[DOUBLE]]) : (f64) -> f64
751 %double_result = math.roundeven %double : f64
752 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
753 return %float_result, %double_result : f32, f64
756 // CHECK-LABEL: func @trunc_caller
757 // CHECK-SAME: %[[FLOAT:.*]]: f32
758 // CHECK-SAME: %[[DOUBLE:.*]]: f64
759 func.func @trunc_caller(%float: f32, %double: f64) -> (f32, f64) {
760 // CHECK-DAG: %[[FLOAT_RESULT:.*]] = call @truncf(%[[FLOAT]]) : (f32) -> f32
761 %float_result = math.trunc %float : f32
762 // CHECK-DAG: %[[DOUBLE_RESULT:.*]] = call @trunc(%[[DOUBLE]]) : (f64) -> f64
763 %double_result = math.trunc %double : f64
764 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
765 return %float_result, %double_result : f32, f64
768 // CHECK-LABEL: func @cbrt_caller
769 // CHECK-SAME: %[[FLOAT:.*]]: f32
770 // CHECK-SAME: %[[DOUBLE:.*]]: f64
771 func.func @cbrt_caller(%float: f32, %double: f64, %half: f16, %bfloat: bf16,
772 %float_vec: vector<2xf32>) -> (f32, f64, f16, bf16, vector<2xf32>) {
773 // CHECK: %[[FLOAT_RESULT:.*]] = call @cbrtf(%[[FLOAT]]) : (f32) -> f32
774 %float_result = math.cbrt %float : f32
775 // CHECK: %[[DOUBLE_RESULT:.*]] = call @cbrt(%[[DOUBLE]]) : (f64) -> f64
776 %double_result = math.cbrt %double : f64
777 // Just check that these lower successfully:
778 // CHECK: call @cbrtf
779 %half_result = math.cbrt %half : f16
780 // CHECK: call @cbrtf
781 %bfloat_result = math.cbrt %bfloat : bf16
782 // CHECK: call @cbrtf
783 %vec_result = math.cbrt %float_vec : vector<2xf32>
784 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
785 return %float_result, %double_result, %half_result, %bfloat_result, %vec_result
786 : f32, f64, f16, bf16, vector<2xf32>
789 // CHECK-LABEL: func @cos_caller
790 // CHECK-SAME: %[[FLOAT:.*]]: f32
791 // CHECK-SAME: %[[DOUBLE:.*]]: f64
792 func.func @cos_caller(%float: f32, %double: f64) -> (f32, f64) {
793 // CHECK-DAG: %[[FLOAT_RESULT:.*]] = call @cosf(%[[FLOAT]]) : (f32) -> f32
794 %float_result = math.cos %float : f32
795 // CHECK-DAG: %[[DOUBLE_RESULT:.*]] = call @cos(%[[DOUBLE]]) : (f64) -> f64
796 %double_result = math.cos %double : f64
797 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
798 return %float_result, %double_result : f32, f64
801 // CHECK-LABEL: func @sin_caller
802 // CHECK-SAME: %[[FLOAT:.*]]: f32
803 // CHECK-SAME: %[[DOUBLE:.*]]: f64
804 func.func @sin_caller(%float: f32, %double: f64) -> (f32, f64) {
805 // CHECK-DAG: %[[FLOAT_RESULT:.*]] = call @sinf(%[[FLOAT]]) : (f32) -> f32
806 %float_result = math.sin %float : f32
807 // CHECK-DAG: %[[DOUBLE_RESULT:.*]] = call @sin(%[[DOUBLE]]) : (f64) -> f64
808 %double_result = math.sin %double : f64
809 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
810 return %float_result, %double_result : f32, f64
813 // CHECK-LABEL: func @round_vec_caller(
814 // CHECK-SAME: %[[VAL_0:.*]]: vector<2xf32>,
815 // CHECK-SAME: %[[VAL_1:.*]]: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
816 func.func @round_vec_caller(%float: vector<2xf32>, %double: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
817 // CHECK-DAG: %[[CVF:.*]] = arith.constant dense<0.000000e+00> : vector<2xf32>
818 // CHECK-DAG: %[[CVD:.*]] = arith.constant dense<0.000000e+00> : vector<2xf64>
819 // CHECK: %[[IN0_F32:.*]] = vector.extract %[[VAL_0]][0] : f32 from vector<2xf32>
820 // CHECK: %[[OUT0_F32:.*]] = call @roundf(%[[IN0_F32]]) : (f32) -> f32
821 // CHECK: %[[VAL_8:.*]] = vector.insert %[[OUT0_F32]], %[[CVF]] [0] : f32 into vector<2xf32>
822 // CHECK: %[[IN1_F32:.*]] = vector.extract %[[VAL_0]][1] : f32 from vector<2xf32>
823 // CHECK: %[[OUT1_F32:.*]] = call @roundf(%[[IN1_F32]]) : (f32) -> f32
824 // CHECK: %[[VAL_11:.*]] = vector.insert %[[OUT1_F32]], %[[VAL_8]] [1] : f32 into vector<2xf32>
825 %float_result = math.round %float : vector<2xf32>
826 // CHECK: %[[IN0_F64:.*]] = vector.extract %[[VAL_1]][0] : f64 from vector<2xf64>
827 // CHECK: %[[OUT0_F64:.*]] = call @round(%[[IN0_F64]]) : (f64) -> f64
828 // CHECK: %[[VAL_14:.*]] = vector.insert %[[OUT0_F64]], %[[CVD]] [0] : f64 into vector<2xf64>
829 // CHECK: %[[IN1_F64:.*]] = vector.extract %[[VAL_1]][1] : f64 from vector<2xf64>
830 // CHECK: %[[OUT1_F64:.*]] = call @round(%[[IN1_F64]]) : (f64) -> f64
831 // CHECK: %[[VAL_17:.*]] = vector.insert %[[OUT1_F64]], %[[VAL_14]] [1] : f64 into vector<2xf64>
832 %double_result = math.round %double : vector<2xf64>
833 // CHECK: return %[[VAL_11]], %[[VAL_17]] : vector<2xf32>, vector<2xf64>
834 return %float_result, %double_result : vector<2xf32>, vector<2xf64>
837 // CHECK-LABEL: func @roundeven_vec_caller(
838 // CHECK-SAME: %[[VAL_0:.*]]: vector<2xf32>,
839 // CHECK-SAME: %[[VAL_1:.*]]: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
840 func.func @roundeven_vec_caller(%float: vector<2xf32>, %double: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
841 // CHECK-DAG: %[[CVF:.*]] = arith.constant dense<0.000000e+00> : vector<2xf32>
842 // CHECK-DAG: %[[CVD:.*]] = arith.constant dense<0.000000e+00> : vector<2xf64>
843 // CHECK: %[[IN0_F32:.*]] = vector.extract %[[VAL_0]][0] : f32 from vector<2xf32>
844 // CHECK: %[[OUT0_F32:.*]] = call @roundevenf(%[[IN0_F32]]) : (f32) -> f32
845 // CHECK: %[[VAL_8:.*]] = vector.insert %[[OUT0_F32]], %[[CVF]] [0] : f32 into vector<2xf32>
846 // CHECK: %[[IN1_F32:.*]] = vector.extract %[[VAL_0]][1] : f32 from vector<2xf32>
847 // CHECK: %[[OUT1_F32:.*]] = call @roundevenf(%[[IN1_F32]]) : (f32) -> f32
848 // CHECK: %[[VAL_11:.*]] = vector.insert %[[OUT1_F32]], %[[VAL_8]] [1] : f32 into vector<2xf32>
849 %float_result = math.roundeven %float : vector<2xf32>
850 // CHECK: %[[IN0_F64:.*]] = vector.extract %[[VAL_1]][0] : f64 from vector<2xf64>
851 // CHECK: %[[OUT0_F64:.*]] = call @roundeven(%[[IN0_F64]]) : (f64) -> f64
852 // CHECK: %[[VAL_14:.*]] = vector.insert %[[OUT0_F64]], %[[CVD]] [0] : f64 into vector<2xf64>
853 // CHECK: %[[IN1_F64:.*]] = vector.extract %[[VAL_1]][1] : f64 from vector<2xf64>
854 // CHECK: %[[OUT1_F64:.*]] = call @roundeven(%[[IN1_F64]]) : (f64) -> f64
855 // CHECK: %[[VAL_17:.*]] = vector.insert %[[OUT1_F64]], %[[VAL_14]] [1] : f64 into vector<2xf64>
856 %double_result = math.roundeven %double : vector<2xf64>
857 // CHECK: return %[[VAL_11]], %[[VAL_17]] : vector<2xf32>, vector<2xf64>
858 return %float_result, %double_result : vector<2xf32>, vector<2xf64>
861 // CHECK-LABEL: func @trunc_vec_caller(
862 // CHECK-SAME: %[[VAL_0:.*]]: vector<2xf32>,
863 // CHECK-SAME: %[[VAL_1:.*]]: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
864 func.func @trunc_vec_caller(%float: vector<2xf32>, %double: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
865 // CHECK-DAG: %[[CVF:.*]] = arith.constant dense<0.000000e+00> : vector<2xf32>
866 // CHECK-DAG: %[[CVD:.*]] = arith.constant dense<0.000000e+00> : vector<2xf64>
867 // CHECK: %[[IN0_F32:.*]] = vector.extract %[[VAL_0]][0] : f32 from vector<2xf32>
868 // CHECK: %[[OUT0_F32:.*]] = call @truncf(%[[IN0_F32]]) : (f32) -> f32
869 // CHECK: %[[VAL_8:.*]] = vector.insert %[[OUT0_F32]], %[[CVF]] [0] : f32 into vector<2xf32>
870 // CHECK: %[[IN1_F32:.*]] = vector.extract %[[VAL_0]][1] : f32 from vector<2xf32>
871 // CHECK: %[[OUT1_F32:.*]] = call @truncf(%[[IN1_F32]]) : (f32) -> f32
872 // CHECK: %[[VAL_11:.*]] = vector.insert %[[OUT1_F32]], %[[VAL_8]] [1] : f32 into vector<2xf32>
873 %float_result = math.trunc %float : vector<2xf32>
874 // CHECK: %[[IN0_F64:.*]] = vector.extract %[[VAL_1]][0] : f64 from vector<2xf64>
875 // CHECK: %[[OUT0_F64:.*]] = call @trunc(%[[IN0_F64]]) : (f64) -> f64
876 // CHECK: %[[VAL_14:.*]] = vector.insert %[[OUT0_F64]], %[[CVD]] [0] : f64 into vector<2xf64>
877 // CHECK: %[[IN1_F64:.*]] = vector.extract %[[VAL_1]][1] : f64 from vector<2xf64>
878 // CHECK: %[[OUT1_F64:.*]] = call @trunc(%[[IN1_F64]]) : (f64) -> f64
879 // CHECK: %[[VAL_17:.*]] = vector.insert %[[OUT1_F64]], %[[VAL_14]] [1] : f64 into vector<2xf64>
880 %double_result = math.trunc %double : vector<2xf64>
881 // CHECK: return %[[VAL_11]], %[[VAL_17]] : vector<2xf32>, vector<2xf64>
882 return %float_result, %double_result : vector<2xf32>, vector<2xf64>
885 // CHECK-LABEL: func @tan_caller
886 // CHECK-SAME: %[[FLOAT:.*]]: f32
887 // CHECK-SAME: %[[DOUBLE:.*]]: f64
888 // CHECK-SAME: %[[HALF:.*]]: f16
889 // CHECK-SAME: %[[BFLOAT:.*]]: bf16
890 func.func @tan_caller(%float: f32, %double: f64, %half: f16, %bfloat: bf16) -> (f32, f64, f16, bf16) {
891 // CHECK: %[[FLOAT_RESULT:.*]] = call @tanf(%[[FLOAT]]) : (f32) -> f32
892 %float_result = math.tan %float : f32
893 // CHECK: %[[DOUBLE_RESULT:.*]] = call @tan(%[[DOUBLE]]) : (f64) -> f64
894 %double_result = math.tan %double : f64
895 // CHECK: %[[HALF_PROMOTED:.*]] = arith.extf %[[HALF]] : f16 to f32
896 // CHECK: %[[HALF_CALL:.*]] = call @tanf(%[[HALF_PROMOTED]]) : (f32) -> f32
897 // CHECK: %[[HALF_RESULT:.*]] = arith.truncf %[[HALF_CALL]] : f32 to f16
898 %half_result = math.tan %half : f16
899 // CHECK: %[[BFLOAT_PROMOTED:.*]] = arith.extf %[[BFLOAT]] : bf16 to f32
900 // CHECK: %[[BFLOAT_CALL:.*]] = call @tanf(%[[BFLOAT_PROMOTED]]) : (f32) -> f32
901 // CHECK: %[[BFLOAT_RESULT:.*]] = arith.truncf %[[BFLOAT_CALL]] : f32 to bf16
902 %bfloat_result = math.tan %bfloat : bf16
903 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]], %[[HALF_RESULT]], %[[BFLOAT_RESULT]]
904 return %float_result, %double_result, %half_result, %bfloat_result : f32, f64, f16, bf16
907 // CHECK-LABEL: func @tan_vec_caller(
908 // CHECK-SAME: %[[VAL_0:.*]]: vector<2xf32>,
909 // CHECK-SAME: %[[VAL_1:.*]]: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
910 // CHECK-DAG: %[[CVF:.*]] = arith.constant dense<0.000000e+00> : vector<2xf32>
911 // CHECK-DAG: %[[CVD:.*]] = arith.constant dense<0.000000e+00> : vector<2xf64>
912 // CHECK: %[[IN0_F32:.*]] = vector.extract %[[VAL_0]][0] : f32 from vector<2xf32>
913 // CHECK: %[[OUT0_F32:.*]] = call @tanf(%[[IN0_F32]]) : (f32) -> f32
914 // CHECK: %[[VAL_8:.*]] = vector.insert %[[OUT0_F32]], %[[CVF]] [0] : f32 into vector<2xf32>
915 // CHECK: %[[IN1_F32:.*]] = vector.extract %[[VAL_0]][1] : f32 from vector<2xf32>
916 // CHECK: %[[OUT1_F32:.*]] = call @tanf(%[[IN1_F32]]) : (f32) -> f32
917 // CHECK: %[[VAL_11:.*]] = vector.insert %[[OUT1_F32]], %[[VAL_8]] [1] : f32 into vector<2xf32>
918 // CHECK: %[[IN0_F64:.*]] = vector.extract %[[VAL_1]][0] : f64 from vector<2xf64>
919 // CHECK: %[[OUT0_F64:.*]] = call @tan(%[[IN0_F64]]) : (f64) -> f64
920 // CHECK: %[[VAL_14:.*]] = vector.insert %[[OUT0_F64]], %[[CVD]] [0] : f64 into vector<2xf64>
921 // CHECK: %[[IN1_F64:.*]] = vector.extract %[[VAL_1]][1] : f64 from vector<2xf64>
922 // CHECK: %[[OUT1_F64:.*]] = call @tan(%[[IN1_F64]]) : (f64) -> f64
923 // CHECK: %[[VAL_17:.*]] = vector.insert %[[OUT1_F64]], %[[VAL_14]] [1] : f64 into vector<2xf64>
924 // CHECK: return %[[VAL_11]], %[[VAL_17]] : vector<2xf32>, vector<2xf64>
926 func.func @tan_vec_caller(%float: vector<2xf32>, %double: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
927 %float_result = math.tan %float : vector<2xf32>
928 %double_result = math.tan %double : vector<2xf64>
929 return %float_result, %double_result : vector<2xf32>, vector<2xf64>
932 // CHECK-LABEL: func @log1p_caller
933 // CHECK-SAME: %[[FLOAT:.*]]: f32
934 // CHECK-SAME: %[[DOUBLE:.*]]: f64
935 func.func @log1p_caller(%float: f32, %double: f64) -> (f32, f64) {
936 // CHECK-DAG: %[[FLOAT_RESULT:.*]] = call @log1pf(%[[FLOAT]]) : (f32) -> f32
937 %float_result = math.log1p %float : f32
938 // CHECK-DAG: %[[DOUBLE_RESULT:.*]] = call @log1p(%[[DOUBLE]]) : (f64) -> f64
939 %double_result = math.log1p %double : f64
940 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
941 return %float_result, %double_result : f32, f64
944 // CHECK-LABEL: func @floor_caller
945 // CHECK-SAME: %[[FLOAT:.*]]: f32
946 // CHECK-SAME: %[[DOUBLE:.*]]: f64
947 func.func @floor_caller(%float: f32, %double: f64) -> (f32, f64) {
948 // CHECK-DAG: %[[FLOAT_RESULT:.*]] = call @floorf(%[[FLOAT]]) : (f32) -> f32
949 %float_result = math.floor %float : f32
950 // CHECK-DAG: %[[DOUBLE_RESULT:.*]] = call @floor(%[[DOUBLE]]) : (f64) -> f64
951 %double_result = math.floor %double : f64
952 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
953 return %float_result, %double_result : f32, f64
956 // CHECK-LABEL: func @ceil_caller
957 // CHECK-SAME: %[[FLOAT:.*]]: f32
958 // CHECK-SAME: %[[DOUBLE:.*]]: f64
959 func.func @ceil_caller(%float: f32, %double: f64) -> (f32, f64) {
960 // CHECK-DAG: %[[FLOAT_RESULT:.*]] = call @ceilf(%[[FLOAT]]) : (f32) -> f32
961 %float_result = math.ceil %float : f32
962 // CHECK-DAG: %[[DOUBLE_RESULT:.*]] = call @ceil(%[[DOUBLE]]) : (f64) -> f64
963 %double_result = math.ceil %double : f64
964 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
965 return %float_result, %double_result : f32, f64
968 // CHECK-LABEL: func @sqrt_caller
969 // CHECK-SAME: %[[FLOAT:.*]]: f32
970 // CHECK-SAME: %[[DOUBLE:.*]]: f64
971 func.func @sqrt_caller(%float: f32, %double: f64) -> (f32, f64) {
972 // CHECK-DAG: %[[FLOAT_RESULT:.*]] = call @sqrtf(%[[FLOAT]]) : (f32) -> f32
973 %float_result = math.sqrt %float : f32
974 // CHECK-DAG: %[[DOUBLE_RESULT:.*]] = call @sqrt(%[[DOUBLE]]) : (f64) -> f64
975 %double_result = math.sqrt %double : f64
976 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
977 return %float_result, %double_result : f32, f64
980 func.func @sqrt_vec_caller(%float: vector<2xf32>, %double: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
981 %float_result = math.sqrt %float : vector<2xf32>
982 %double_result = math.sqrt %double : vector<2xf64>
983 return %float_result, %double_result : vector<2xf32>, vector<2xf64>
985 // CHECK-LABEL: func @sqrt_vec_caller(
986 // CHECK-SAME: %[[VAL_0:.*]]: vector<2xf32>,
987 // CHECK-SAME: %[[VAL_1:.*]]: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
988 // CHECK-DAG: %[[CVF:.*]] = arith.constant dense<0.000000e+00> : vector<2xf32>
989 // CHECK-DAG: %[[CVD:.*]] = arith.constant dense<0.000000e+00> : vector<2xf64>
990 // CHECK: %[[IN0_F32:.*]] = vector.extract %[[VAL_0]][0] : f32 from vector<2xf32>
991 // CHECK: %[[OUT0_F32:.*]] = call @sqrtf(%[[IN0_F32]]) : (f32) -> f32
992 // CHECK: %[[VAL_8:.*]] = vector.insert %[[OUT0_F32]], %[[CVF]] [0] : f32 into vector<2xf32>
993 // CHECK: %[[IN1_F32:.*]] = vector.extract %[[VAL_0]][1] : f32 from vector<2xf32>
994 // CHECK: %[[OUT1_F32:.*]] = call @sqrtf(%[[IN1_F32]]) : (f32) -> f32
995 // CHECK: %[[VAL_11:.*]] = vector.insert %[[OUT1_F32]], %[[VAL_8]] [1] : f32 into vector<2xf32>
996 // CHECK: %[[IN0_F64:.*]] = vector.extract %[[VAL_1]][0] : f64 from vector<2xf64>
997 // CHECK: %[[OUT0_F64:.*]] = call @sqrt(%[[IN0_F64]]) : (f64) -> f64
998 // CHECK: %[[VAL_14:.*]] = vector.insert %[[OUT0_F64]], %[[CVD]] [0] : f64 into vector<2xf64>
999 // CHECK: %[[IN1_F64:.*]] = vector.extract %[[VAL_1]][1] : f64 from vector<2xf64>
1000 // CHECK: %[[OUT1_F64:.*]] = call @sqrt(%[[IN1_F64]]) : (f64) -> f64
1001 // CHECK: %[[VAL_17:.*]] = vector.insert %[[OUT1_F64]], %[[VAL_14]] [1] : f64 into vector<2xf64>
1002 // CHECK: return %[[VAL_11]], %[[VAL_17]] : vector<2xf32>, vector<2xf64>
1005 // CHECK-LABEL: func @rsqrt_caller
1006 // CHECK-SAME: %[[FLOAT:.*]]: f32
1007 // CHECK-SAME: %[[DOUBLE:.*]]: f64
1008 func.func @rsqrt_caller(%float: f32, %double: f64) -> (f32, f64) {
1009 // CHECK-DAG: %[[FLOAT_RESULT:.*]] = call @rsqrtf(%[[FLOAT]]) : (f32) -> f32
1010 %float_result = math.rsqrt %float : f32
1011 // CHECK-DAG: %[[DOUBLE_RESULT:.*]] = call @rsqrt(%[[DOUBLE]]) : (f64) -> f64
1012 %double_result = math.rsqrt %double : f64
1013 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
1014 return %float_result, %double_result : f32, f64
1017 func.func @rsqrt_vec_caller(%float: vector<2xf32>, %double: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
1018 %float_result = math.rsqrt %float : vector<2xf32>
1019 %double_result = math.rsqrt %double : vector<2xf64>
1020 return %float_result, %double_result : vector<2xf32>, vector<2xf64>
1022 // CHECK-LABEL: func @rsqrt_vec_caller(
1023 // CHECK-SAME: %[[VAL_0:.*]]: vector<2xf32>,
1024 // CHECK-SAME: %[[VAL_1:.*]]: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
1025 // CHECK-DAG: %[[CVF:.*]] = arith.constant dense<0.000000e+00> : vector<2xf32>
1026 // CHECK-DAG: %[[CVD:.*]] = arith.constant dense<0.000000e+00> : vector<2xf64>
1027 // CHECK: %[[IN0_F32:.*]] = vector.extract %[[VAL_0]][0] : f32 from vector<2xf32>
1028 // CHECK: %[[OUT0_F32:.*]] = call @rsqrtf(%[[IN0_F32]]) : (f32) -> f32
1029 // CHECK: %[[VAL_8:.*]] = vector.insert %[[OUT0_F32]], %[[CVF]] [0] : f32 into vector<2xf32>
1030 // CHECK: %[[IN1_F32:.*]] = vector.extract %[[VAL_0]][1] : f32 from vector<2xf32>
1031 // CHECK: %[[OUT1_F32:.*]] = call @rsqrtf(%[[IN1_F32]]) : (f32) -> f32
1032 // CHECK: %[[VAL_11:.*]] = vector.insert %[[OUT1_F32]], %[[VAL_8]] [1] : f32 into vector<2xf32>
1033 // CHECK: %[[IN0_F64:.*]] = vector.extract %[[VAL_1]][0] : f64 from vector<2xf64>
1034 // CHECK: %[[OUT0_F64:.*]] = call @rsqrt(%[[IN0_F64]]) : (f64) -> f64
1035 // CHECK: %[[VAL_14:.*]] = vector.insert %[[OUT0_F64]], %[[CVD]] [0] : f64 into vector<2xf64>
1036 // CHECK: %[[IN1_F64:.*]] = vector.extract %[[VAL_1]][1] : f64 from vector<2xf64>
1037 // CHECK: %[[OUT1_F64:.*]] = call @rsqrt(%[[IN1_F64]]) : (f64) -> f64
1038 // CHECK: %[[VAL_17:.*]] = vector.insert %[[OUT1_F64]], %[[VAL_14]] [1] : f64 into vector<2xf64>
1039 // CHECK: return %[[VAL_11]], %[[VAL_17]] : vector<2xf32>, vector<2xf64>
1042 // CHECK-LABEL: func @powf_caller(
1043 // CHECK-SAME: %[[FLOATA:.*]]: f32, %[[FLOATB:.*]]: f32
1044 // CHECK-SAME: %[[DOUBLEA:.*]]: f64, %[[DOUBLEB:.*]]: f64
1045 func.func @powf_caller(%float_a: f32, %float_b: f32, %double_a: f64, %double_b: f64) -> (f32, f64) {
1046 // CHECK-DAG: %[[FLOAT_RESULT:.*]] = call @powf(%[[FLOATA]], %[[FLOATB]]) : (f32, f32) -> f32
1047 %float_result = math.powf %float_a, %float_b : f32
1048 // CHECK-DAG: %[[DOUBLE_RESULT:.*]] = call @pow(%[[DOUBLEA]], %[[DOUBLEB]]) : (f64, f64) -> f64
1049 %double_result = math.powf %double_a, %double_b : f64
1050 // CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
1051 return %float_result, %double_result : f32, f64
1054 func.func @powf_vec_caller(%float_a: vector<2xf32>, %float_b: vector<2xf32>, %double_a: vector<2xf64>, %double_b: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
1055 %float_result = math.powf %float_a, %float_b : vector<2xf32>
1056 %double_result = math.powf %double_a, %double_b : vector<2xf64>
1057 return %float_result, %double_result : vector<2xf32>, vector<2xf64>
1059 // CHECK-LABEL: func @powf_vec_caller(
1060 // CHECK-SAME: %[[VAL_0A:.*]]: vector<2xf32>, %[[VAL_0B:.*]]: vector<2xf32>,
1061 // CHECK-SAME: %[[VAL_1A:.*]]: vector<2xf64>, %[[VAL_1B:.*]]: vector<2xf64>
1062 // CHECK-SAME: ) -> (vector<2xf32>, vector<2xf64>) {
1063 // CHECK-DAG: %[[CVF:.*]] = arith.constant dense<0.000000e+00> : vector<2xf32>
1064 // CHECK-DAG: %[[CVD:.*]] = arith.constant dense<0.000000e+00> : vector<2xf64>
1065 // CHECK: %[[IN0_F32A:.*]] = vector.extract %[[VAL_0A]][0] : f32 from vector<2xf32>
1066 // CHECK: %[[IN0_F32B:.*]] = vector.extract %[[VAL_0B]][0] : f32 from vector<2xf32>
1067 // CHECK: %[[OUT0_F32:.*]] = call @powf(%[[IN0_F32A]], %[[IN0_F32B]]) : (f32, f32) -> f32
1068 // CHECK: %[[VAL_8:.*]] = vector.insert %[[OUT0_F32]], %[[CVF]] [0] : f32 into vector<2xf32>
1069 // CHECK: %[[IN1_F32A:.*]] = vector.extract %[[VAL_0A]][1] : f32 from vector<2xf32>
1070 // CHECK: %[[IN1_F32B:.*]] = vector.extract %[[VAL_0B]][1] : f32 from vector<2xf32>
1071 // CHECK: %[[OUT1_F32:.*]] = call @powf(%[[IN1_F32A]], %[[IN1_F32B]]) : (f32, f32) -> f32
1072 // CHECK: %[[VAL_11:.*]] = vector.insert %[[OUT1_F32]], %[[VAL_8]] [1] : f32 into vector<2xf32>
1073 // CHECK: %[[IN0_F64A:.*]] = vector.extract %[[VAL_1A]][0] : f64 from vector<2xf64>
1074 // CHECK: %[[IN0_F64B:.*]] = vector.extract %[[VAL_1B]][0] : f64 from vector<2xf64>
1075 // CHECK: %[[OUT0_F64:.*]] = call @pow(%[[IN0_F64A]], %[[IN0_F64B]]) : (f64, f64) -> f64
1076 // CHECK: %[[VAL_14:.*]] = vector.insert %[[OUT0_F64]], %[[CVD]] [0] : f64 into vector<2xf64>
1077 // CHECK: %[[IN1_F64A:.*]] = vector.extract %[[VAL_1A]][1] : f64 from vector<2xf64>
1078 // CHECK: %[[IN1_F64B:.*]] = vector.extract %[[VAL_1B]][1] : f64 from vector<2xf64>
1079 // CHECK: %[[OUT1_F64:.*]] = call @pow(%[[IN1_F64A]], %[[IN1_F64B]]) : (f64, f64) -> f64
1080 // CHECK: %[[VAL_17:.*]] = vector.insert %[[OUT1_F64]], %[[VAL_14]] [1] : f64 into vector<2xf64>
1081 // CHECK: return %[[VAL_11]], %[[VAL_17]] : vector<2xf32>, vector<2xf64>