1 // RUN: split-file %s %t
2 // TODO: verify that Fast-Math Flags and 'strictfp' are properly set.
5 // RUN: fir-opt %t/abs_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/abs_fast.fir
6 // CHECK: @_QPtest_real4
7 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.fabs({{%[A-Za-z0-9._]+}}) : (f32) -> f32
9 // CHECK: @_QPtest_real8
10 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.fabs({{%[A-Za-z0-9._]+}}) : (f64) -> f64
12 // CHECK: @_QPtest_real16
13 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.fabs({{%[A-Za-z0-9._]+}}) : (f128) -> f128
15 // CHECK: @_QPtest_complex4
16 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @hypotf({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, f32) -> f32
18 // CHECK: @_QPtest_complex8
19 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @hypot({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, f64) -> f64
21 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
22 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
23 %1 = fir.load %arg0 : !fir.ref<f32>
24 %2 = math.absf %1 : f32
25 fir.store %2 to %0 : !fir.ref<f32>
26 %3 = fir.load %0 : !fir.ref<f32>
29 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
30 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
31 %1 = fir.load %arg0 : !fir.ref<f64>
32 %2 = math.absf %1 : f64
33 fir.store %2 to %0 : !fir.ref<f64>
34 %3 = fir.load %0 : !fir.ref<f64>
37 func.func @_QPtest_real16(%arg0: !fir.ref<f128> {fir.bindc_name = "x"}) -> f128 {
38 %0 = fir.alloca f128 {bindc_name = "test_real16", uniq_name = "_QFtest_real16Etest_real16"}
39 %1 = fir.load %arg0 : !fir.ref<f128>
40 %2 = math.absf %1 : f128
41 fir.store %2 to %0 : !fir.ref<f128>
42 %3 = fir.load %0 : !fir.ref<f128>
45 func.func @_QPtest_complex4(%arg0: !fir.ref<!fir.complex<4>> {fir.bindc_name = "c"}) -> !fir.complex<4> {
46 %0 = fir.alloca !fir.complex<4> {bindc_name = "test_complex4", uniq_name = "_QFtest_complex4Etest_complex4"}
47 %1 = fir.load %arg0 : !fir.ref<!fir.complex<4>>
48 %2 = fir.extract_value %1, [0 : index] : (!fir.complex<4>) -> f32
49 %3 = fir.extract_value %1, [1 : index] : (!fir.complex<4>) -> f32
50 %4 = fir.call @hypotf(%2, %3) : (f32, f32) -> f32
51 %cst = arith.constant 0.000000e+00 : f32
52 %5 = fir.undefined !fir.complex<4>
53 %6 = fir.insert_value %5, %4, [0 : index] : (!fir.complex<4>, f32) -> !fir.complex<4>
54 %7 = fir.insert_value %6, %cst, [1 : index] : (!fir.complex<4>, f32) -> !fir.complex<4>
55 fir.store %7 to %0 : !fir.ref<!fir.complex<4>>
56 %8 = fir.load %0 : !fir.ref<!fir.complex<4>>
57 return %8 : !fir.complex<4>
59 func.func @_QPtest_complex8(%arg0: !fir.ref<!fir.complex<8>> {fir.bindc_name = "c"}) -> !fir.complex<8> {
60 %0 = fir.alloca !fir.complex<8> {bindc_name = "test_complex8", uniq_name = "_QFtest_complex8Etest_complex8"}
61 %1 = fir.load %arg0 : !fir.ref<!fir.complex<8>>
62 %2 = fir.extract_value %1, [0 : index] : (!fir.complex<8>) -> f64
63 %3 = fir.extract_value %1, [1 : index] : (!fir.complex<8>) -> f64
64 %4 = fir.call @hypot(%2, %3) : (f64, f64) -> f64
65 %cst = arith.constant 0.000000e+00 : f64
66 %5 = fir.undefined !fir.complex<8>
67 %6 = fir.insert_value %5, %4, [0 : index] : (!fir.complex<8>, f64) -> !fir.complex<8>
68 %7 = fir.insert_value %6, %cst, [1 : index] : (!fir.complex<8>, f64) -> !fir.complex<8>
69 fir.store %7 to %0 : !fir.ref<!fir.complex<8>>
70 %8 = fir.load %0 : !fir.ref<!fir.complex<8>>
71 return %8 : !fir.complex<8>
73 func.func private @hypotf(f32, f32) -> f32
74 func.func private @hypot(f64, f64) -> f64
77 // RUN: fir-opt %t/abs_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/abs_relaxed.fir
78 // CHECK: @_QPtest_real4
79 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.fabs({{%[A-Za-z0-9._]+}}) : (f32) -> f32
81 // CHECK: @_QPtest_real8
82 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.fabs({{%[A-Za-z0-9._]+}}) : (f64) -> f64
84 // CHECK: @_QPtest_real16
85 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.fabs({{%[A-Za-z0-9._]+}}) : (f128) -> f128
87 // CHECK: @_QPtest_complex4
88 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @hypotf({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, f32) -> f32
90 // CHECK: @_QPtest_complex8
91 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @hypot({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, f64) -> f64
93 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
94 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
95 %1 = fir.load %arg0 : !fir.ref<f32>
96 %2 = math.absf %1 : f32
97 fir.store %2 to %0 : !fir.ref<f32>
98 %3 = fir.load %0 : !fir.ref<f32>
101 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
102 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
103 %1 = fir.load %arg0 : !fir.ref<f64>
104 %2 = math.absf %1 : f64
105 fir.store %2 to %0 : !fir.ref<f64>
106 %3 = fir.load %0 : !fir.ref<f64>
109 func.func @_QPtest_real16(%arg0: !fir.ref<f128> {fir.bindc_name = "x"}) -> f128 {
110 %0 = fir.alloca f128 {bindc_name = "test_real16", uniq_name = "_QFtest_real16Etest_real16"}
111 %1 = fir.load %arg0 : !fir.ref<f128>
112 %2 = math.absf %1 : f128
113 fir.store %2 to %0 : !fir.ref<f128>
114 %3 = fir.load %0 : !fir.ref<f128>
117 func.func @_QPtest_complex4(%arg0: !fir.ref<!fir.complex<4>> {fir.bindc_name = "c"}) -> !fir.complex<4> {
118 %0 = fir.alloca !fir.complex<4> {bindc_name = "test_complex4", uniq_name = "_QFtest_complex4Etest_complex4"}
119 %1 = fir.load %arg0 : !fir.ref<!fir.complex<4>>
120 %2 = fir.extract_value %1, [0 : index] : (!fir.complex<4>) -> f32
121 %3 = fir.extract_value %1, [1 : index] : (!fir.complex<4>) -> f32
122 %4 = fir.call @hypotf(%2, %3) : (f32, f32) -> f32
123 %cst = arith.constant 0.000000e+00 : f32
124 %5 = fir.undefined !fir.complex<4>
125 %6 = fir.insert_value %5, %4, [0 : index] : (!fir.complex<4>, f32) -> !fir.complex<4>
126 %7 = fir.insert_value %6, %cst, [1 : index] : (!fir.complex<4>, f32) -> !fir.complex<4>
127 fir.store %7 to %0 : !fir.ref<!fir.complex<4>>
128 %8 = fir.load %0 : !fir.ref<!fir.complex<4>>
129 return %8 : !fir.complex<4>
131 func.func @_QPtest_complex8(%arg0: !fir.ref<!fir.complex<8>> {fir.bindc_name = "c"}) -> !fir.complex<8> {
132 %0 = fir.alloca !fir.complex<8> {bindc_name = "test_complex8", uniq_name = "_QFtest_complex8Etest_complex8"}
133 %1 = fir.load %arg0 : !fir.ref<!fir.complex<8>>
134 %2 = fir.extract_value %1, [0 : index] : (!fir.complex<8>) -> f64
135 %3 = fir.extract_value %1, [1 : index] : (!fir.complex<8>) -> f64
136 %4 = fir.call @hypot(%2, %3) : (f64, f64) -> f64
137 %cst = arith.constant 0.000000e+00 : f64
138 %5 = fir.undefined !fir.complex<8>
139 %6 = fir.insert_value %5, %4, [0 : index] : (!fir.complex<8>, f64) -> !fir.complex<8>
140 %7 = fir.insert_value %6, %cst, [1 : index] : (!fir.complex<8>, f64) -> !fir.complex<8>
141 fir.store %7 to %0 : !fir.ref<!fir.complex<8>>
142 %8 = fir.load %0 : !fir.ref<!fir.complex<8>>
143 return %8 : !fir.complex<8>
145 func.func private @hypotf(f32, f32) -> f32
146 func.func private @hypot(f64, f64) -> f64
148 //--- abs_precise.fir
149 // RUN: fir-opt %t/abs_precise.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/abs_precise.fir
150 // CHECK: @_QPtest_real4
151 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @fabsf({{%[A-Za-z0-9._]+}}) : (f32) -> f32
153 // CHECK: @_QPtest_real8
154 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @fabs({{%[A-Za-z0-9._]+}}) : (f64) -> f64
156 // CHECK: @_QPtest_real16
157 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.fabs.f128({{%[A-Za-z0-9._]+}}) : (f128) -> f128
159 // CHECK: @_QPtest_complex4
160 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @hypotf({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, f32) -> f32
162 // CHECK: @_QPtest_complex8
163 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @hypot({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, f64) -> f64
165 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
166 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
167 %1 = fir.load %arg0 : !fir.ref<f32>
168 %2 = fir.call @fabsf(%1) : (f32) -> f32
169 fir.store %2 to %0 : !fir.ref<f32>
170 %3 = fir.load %0 : !fir.ref<f32>
173 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
174 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
175 %1 = fir.load %arg0 : !fir.ref<f64>
176 %2 = fir.call @fabs(%1) : (f64) -> f64
177 fir.store %2 to %0 : !fir.ref<f64>
178 %3 = fir.load %0 : !fir.ref<f64>
181 func.func @_QPtest_real16(%arg0: !fir.ref<f128> {fir.bindc_name = "x"}) -> f128 {
182 %0 = fir.alloca f128 {bindc_name = "test_real16", uniq_name = "_QFtest_real16Etest_real16"}
183 %1 = fir.load %arg0 : !fir.ref<f128>
184 %2 = fir.call @llvm.fabs.f128(%1) : (f128) -> f128
185 fir.store %2 to %0 : !fir.ref<f128>
186 %3 = fir.load %0 : !fir.ref<f128>
189 func.func @_QPtest_complex4(%arg0: !fir.ref<!fir.complex<4>> {fir.bindc_name = "c"}) -> !fir.complex<4> {
190 %0 = fir.alloca !fir.complex<4> {bindc_name = "test_complex4", uniq_name = "_QFtest_complex4Etest_complex4"}
191 %1 = fir.load %arg0 : !fir.ref<!fir.complex<4>>
192 %2 = fir.extract_value %1, [0 : index] : (!fir.complex<4>) -> f32
193 %3 = fir.extract_value %1, [1 : index] : (!fir.complex<4>) -> f32
194 %4 = fir.call @hypotf(%2, %3) : (f32, f32) -> f32
195 %cst = arith.constant 0.000000e+00 : f32
196 %5 = fir.undefined !fir.complex<4>
197 %6 = fir.insert_value %5, %4, [0 : index] : (!fir.complex<4>, f32) -> !fir.complex<4>
198 %7 = fir.insert_value %6, %cst, [1 : index] : (!fir.complex<4>, f32) -> !fir.complex<4>
199 fir.store %7 to %0 : !fir.ref<!fir.complex<4>>
200 %8 = fir.load %0 : !fir.ref<!fir.complex<4>>
201 return %8 : !fir.complex<4>
203 func.func @_QPtest_complex8(%arg0: !fir.ref<!fir.complex<8>> {fir.bindc_name = "c"}) -> !fir.complex<8> {
204 %0 = fir.alloca !fir.complex<8> {bindc_name = "test_complex8", uniq_name = "_QFtest_complex8Etest_complex8"}
205 %1 = fir.load %arg0 : !fir.ref<!fir.complex<8>>
206 %2 = fir.extract_value %1, [0 : index] : (!fir.complex<8>) -> f64
207 %3 = fir.extract_value %1, [1 : index] : (!fir.complex<8>) -> f64
208 %4 = fir.call @hypot(%2, %3) : (f64, f64) -> f64
209 %cst = arith.constant 0.000000e+00 : f64
210 %5 = fir.undefined !fir.complex<8>
211 %6 = fir.insert_value %5, %4, [0 : index] : (!fir.complex<8>, f64) -> !fir.complex<8>
212 %7 = fir.insert_value %6, %cst, [1 : index] : (!fir.complex<8>, f64) -> !fir.complex<8>
213 fir.store %7 to %0 : !fir.ref<!fir.complex<8>>
214 %8 = fir.load %0 : !fir.ref<!fir.complex<8>>
215 return %8 : !fir.complex<8>
217 func.func private @fabsf(f32) -> f32
218 func.func private @fabs(f64) -> f64
219 func.func private @llvm.fabs.f128(f128) -> f128
220 func.func private @hypotf(f32, f32) -> f32
221 func.func private @hypot(f64, f64) -> f64
224 // RUN: fir-opt %t/aint_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/aint_fast.fir
225 // CHECK: @_QPtest_real4
226 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.trunc.f32({{%[A-Za-z0-9._]+}}) : (f32) -> f32
228 // CHECK: @_QPtest_real8
229 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.trunc.f64({{%[A-Za-z0-9._]+}}) : (f64) -> f64
231 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
232 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
233 %1 = fir.load %arg0 : !fir.ref<f32>
234 %2 = fir.call @llvm.trunc.f32(%1) : (f32) -> f32
235 fir.store %2 to %0 : !fir.ref<f32>
236 %3 = fir.load %0 : !fir.ref<f32>
239 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
240 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
241 %1 = fir.load %arg0 : !fir.ref<f64>
242 %2 = fir.call @llvm.trunc.f64(%1) : (f64) -> f64
243 fir.store %2 to %0 : !fir.ref<f64>
244 %3 = fir.load %0 : !fir.ref<f64>
247 func.func private @llvm.trunc.f32(f32) -> f32
248 func.func private @llvm.trunc.f64(f64) -> f64
250 //--- aint_relaxed.fir
251 // RUN: fir-opt %t/aint_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/aint_relaxed.fir
252 // CHECK: @_QPtest_real4
253 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.trunc.f32({{%[A-Za-z0-9._]+}}) : (f32) -> f32
255 // CHECK: @_QPtest_real8
256 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.trunc.f64({{%[A-Za-z0-9._]+}}) : (f64) -> f64
258 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
259 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
260 %1 = fir.load %arg0 : !fir.ref<f32>
261 %2 = fir.call @llvm.trunc.f32(%1) : (f32) -> f32
262 fir.store %2 to %0 : !fir.ref<f32>
263 %3 = fir.load %0 : !fir.ref<f32>
266 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
267 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
268 %1 = fir.load %arg0 : !fir.ref<f64>
269 %2 = fir.call @llvm.trunc.f64(%1) : (f64) -> f64
270 fir.store %2 to %0 : !fir.ref<f64>
271 %3 = fir.load %0 : !fir.ref<f64>
274 func.func private @llvm.trunc.f32(f32) -> f32
275 func.func private @llvm.trunc.f64(f64) -> f64
277 //--- aint_precise.fir
278 // RUN: fir-opt %t/aint_precise.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/aint_precise.fir
279 // CHECK: @_QPtest_real4
280 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.trunc.f32({{%[A-Za-z0-9._]+}}) : (f32) -> f32
282 // CHECK: @_QPtest_real8
283 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.trunc.f64({{%[A-Za-z0-9._]+}}) : (f64) -> f64
285 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
286 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
287 %1 = fir.load %arg0 : !fir.ref<f32>
288 %2 = fir.call @llvm.trunc.f32(%1) : (f32) -> f32
289 fir.store %2 to %0 : !fir.ref<f32>
290 %3 = fir.load %0 : !fir.ref<f32>
293 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
294 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
295 %1 = fir.load %arg0 : !fir.ref<f64>
296 %2 = fir.call @llvm.trunc.f64(%1) : (f64) -> f64
297 fir.store %2 to %0 : !fir.ref<f64>
298 %3 = fir.load %0 : !fir.ref<f64>
301 func.func private @llvm.trunc.f32(f32) -> f32
302 func.func private @llvm.trunc.f64(f64) -> f64
305 // RUN: fir-opt %t/anint_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/anint_fast.fir
306 // CHECK: @_QPtest_real4
307 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.round({{%[A-Za-z0-9._]+}}) : (f32) -> f32
309 // CHECK: @_QPtest_real8
310 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.round({{%[A-Za-z0-9._]+}}) : (f64) -> f64
312 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
313 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
314 %1 = fir.load %arg0 : !fir.ref<f32>
315 %2 = llvm.intr.round(%1) : (f32) -> f32
316 fir.store %2 to %0 : !fir.ref<f32>
317 %3 = fir.load %0 : !fir.ref<f32>
320 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
321 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
322 %1 = fir.load %arg0 : !fir.ref<f64>
323 %2 = llvm.intr.round(%1) : (f64) -> f64
324 fir.store %2 to %0 : !fir.ref<f64>
325 %3 = fir.load %0 : !fir.ref<f64>
329 //--- anint_relaxed.fir
330 // RUN: fir-opt %t/anint_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/anint_relaxed.fir
331 // CHECK: @_QPtest_real4
332 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.round({{%[A-Za-z0-9._]+}}) : (f32) -> f32
334 // CHECK: @_QPtest_real8
335 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.round({{%[A-Za-z0-9._]+}}) : (f64) -> f64
337 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
338 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
339 %1 = fir.load %arg0 : !fir.ref<f32>
340 %2 = llvm.intr.round(%1) : (f32) -> f32
341 fir.store %2 to %0 : !fir.ref<f32>
342 %3 = fir.load %0 : !fir.ref<f32>
345 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
346 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
347 %1 = fir.load %arg0 : !fir.ref<f64>
348 %2 = llvm.intr.round(%1) : (f64) -> f64
349 fir.store %2 to %0 : !fir.ref<f64>
350 %3 = fir.load %0 : !fir.ref<f64>
354 //--- anint_precise.fir
355 // RUN: fir-opt %t/anint_precise.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/anint_precise.fir
356 // CHECK: @_QPtest_real4
357 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.round.f32({{%[A-Za-z0-9._]+}}) : (f32) -> f32
359 // CHECK: @_QPtest_real8
360 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.round.f64({{%[A-Za-z0-9._]+}}) : (f64) -> f64
362 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
363 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
364 %1 = fir.load %arg0 : !fir.ref<f32>
365 %2 = fir.call @llvm.round.f32(%1) : (f32) -> f32
366 fir.store %2 to %0 : !fir.ref<f32>
367 %3 = fir.load %0 : !fir.ref<f32>
370 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
371 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
372 %1 = fir.load %arg0 : !fir.ref<f64>
373 %2 = fir.call @llvm.round.f64(%1) : (f64) -> f64
374 fir.store %2 to %0 : !fir.ref<f64>
375 %3 = fir.load %0 : !fir.ref<f64>
378 func.func private @llvm.round.f32(f32) -> f32
379 func.func private @llvm.round.f64(f64) -> f64
382 // RUN: fir-opt %t/atan_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/atan_fast.fir
383 // CHECK: @_QPtest_real4
384 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @atanf({{%[A-Za-z0-9._]+}}) : (f32) -> f32
386 // CHECK: @_QPtest_real8
387 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @atan({{%[A-Za-z0-9._]+}}) : (f64) -> f64
389 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
390 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
391 %1 = fir.load %arg0 : !fir.ref<f32>
392 %2 = math.atan %1 : f32
393 fir.store %2 to %0 : !fir.ref<f32>
394 %3 = fir.load %0 : !fir.ref<f32>
397 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
398 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
399 %1 = fir.load %arg0 : !fir.ref<f64>
400 %2 = math.atan %1 : f64
401 fir.store %2 to %0 : !fir.ref<f64>
402 %3 = fir.load %0 : !fir.ref<f64>
406 //--- atan_relaxed.fir
407 // RUN: fir-opt %t/atan_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/atan_relaxed.fir
408 // CHECK: @_QPtest_real4
409 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @atanf({{%[A-Za-z0-9._]+}}) : (f32) -> f32
411 // CHECK: @_QPtest_real8
412 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @atan({{%[A-Za-z0-9._]+}}) : (f64) -> f64
414 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
415 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
416 %1 = fir.load %arg0 : !fir.ref<f32>
417 %2 = math.atan %1 : f32
418 fir.store %2 to %0 : !fir.ref<f32>
419 %3 = fir.load %0 : !fir.ref<f32>
422 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
423 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
424 %1 = fir.load %arg0 : !fir.ref<f64>
425 %2 = math.atan %1 : f64
426 fir.store %2 to %0 : !fir.ref<f64>
427 %3 = fir.load %0 : !fir.ref<f64>
431 //--- atan_precise.fir
432 // RUN: fir-opt %t/atan_precise.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/atan_precise.fir
433 // CHECK: @_QPtest_real4
434 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @atanf({{%[A-Za-z0-9._]+}}) : (f32) -> f32
436 // CHECK: @_QPtest_real8
437 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @atan({{%[A-Za-z0-9._]+}}) : (f64) -> f64
439 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
440 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
441 %1 = fir.load %arg0 : !fir.ref<f32>
442 %2 = fir.call @atanf(%1) : (f32) -> f32
443 fir.store %2 to %0 : !fir.ref<f32>
444 %3 = fir.load %0 : !fir.ref<f32>
447 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
448 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
449 %1 = fir.load %arg0 : !fir.ref<f64>
450 %2 = fir.call @atan(%1) : (f64) -> f64
451 fir.store %2 to %0 : !fir.ref<f64>
452 %3 = fir.load %0 : !fir.ref<f64>
455 func.func private @atanf(f32) -> f32
456 func.func private @atan(f64) -> f64
459 // RUN: fir-opt %t/atan2_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/atan2_fast.fir
460 // CHECK: @_QPtest_real4
461 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @atan2f({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, f32) -> f32
463 // CHECK: @_QPtest_real8
464 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @atan2({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, f64) -> f64
466 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}, %arg1: !fir.ref<f32> {fir.bindc_name = "y"}) -> f32 {
467 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
468 %1 = fir.load %arg0 : !fir.ref<f32>
469 %2 = fir.load %arg1 : !fir.ref<f32>
470 %3 = math.atan2 %1, %2 : f32
471 fir.store %3 to %0 : !fir.ref<f32>
472 %4 = fir.load %0 : !fir.ref<f32>
475 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}, %arg1: !fir.ref<f64> {fir.bindc_name = "y"}) -> f64 {
476 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
477 %1 = fir.load %arg0 : !fir.ref<f64>
478 %2 = fir.load %arg1 : !fir.ref<f64>
479 %3 = math.atan2 %1, %2 : f64
480 fir.store %3 to %0 : !fir.ref<f64>
481 %4 = fir.load %0 : !fir.ref<f64>
485 //--- atan2_relaxed.fir
486 // RUN: fir-opt %t/atan2_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/atan2_relaxed.fir
487 // CHECK: @_QPtest_real4
488 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @atan2f({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, f32) -> f32
490 // CHECK: @_QPtest_real8
491 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @atan2({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, f64) -> f64
493 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}, %arg1: !fir.ref<f32> {fir.bindc_name = "y"}) -> f32 {
494 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
495 %1 = fir.load %arg0 : !fir.ref<f32>
496 %2 = fir.load %arg1 : !fir.ref<f32>
497 %3 = math.atan2 %1, %2 : f32
498 fir.store %3 to %0 : !fir.ref<f32>
499 %4 = fir.load %0 : !fir.ref<f32>
502 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}, %arg1: !fir.ref<f64> {fir.bindc_name = "y"}) -> f64 {
503 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
504 %1 = fir.load %arg0 : !fir.ref<f64>
505 %2 = fir.load %arg1 : !fir.ref<f64>
506 %3 = math.atan2 %1, %2 : f64
507 fir.store %3 to %0 : !fir.ref<f64>
508 %4 = fir.load %0 : !fir.ref<f64>
512 //--- atan2_precise.fir
513 // RUN: fir-opt %t/atan2_precise.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/atan2_precise.fir
514 // CHECK: @_QPtest_real4
515 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @atan2f({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, f32) -> f32
517 // CHECK: @_QPtest_real8
518 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @atan2({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, f64) -> f64
520 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}, %arg1: !fir.ref<f32> {fir.bindc_name = "y"}) -> f32 {
521 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
522 %1 = fir.load %arg0 : !fir.ref<f32>
523 %2 = fir.load %arg1 : !fir.ref<f32>
524 %3 = fir.call @atan2f(%1, %2) : (f32, f32) -> f32
525 fir.store %3 to %0 : !fir.ref<f32>
526 %4 = fir.load %0 : !fir.ref<f32>
529 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}, %arg1: !fir.ref<f64> {fir.bindc_name = "y"}) -> f64 {
530 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
531 %1 = fir.load %arg0 : !fir.ref<f64>
532 %2 = fir.load %arg1 : !fir.ref<f64>
533 %3 = fir.call @atan2(%1, %2) : (f64, f64) -> f64
534 fir.store %3 to %0 : !fir.ref<f64>
535 %4 = fir.load %0 : !fir.ref<f64>
538 func.func private @atan2f(f32, f32) -> f32
539 func.func private @atan2(f64, f64) -> f64
541 //--- ceiling_fast.fir
542 // RUN: fir-opt %t/ceiling_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/ceiling_fast.fir
543 // CHECK: @_QPtest_real4
544 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.ceil({{%[A-Za-z0-9._]+}}) : (f32) -> f32
546 // CHECK: @_QPtest_real8
547 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.ceil({{%[A-Za-z0-9._]+}}) : (f64) -> f64
549 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
550 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
551 %1 = fir.load %arg0 : !fir.ref<f32>
552 %2 = math.ceil %1 : f32
553 %3 = fir.convert %2 : (f32) -> i32
554 %4 = fir.convert %3 : (i32) -> f32
555 fir.store %4 to %0 : !fir.ref<f32>
556 %5 = fir.load %0 : !fir.ref<f32>
559 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
560 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
561 %1 = fir.load %arg0 : !fir.ref<f64>
562 %2 = math.ceil %1 : f64
563 %3 = fir.convert %2 : (f64) -> i32
564 %4 = fir.convert %3 : (i32) -> f64
565 fir.store %4 to %0 : !fir.ref<f64>
566 %5 = fir.load %0 : !fir.ref<f64>
570 //--- ceiling_relaxed.fir
571 // RUN: fir-opt %t/ceiling_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/ceiling_relaxed.fir
572 // CHECK: @_QPtest_real4
573 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.ceil({{%[A-Za-z0-9._]+}}) : (f32) -> f32
575 // CHECK: @_QPtest_real8
576 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.ceil({{%[A-Za-z0-9._]+}}) : (f64) -> f64
578 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
579 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
580 %1 = fir.load %arg0 : !fir.ref<f32>
581 %2 = math.ceil %1 : f32
582 %3 = fir.convert %2 : (f32) -> i32
583 %4 = fir.convert %3 : (i32) -> f32
584 fir.store %4 to %0 : !fir.ref<f32>
585 %5 = fir.load %0 : !fir.ref<f32>
588 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
589 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
590 %1 = fir.load %arg0 : !fir.ref<f64>
591 %2 = math.ceil %1 : f64
592 %3 = fir.convert %2 : (f64) -> i32
593 %4 = fir.convert %3 : (i32) -> f64
594 fir.store %4 to %0 : !fir.ref<f64>
595 %5 = fir.load %0 : !fir.ref<f64>
599 //--- ceiling_precise.fir
600 // RUN: fir-opt %t/ceiling_precise.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/ceiling_precise.fir
601 // CHECK: @_QPtest_real4
602 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @ceilf({{%[A-Za-z0-9._]+}}) : (f32) -> f32
604 // CHECK: @_QPtest_real8
605 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @ceil({{%[A-Za-z0-9._]+}}) : (f64) -> f64
607 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
608 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
609 %1 = fir.load %arg0 : !fir.ref<f32>
610 %2 = fir.call @ceilf(%1) : (f32) -> f32
611 %3 = fir.convert %2 : (f32) -> i32
612 %4 = fir.convert %3 : (i32) -> f32
613 fir.store %4 to %0 : !fir.ref<f32>
614 %5 = fir.load %0 : !fir.ref<f32>
617 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
618 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
619 %1 = fir.load %arg0 : !fir.ref<f64>
620 %2 = fir.call @ceil(%1) : (f64) -> f64
621 %3 = fir.convert %2 : (f64) -> i32
622 %4 = fir.convert %3 : (i32) -> f64
623 fir.store %4 to %0 : !fir.ref<f64>
624 %5 = fir.load %0 : !fir.ref<f64>
627 func.func private @ceilf(f32) -> f32
628 func.func private @ceil(f64) -> f64
631 // RUN: fir-opt %t/cos_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/cos_fast.fir
632 // CHECK: @_QPtest_real4
633 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.cos({{%[A-Za-z0-9._]+}}) : (f32) -> f32
635 // CHECK: @_QPtest_real8
636 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.cos({{%[A-Za-z0-9._]+}}) : (f64) -> f64
638 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
639 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
640 %1 = fir.load %arg0 : !fir.ref<f32>
641 %2 = math.cos %1 : f32
642 fir.store %2 to %0 : !fir.ref<f32>
643 %3 = fir.load %0 : !fir.ref<f32>
646 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
647 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
648 %1 = fir.load %arg0 : !fir.ref<f64>
649 %2 = math.cos %1 : f64
650 fir.store %2 to %0 : !fir.ref<f64>
651 %3 = fir.load %0 : !fir.ref<f64>
655 //--- cos_relaxed.fir
656 // RUN: fir-opt %t/cos_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/cos_relaxed.fir
657 // CHECK: @_QPtest_real4
658 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.cos({{%[A-Za-z0-9._]+}}) : (f32) -> f32
660 // CHECK: @_QPtest_real8
661 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.cos({{%[A-Za-z0-9._]+}}) : (f64) -> f64
663 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
664 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
665 %1 = fir.load %arg0 : !fir.ref<f32>
666 %2 = math.cos %1 : f32
667 fir.store %2 to %0 : !fir.ref<f32>
668 %3 = fir.load %0 : !fir.ref<f32>
671 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
672 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
673 %1 = fir.load %arg0 : !fir.ref<f64>
674 %2 = math.cos %1 : f64
675 fir.store %2 to %0 : !fir.ref<f64>
676 %3 = fir.load %0 : !fir.ref<f64>
680 //--- cos_precise.fir
681 // RUN: fir-opt %t/cos_precise.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/cos_precise.fir
682 // CHECK: @_QPtest_real4
683 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @cosf({{%[A-Za-z0-9._]+}}) : (f32) -> f32
685 // CHECK: @_QPtest_real8
686 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @cos({{%[A-Za-z0-9._]+}}) : (f64) -> f64
688 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
689 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
690 %1 = fir.load %arg0 : !fir.ref<f32>
691 %2 = fir.call @cosf(%1) : (f32) -> f32
692 fir.store %2 to %0 : !fir.ref<f32>
693 %3 = fir.load %0 : !fir.ref<f32>
696 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
697 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
698 %1 = fir.load %arg0 : !fir.ref<f64>
699 %2 = fir.call @cos(%1) : (f64) -> f64
700 fir.store %2 to %0 : !fir.ref<f64>
701 %3 = fir.load %0 : !fir.ref<f64>
704 func.func private @cosf(f32) -> f32
705 func.func private @cos(f64) -> f64
708 // RUN: fir-opt %t/cosh_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/cosh_fast.fir
709 // CHECK: @_QPtest_real4
710 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @coshf({{%[A-Za-z0-9._]+}}) : (f32) -> f32
712 // CHECK: @_QPtest_real8
713 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @cosh({{%[A-Za-z0-9._]+}}) : (f64) -> f64
715 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
716 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
717 %1 = fir.load %arg0 : !fir.ref<f32>
718 %2 = fir.call @coshf(%1) : (f32) -> f32
719 fir.store %2 to %0 : !fir.ref<f32>
720 %3 = fir.load %0 : !fir.ref<f32>
723 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
724 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
725 %1 = fir.load %arg0 : !fir.ref<f64>
726 %2 = fir.call @cosh(%1) : (f64) -> f64
727 fir.store %2 to %0 : !fir.ref<f64>
728 %3 = fir.load %0 : !fir.ref<f64>
731 func.func private @coshf(f32) -> f32
732 func.func private @cosh(f64) -> f64
734 //--- cosh_relaxed.fir
735 // RUN: fir-opt %t/cosh_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/cosh_relaxed.fir
736 // CHECK: @_QPtest_real4
737 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @coshf({{%[A-Za-z0-9._]+}}) : (f32) -> f32
739 // CHECK: @_QPtest_real8
740 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @cosh({{%[A-Za-z0-9._]+}}) : (f64) -> f64
742 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
743 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
744 %1 = fir.load %arg0 : !fir.ref<f32>
745 %2 = fir.call @coshf(%1) : (f32) -> f32
746 fir.store %2 to %0 : !fir.ref<f32>
747 %3 = fir.load %0 : !fir.ref<f32>
750 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
751 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
752 %1 = fir.load %arg0 : !fir.ref<f64>
753 %2 = fir.call @cosh(%1) : (f64) -> f64
754 fir.store %2 to %0 : !fir.ref<f64>
755 %3 = fir.load %0 : !fir.ref<f64>
758 func.func private @coshf(f32) -> f32
759 func.func private @cosh(f64) -> f64
761 //--- cosh_precise.fir
762 // RUN: fir-opt %t/cosh_precise.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/cosh_precise.fir
763 // CHECK: @_QPtest_real4
764 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @coshf({{%[A-Za-z0-9._]+}}) : (f32) -> f32
766 // CHECK: @_QPtest_real8
767 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @cosh({{%[A-Za-z0-9._]+}}) : (f64) -> f64
769 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
770 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
771 %1 = fir.load %arg0 : !fir.ref<f32>
772 %2 = fir.call @coshf(%1) : (f32) -> f32
773 fir.store %2 to %0 : !fir.ref<f32>
774 %3 = fir.load %0 : !fir.ref<f32>
777 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
778 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
779 %1 = fir.load %arg0 : !fir.ref<f64>
780 %2 = fir.call @cosh(%1) : (f64) -> f64
781 fir.store %2 to %0 : !fir.ref<f64>
782 %3 = fir.load %0 : !fir.ref<f64>
785 func.func private @coshf(f32) -> f32
786 func.func private @cosh(f64) -> f64
789 // RUN: fir-opt %t/erf_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/erf_fast.fir
790 // CHECK: @_QPtest_real4
791 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @erff({{%[A-Za-z0-9._]+}}) : (f32) -> f32
793 // CHECK: @_QPtest_real8
794 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @erf({{%[A-Za-z0-9._]+}}) : (f64) -> f64
796 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
797 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
798 %1 = fir.load %arg0 : !fir.ref<f32>
799 %2 = math.erf %1 : f32
800 fir.store %2 to %0 : !fir.ref<f32>
801 %3 = fir.load %0 : !fir.ref<f32>
804 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
805 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
806 %1 = fir.load %arg0 : !fir.ref<f64>
807 %2 = math.erf %1 : f64
808 fir.store %2 to %0 : !fir.ref<f64>
809 %3 = fir.load %0 : !fir.ref<f64>
813 //--- erf_relaxed.fir
814 // RUN: fir-opt %t/erf_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/erf_relaxed.fir
815 // CHECK: @_QPtest_real4
816 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @erff({{%[A-Za-z0-9._]+}}) : (f32) -> f32
818 // CHECK: @_QPtest_real8
819 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @erf({{%[A-Za-z0-9._]+}}) : (f64) -> f64
821 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
822 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
823 %1 = fir.load %arg0 : !fir.ref<f32>
824 %2 = math.erf %1 : f32
825 fir.store %2 to %0 : !fir.ref<f32>
826 %3 = fir.load %0 : !fir.ref<f32>
829 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
830 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
831 %1 = fir.load %arg0 : !fir.ref<f64>
832 %2 = math.erf %1 : f64
833 fir.store %2 to %0 : !fir.ref<f64>
834 %3 = fir.load %0 : !fir.ref<f64>
838 //--- erf_precise.fir
839 // RUN: fir-opt %t/erf_precise.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/erf_precise.fir
840 // CHECK: @_QPtest_real4
841 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @erff({{%[A-Za-z0-9._]+}}) : (f32) -> f32
843 // CHECK: @_QPtest_real8
844 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @erf({{%[A-Za-z0-9._]+}}) : (f64) -> f64
846 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
847 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
848 %1 = fir.load %arg0 : !fir.ref<f32>
849 %2 = fir.call @erff(%1) : (f32) -> f32
850 fir.store %2 to %0 : !fir.ref<f32>
851 %3 = fir.load %0 : !fir.ref<f32>
854 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
855 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
856 %1 = fir.load %arg0 : !fir.ref<f64>
857 %2 = fir.call @erf(%1) : (f64) -> f64
858 fir.store %2 to %0 : !fir.ref<f64>
859 %3 = fir.load %0 : !fir.ref<f64>
862 func.func private @erff(f32) -> f32
863 func.func private @erf(f64) -> f64
866 // RUN: fir-opt %t/exp_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/exp_fast.fir
867 // CHECK: @_QPtest_real4
868 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.exp({{%[A-Za-z0-9._]+}}) : (f32) -> f32
870 // CHECK: @_QPtest_real8
871 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.exp({{%[A-Za-z0-9._]+}}) : (f64) -> f64
873 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
874 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
875 %1 = fir.load %arg0 : !fir.ref<f32>
876 %2 = math.exp %1 : f32
877 fir.store %2 to %0 : !fir.ref<f32>
878 %3 = fir.load %0 : !fir.ref<f32>
881 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
882 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
883 %1 = fir.load %arg0 : !fir.ref<f64>
884 %2 = math.exp %1 : f64
885 fir.store %2 to %0 : !fir.ref<f64>
886 %3 = fir.load %0 : !fir.ref<f64>
890 //--- exp_relaxed.fir
891 // RUN: fir-opt %t/exp_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/exp_relaxed.fir
892 // CHECK: @_QPtest_real4
893 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.exp({{%[A-Za-z0-9._]+}}) : (f32) -> f32
895 // CHECK: @_QPtest_real8
896 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.exp({{%[A-Za-z0-9._]+}}) : (f64) -> f64
898 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
899 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
900 %1 = fir.load %arg0 : !fir.ref<f32>
901 %2 = math.exp %1 : f32
902 fir.store %2 to %0 : !fir.ref<f32>
903 %3 = fir.load %0 : !fir.ref<f32>
906 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
907 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
908 %1 = fir.load %arg0 : !fir.ref<f64>
909 %2 = math.exp %1 : f64
910 fir.store %2 to %0 : !fir.ref<f64>
911 %3 = fir.load %0 : !fir.ref<f64>
915 //--- exp_precise.fir
916 // RUN: fir-opt %t/exp_precise.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/exp_precise.fir
917 // CHECK: @_QPtest_real4
918 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @expf({{%[A-Za-z0-9._]+}}) : (f32) -> f32
920 // CHECK: @_QPtest_real8
921 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @exp({{%[A-Za-z0-9._]+}}) : (f64) -> f64
923 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
924 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
925 %1 = fir.load %arg0 : !fir.ref<f32>
926 %2 = fir.call @expf(%1) : (f32) -> f32
927 fir.store %2 to %0 : !fir.ref<f32>
928 %3 = fir.load %0 : !fir.ref<f32>
931 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
932 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
933 %1 = fir.load %arg0 : !fir.ref<f64>
934 %2 = fir.call @exp(%1) : (f64) -> f64
935 fir.store %2 to %0 : !fir.ref<f64>
936 %3 = fir.load %0 : !fir.ref<f64>
939 func.func private @expf(f32) -> f32
940 func.func private @exp(f64) -> f64
943 // RUN: fir-opt %t/floor_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/floor_fast.fir
944 // CHECK: @_QPtest_real4
945 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.floor({{%[A-Za-z0-9._]+}}) : (f32) -> f32
947 // CHECK: @_QPtest_real8
948 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.floor({{%[A-Za-z0-9._]+}}) : (f64) -> f64
950 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
951 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
952 %1 = fir.load %arg0 : !fir.ref<f32>
953 %2 = math.floor %1 : f32
954 %3 = fir.convert %2 : (f32) -> i32
955 %4 = fir.convert %3 : (i32) -> f32
956 fir.store %4 to %0 : !fir.ref<f32>
957 %5 = fir.load %0 : !fir.ref<f32>
960 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
961 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
962 %1 = fir.load %arg0 : !fir.ref<f64>
963 %2 = math.floor %1 : f64
964 %3 = fir.convert %2 : (f64) -> i32
965 %4 = fir.convert %3 : (i32) -> f64
966 fir.store %4 to %0 : !fir.ref<f64>
967 %5 = fir.load %0 : !fir.ref<f64>
971 //--- floor_relaxed.fir
972 // RUN: fir-opt %t/floor_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/floor_relaxed.fir
973 // CHECK: @_QPtest_real4
974 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.floor({{%[A-Za-z0-9._]+}}) : (f32) -> f32
976 // CHECK: @_QPtest_real8
977 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.floor({{%[A-Za-z0-9._]+}}) : (f64) -> f64
979 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
980 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
981 %1 = fir.load %arg0 : !fir.ref<f32>
982 %2 = math.floor %1 : f32
983 %3 = fir.convert %2 : (f32) -> i32
984 %4 = fir.convert %3 : (i32) -> f32
985 fir.store %4 to %0 : !fir.ref<f32>
986 %5 = fir.load %0 : !fir.ref<f32>
989 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
990 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
991 %1 = fir.load %arg0 : !fir.ref<f64>
992 %2 = math.floor %1 : f64
993 %3 = fir.convert %2 : (f64) -> i32
994 %4 = fir.convert %3 : (i32) -> f64
995 fir.store %4 to %0 : !fir.ref<f64>
996 %5 = fir.load %0 : !fir.ref<f64>
1000 //--- floor_precise.fir
1001 // RUN: fir-opt %t/floor_precise.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/floor_precise.fir
1002 // CHECK: @_QPtest_real4
1003 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @floorf({{%[A-Za-z0-9._]+}}) : (f32) -> f32
1005 // CHECK: @_QPtest_real8
1006 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @floor({{%[A-Za-z0-9._]+}}) : (f64) -> f64
1008 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
1009 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1010 %1 = fir.load %arg0 : !fir.ref<f32>
1011 %2 = fir.call @floorf(%1) : (f32) -> f32
1012 %3 = fir.convert %2 : (f32) -> i32
1013 %4 = fir.convert %3 : (i32) -> f32
1014 fir.store %4 to %0 : !fir.ref<f32>
1015 %5 = fir.load %0 : !fir.ref<f32>
1018 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
1019 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1020 %1 = fir.load %arg0 : !fir.ref<f64>
1021 %2 = fir.call @floor(%1) : (f64) -> f64
1022 %3 = fir.convert %2 : (f64) -> i32
1023 %4 = fir.convert %3 : (i32) -> f64
1024 fir.store %4 to %0 : !fir.ref<f64>
1025 %5 = fir.load %0 : !fir.ref<f64>
1028 func.func private @floorf(f32) -> f32
1029 func.func private @floor(f64) -> f64
1032 // RUN: fir-opt %t/log_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/log_fast.fir
1033 // CHECK: @_QPtest_real4
1034 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.log({{%[A-Za-z0-9._]+}}) : (f32) -> f32
1036 // CHECK: @_QPtest_real8
1037 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.log({{%[A-Za-z0-9._]+}}) : (f64) -> f64
1039 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
1040 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1041 %1 = fir.load %arg0 : !fir.ref<f32>
1042 %2 = math.log %1 : f32
1043 fir.store %2 to %0 : !fir.ref<f32>
1044 %3 = fir.load %0 : !fir.ref<f32>
1047 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
1048 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1049 %1 = fir.load %arg0 : !fir.ref<f64>
1050 %2 = math.log %1 : f64
1051 fir.store %2 to %0 : !fir.ref<f64>
1052 %3 = fir.load %0 : !fir.ref<f64>
1056 //--- log_relaxed.fir
1057 // RUN: fir-opt %t/log_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/log_relaxed.fir
1058 // CHECK: @_QPtest_real4
1059 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.log({{%[A-Za-z0-9._]+}}) : (f32) -> f32
1061 // CHECK: @_QPtest_real8
1062 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.log({{%[A-Za-z0-9._]+}}) : (f64) -> f64
1064 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
1065 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1066 %1 = fir.load %arg0 : !fir.ref<f32>
1067 %2 = math.log %1 : f32
1068 fir.store %2 to %0 : !fir.ref<f32>
1069 %3 = fir.load %0 : !fir.ref<f32>
1072 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
1073 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1074 %1 = fir.load %arg0 : !fir.ref<f64>
1075 %2 = math.log %1 : f64
1076 fir.store %2 to %0 : !fir.ref<f64>
1077 %3 = fir.load %0 : !fir.ref<f64>
1081 //--- log_precise.fir
1082 // RUN: fir-opt %t/log_precise.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/log_precise.fir
1083 // CHECK: @_QPtest_real4
1084 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @logf({{%[A-Za-z0-9._]+}}) : (f32) -> f32
1086 // CHECK: @_QPtest_real8
1087 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @log({{%[A-Za-z0-9._]+}}) : (f64) -> f64
1089 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
1090 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1091 %1 = fir.load %arg0 : !fir.ref<f32>
1092 %2 = fir.call @logf(%1) : (f32) -> f32
1093 fir.store %2 to %0 : !fir.ref<f32>
1094 %3 = fir.load %0 : !fir.ref<f32>
1097 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
1098 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1099 %1 = fir.load %arg0 : !fir.ref<f64>
1100 %2 = fir.call @log(%1) : (f64) -> f64
1101 fir.store %2 to %0 : !fir.ref<f64>
1102 %3 = fir.load %0 : !fir.ref<f64>
1105 func.func private @logf(f32) -> f32
1106 func.func private @log(f64) -> f64
1108 //--- log10_fast.fir
1109 // RUN: fir-opt %t/log10_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/log10_fast.fir
1110 // CHECK: @_QPtest_real4
1111 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.log10({{%[A-Za-z0-9._]+}}) : (f32) -> f32
1113 // CHECK: @_QPtest_real8
1114 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.log10({{%[A-Za-z0-9._]+}}) : (f64) -> f64
1116 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
1117 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1118 %1 = fir.load %arg0 : !fir.ref<f32>
1119 %2 = math.log10 %1 : f32
1120 fir.store %2 to %0 : !fir.ref<f32>
1121 %3 = fir.load %0 : !fir.ref<f32>
1124 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
1125 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1126 %1 = fir.load %arg0 : !fir.ref<f64>
1127 %2 = math.log10 %1 : f64
1128 fir.store %2 to %0 : !fir.ref<f64>
1129 %3 = fir.load %0 : !fir.ref<f64>
1133 //--- log10_relaxed.fir
1134 // RUN: fir-opt %t/log10_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/log10_relaxed.fir
1135 // CHECK: @_QPtest_real4
1136 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.log10({{%[A-Za-z0-9._]+}}) : (f32) -> f32
1138 // CHECK: @_QPtest_real8
1139 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.log10({{%[A-Za-z0-9._]+}}) : (f64) -> f64
1141 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
1142 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1143 %1 = fir.load %arg0 : !fir.ref<f32>
1144 %2 = math.log10 %1 : f32
1145 fir.store %2 to %0 : !fir.ref<f32>
1146 %3 = fir.load %0 : !fir.ref<f32>
1149 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
1150 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1151 %1 = fir.load %arg0 : !fir.ref<f64>
1152 %2 = math.log10 %1 : f64
1153 fir.store %2 to %0 : !fir.ref<f64>
1154 %3 = fir.load %0 : !fir.ref<f64>
1158 //--- log10_precise.fir
1159 // RUN: fir-opt %t/log10_precise.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/log10_precise.fir
1160 // CHECK: @_QPtest_real4
1161 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @log10f({{%[A-Za-z0-9._]+}}) : (f32) -> f32
1163 // CHECK: @_QPtest_real8
1164 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @log10({{%[A-Za-z0-9._]+}}) : (f64) -> f64
1166 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
1167 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1168 %1 = fir.load %arg0 : !fir.ref<f32>
1169 %2 = fir.call @log10f(%1) : (f32) -> f32
1170 fir.store %2 to %0 : !fir.ref<f32>
1171 %3 = fir.load %0 : !fir.ref<f32>
1174 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
1175 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1176 %1 = fir.load %arg0 : !fir.ref<f64>
1177 %2 = fir.call @log10(%1) : (f64) -> f64
1178 fir.store %2 to %0 : !fir.ref<f64>
1179 %3 = fir.load %0 : !fir.ref<f64>
1182 func.func private @log10f(f32) -> f32
1183 func.func private @log10(f64) -> f64
1186 // RUN: fir-opt %t/nint_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/nint_fast.fir
1187 // CHECK: @_QPtest_real4
1188 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.lround.i32.f32({{%[A-Za-z0-9._]+}}) : (f32) -> i32
1189 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.lround.i64.f32({{%[A-Za-z0-9._]+}}) : (f32) -> i64
1191 // CHECK: @_QPtest_real8
1192 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.lround.i32.f64({{%[A-Za-z0-9._]+}}) : (f64) -> i32
1193 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.lround.i64.f64({{%[A-Za-z0-9._]+}}) : (f64) -> i64
1195 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
1196 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1197 %1 = fir.load %arg0 : !fir.ref<f32>
1198 %2 = fir.call @llvm.lround.i32.f32(%1) : (f32) -> i32
1199 %3 = fir.convert %2 : (i32) -> i64
1200 %4 = fir.load %arg0 : !fir.ref<f32>
1201 %5 = fir.call @llvm.lround.i64.f32(%4) : (f32) -> i64
1202 %6 = arith.addi %3, %5 : i64
1203 %7 = fir.convert %6 : (i64) -> f32
1204 fir.store %7 to %0 : !fir.ref<f32>
1205 %8 = fir.load %0 : !fir.ref<f32>
1208 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
1209 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1210 %1 = fir.load %arg0 : !fir.ref<f64>
1211 %2 = fir.call @llvm.lround.i32.f64(%1) : (f64) -> i32
1212 %3 = fir.convert %2 : (i32) -> i64
1213 %4 = fir.load %arg0 : !fir.ref<f64>
1214 %5 = fir.call @llvm.lround.i64.f64(%4) : (f64) -> i64
1215 %6 = arith.addi %3, %5 : i64
1216 %7 = fir.convert %6 : (i64) -> f64
1217 fir.store %7 to %0 : !fir.ref<f64>
1218 %8 = fir.load %0 : !fir.ref<f64>
1221 func.func private @llvm.lround.i32.f32(f32) -> i32
1222 func.func private @llvm.lround.i64.f32(f32) -> i64
1223 func.func private @llvm.lround.i32.f64(f64) -> i32
1224 func.func private @llvm.lround.i64.f64(f64) -> i64
1226 //--- nint_relaxed.fir
1227 // RUN: fir-opt %t/nint_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/nint_relaxed.fir
1228 // CHECK: @_QPtest_real4
1229 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.lround.i32.f32({{%[A-Za-z0-9._]+}}) : (f32) -> i32
1230 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.lround.i64.f32({{%[A-Za-z0-9._]+}}) : (f32) -> i64
1232 // CHECK: @_QPtest_real8
1233 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.lround.i32.f64({{%[A-Za-z0-9._]+}}) : (f64) -> i32
1234 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.lround.i64.f64({{%[A-Za-z0-9._]+}}) : (f64) -> i64
1236 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
1237 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1238 %1 = fir.load %arg0 : !fir.ref<f32>
1239 %2 = fir.call @llvm.lround.i32.f32(%1) : (f32) -> i32
1240 %3 = fir.convert %2 : (i32) -> i64
1241 %4 = fir.load %arg0 : !fir.ref<f32>
1242 %5 = fir.call @llvm.lround.i64.f32(%4) : (f32) -> i64
1243 %6 = arith.addi %3, %5 : i64
1244 %7 = fir.convert %6 : (i64) -> f32
1245 fir.store %7 to %0 : !fir.ref<f32>
1246 %8 = fir.load %0 : !fir.ref<f32>
1249 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
1250 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1251 %1 = fir.load %arg0 : !fir.ref<f64>
1252 %2 = fir.call @llvm.lround.i32.f64(%1) : (f64) -> i32
1253 %3 = fir.convert %2 : (i32) -> i64
1254 %4 = fir.load %arg0 : !fir.ref<f64>
1255 %5 = fir.call @llvm.lround.i64.f64(%4) : (f64) -> i64
1256 %6 = arith.addi %3, %5 : i64
1257 %7 = fir.convert %6 : (i64) -> f64
1258 fir.store %7 to %0 : !fir.ref<f64>
1259 %8 = fir.load %0 : !fir.ref<f64>
1262 func.func private @llvm.lround.i32.f32(f32) -> i32
1263 func.func private @llvm.lround.i64.f32(f32) -> i64
1264 func.func private @llvm.lround.i32.f64(f64) -> i32
1265 func.func private @llvm.lround.i64.f64(f64) -> i64
1267 //--- nint_precise.fir
1268 // RUN: fir-opt %t/nint_precise.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/nint_precise.fir
1269 // CHECK: @_QPtest_real4
1270 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.lround.i32.f32({{%[A-Za-z0-9._]+}}) : (f32) -> i32
1271 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.lround.i64.f32({{%[A-Za-z0-9._]+}}) : (f32) -> i64
1273 // CHECK: @_QPtest_real8
1274 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.lround.i32.f64({{%[A-Za-z0-9._]+}}) : (f64) -> i32
1275 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.lround.i64.f64({{%[A-Za-z0-9._]+}}) : (f64) -> i64
1277 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
1278 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1279 %1 = fir.load %arg0 : !fir.ref<f32>
1280 %2 = fir.call @llvm.lround.i32.f32(%1) : (f32) -> i32
1281 %3 = fir.convert %2 : (i32) -> i64
1282 %4 = fir.load %arg0 : !fir.ref<f32>
1283 %5 = fir.call @llvm.lround.i64.f32(%4) : (f32) -> i64
1284 %6 = arith.addi %3, %5 : i64
1285 %7 = fir.convert %6 : (i64) -> f32
1286 fir.store %7 to %0 : !fir.ref<f32>
1287 %8 = fir.load %0 : !fir.ref<f32>
1290 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
1291 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1292 %1 = fir.load %arg0 : !fir.ref<f64>
1293 %2 = fir.call @llvm.lround.i32.f64(%1) : (f64) -> i32
1294 %3 = fir.convert %2 : (i32) -> i64
1295 %4 = fir.load %arg0 : !fir.ref<f64>
1296 %5 = fir.call @llvm.lround.i64.f64(%4) : (f64) -> i64
1297 %6 = arith.addi %3, %5 : i64
1298 %7 = fir.convert %6 : (i64) -> f64
1299 fir.store %7 to %0 : !fir.ref<f64>
1300 %8 = fir.load %0 : !fir.ref<f64>
1303 func.func private @llvm.lround.i32.f32(f32) -> i32
1304 func.func private @llvm.lround.i64.f32(f32) -> i64
1305 func.func private @llvm.lround.i32.f64(f64) -> i32
1306 func.func private @llvm.lround.i64.f64(f64) -> i64
1308 //--- exponentiation_fast.fir
1309 // RUN: fir-opt %t/exponentiation_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/exponentiation_fast.fir
1310 // CHECK: @_QPtest_real4
1311 // CHECK: [[STOI:%[A-Za-z0-9._]+]] = llvm.sext {{%[A-Za-z0-9._]+}} : i16 to i32
1312 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.powi.f32.i32({{%[A-Za-z0-9._]+}}, [[STOI]]) : (f32, i32) -> f32
1313 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.pow({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, f32) -> f32
1314 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.powi.f32.i32({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, i32) -> f32
1316 // CHECK: @_QPtest_real8
1317 // CHECK: [[STOI:%[A-Za-z0-9._]+]] = llvm.sext {{%[A-Za-z0-9._]+}} : i16 to i32
1318 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.powi.f64.i32({{%[A-Za-z0-9._]+}}, [[STOI]]) : (f64, i32) -> f64
1319 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.pow({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, f64) -> f64
1320 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.powi.f64.i32({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, i32) -> f64
1322 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}, %arg1: !fir.ref<f32> {fir.bindc_name = "y"}, %arg2: !fir.ref<i16> {fir.bindc_name = "s"}, %arg3: !fir.ref<i32> {fir.bindc_name = "i"}) -> f32 {
1323 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1324 %1 = fir.load %arg0 : !fir.ref<f32>
1325 %2 = fir.load %arg2 : !fir.ref<i16>
1326 %3 = fir.convert %2 : (i16) -> i32
1327 %4 = fir.call @llvm.powi.f32.i32(%1, %3) : (f32, i32) -> f32
1328 %5 = fir.load %arg0 : !fir.ref<f32>
1329 %6 = fir.load %arg1 : !fir.ref<f32>
1330 %7 = math.powf %5, %6 : f32
1331 %8 = arith.addf %4, %7 : f32
1332 %9 = fir.load %arg0 : !fir.ref<f32>
1333 %10 = fir.load %arg3 : !fir.ref<i32>
1334 %11 = fir.call @llvm.powi.f32.i32(%9, %10) : (f32, i32) -> f32
1335 %12 = arith.addf %8, %11 : f32
1336 fir.store %12 to %0 : !fir.ref<f32>
1337 %13 = fir.load %0 : !fir.ref<f32>
1340 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}, %arg1: !fir.ref<f64> {fir.bindc_name = "y"}, %arg2: !fir.ref<i16> {fir.bindc_name = "s"}, %arg3: !fir.ref<i32> {fir.bindc_name = "i"}) -> f64 {
1341 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1342 %1 = fir.load %arg0 : !fir.ref<f64>
1343 %2 = fir.load %arg2 : !fir.ref<i16>
1344 %3 = fir.convert %2 : (i16) -> i32
1345 %4 = fir.call @llvm.powi.f64.i32(%1, %3) : (f64, i32) -> f64
1346 %5 = fir.load %arg0 : !fir.ref<f64>
1347 %6 = fir.load %arg1 : !fir.ref<f64>
1348 %7 = math.powf %5, %6 : f64
1349 %8 = arith.addf %4, %7 : f64
1350 %9 = fir.load %arg0 : !fir.ref<f64>
1351 %10 = fir.load %arg3 : !fir.ref<i32>
1352 %11 = fir.call @llvm.powi.f64.i32(%9, %10) : (f64, i32) -> f64
1353 %12 = arith.addf %8, %11 : f64
1354 fir.store %12 to %0 : !fir.ref<f64>
1355 %13 = fir.load %0 : !fir.ref<f64>
1358 func.func private @llvm.powi.f32.i32(f32, i32) -> f32
1359 func.func private @llvm.powi.f64.i32(f64, i32) -> f64
1361 //--- exponentiation_relaxed.fir
1362 // RUN: fir-opt %t/exponentiation_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/exponentiation_relaxed.fir
1363 // CHECK: @_QPtest_real4
1364 // CHECK: [[STOI:%[A-Za-z0-9._]+]] = llvm.sext {{%[A-Za-z0-9._]+}} : i16 to i32
1365 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.powi.f32.i32({{%[A-Za-z0-9._]+}}, [[STOI]]) : (f32, i32) -> f32
1366 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.pow({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, f32) -> f32
1367 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.powi.f32.i32({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, i32) -> f32
1369 // CHECK: @_QPtest_real8
1370 // CHECK: [[STOI:%[A-Za-z0-9._]+]] = llvm.sext {{%[A-Za-z0-9._]+}} : i16 to i32
1371 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.powi.f64.i32({{%[A-Za-z0-9._]+}}, [[STOI]]) : (f64, i32) -> f64
1372 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.pow({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, f64) -> f64
1373 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.powi.f64.i32({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, i32) -> f64
1375 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}, %arg1: !fir.ref<f32> {fir.bindc_name = "y"}, %arg2: !fir.ref<i16> {fir.bindc_name = "s"}, %arg3: !fir.ref<i32> {fir.bindc_name = "i"}) -> f32 {
1376 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1377 %1 = fir.load %arg0 : !fir.ref<f32>
1378 %2 = fir.load %arg2 : !fir.ref<i16>
1379 %3 = fir.convert %2 : (i16) -> i32
1380 %4 = fir.call @llvm.powi.f32.i32(%1, %3) : (f32, i32) -> f32
1381 %5 = fir.load %arg0 : !fir.ref<f32>
1382 %6 = fir.load %arg1 : !fir.ref<f32>
1383 %7 = math.powf %5, %6 : f32
1384 %8 = arith.addf %4, %7 : f32
1385 %9 = fir.load %arg0 : !fir.ref<f32>
1386 %10 = fir.load %arg3 : !fir.ref<i32>
1387 %11 = fir.call @llvm.powi.f32.i32(%9, %10) : (f32, i32) -> f32
1388 %12 = arith.addf %8, %11 : f32
1389 fir.store %12 to %0 : !fir.ref<f32>
1390 %13 = fir.load %0 : !fir.ref<f32>
1393 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}, %arg1: !fir.ref<f64> {fir.bindc_name = "y"}, %arg2: !fir.ref<i16> {fir.bindc_name = "s"}, %arg3: !fir.ref<i32> {fir.bindc_name = "i"}) -> f64 {
1394 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1395 %1 = fir.load %arg0 : !fir.ref<f64>
1396 %2 = fir.load %arg2 : !fir.ref<i16>
1397 %3 = fir.convert %2 : (i16) -> i32
1398 %4 = fir.call @llvm.powi.f64.i32(%1, %3) : (f64, i32) -> f64
1399 %5 = fir.load %arg0 : !fir.ref<f64>
1400 %6 = fir.load %arg1 : !fir.ref<f64>
1401 %7 = math.powf %5, %6 : f64
1402 %8 = arith.addf %4, %7 : f64
1403 %9 = fir.load %arg0 : !fir.ref<f64>
1404 %10 = fir.load %arg3 : !fir.ref<i32>
1405 %11 = fir.call @llvm.powi.f64.i32(%9, %10) : (f64, i32) -> f64
1406 %12 = arith.addf %8, %11 : f64
1407 fir.store %12 to %0 : !fir.ref<f64>
1408 %13 = fir.load %0 : !fir.ref<f64>
1411 func.func private @llvm.powi.f32.i32(f32, i32) -> f32
1412 func.func private @llvm.powi.f64.i32(f64, i32) -> f64
1414 //--- exponentiation_precise.fir
1415 // RUN: fir-opt %t/exponentiation_precise.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/exponentiation_precise.fir
1416 // CHECK: @_QPtest_real4
1417 // CHECK: [[STOI:%[A-Za-z0-9._]+]] = llvm.sext {{%[A-Za-z0-9._]+}} : i16 to i32
1418 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.powi.f32.i32({{%[A-Za-z0-9._]+}}, [[STOI]]) : (f32, i32) -> f32
1419 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @powf({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, f32) -> f32
1420 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.powi.f32.i32({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, i32) -> f32
1422 // CHECK: @_QPtest_real8
1423 // CHECK: [[STOI:%[A-Za-z0-9._]+]] = llvm.sext {{%[A-Za-z0-9._]+}} : i16 to i32
1424 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.powi.f64.i32({{%[A-Za-z0-9._]+}}, [[STOI]]) : (f64, i32) -> f64
1425 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @pow({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, f64) -> f64
1426 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.powi.f64.i32({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, i32) -> f64
1428 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}, %arg1: !fir.ref<f32> {fir.bindc_name = "y"}, %arg2: !fir.ref<i16> {fir.bindc_name = "s"}, %arg3: !fir.ref<i32> {fir.bindc_name = "i"}) -> f32 {
1429 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1430 %1 = fir.load %arg0 : !fir.ref<f32>
1431 %2 = fir.load %arg2 : !fir.ref<i16>
1432 %3 = fir.convert %2 : (i16) -> i32
1433 %4 = fir.call @llvm.powi.f32.i32(%1, %3) : (f32, i32) -> f32
1434 %5 = fir.load %arg0 : !fir.ref<f32>
1435 %6 = fir.load %arg1 : !fir.ref<f32>
1436 %7 = fir.call @powf(%5, %6) : (f32, f32) -> f32
1437 %8 = arith.addf %4, %7 : f32
1438 %9 = fir.load %arg0 : !fir.ref<f32>
1439 %10 = fir.load %arg3 : !fir.ref<i32>
1440 %11 = fir.call @llvm.powi.f32.i32(%9, %10) : (f32, i32) -> f32
1441 %12 = arith.addf %8, %11 : f32
1442 fir.store %12 to %0 : !fir.ref<f32>
1443 %13 = fir.load %0 : !fir.ref<f32>
1446 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}, %arg1: !fir.ref<f64> {fir.bindc_name = "y"}, %arg2: !fir.ref<i16> {fir.bindc_name = "s"}, %arg3: !fir.ref<i32> {fir.bindc_name = "i"}) -> f64 {
1447 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1448 %1 = fir.load %arg0 : !fir.ref<f64>
1449 %2 = fir.load %arg2 : !fir.ref<i16>
1450 %3 = fir.convert %2 : (i16) -> i32
1451 %4 = fir.call @llvm.powi.f64.i32(%1, %3) : (f64, i32) -> f64
1452 %5 = fir.load %arg0 : !fir.ref<f64>
1453 %6 = fir.load %arg1 : !fir.ref<f64>
1454 %7 = fir.call @pow(%5, %6) : (f64, f64) -> f64
1455 %8 = arith.addf %4, %7 : f64
1456 %9 = fir.load %arg0 : !fir.ref<f64>
1457 %10 = fir.load %arg3 : !fir.ref<i32>
1458 %11 = fir.call @llvm.powi.f64.i32(%9, %10) : (f64, i32) -> f64
1459 %12 = arith.addf %8, %11 : f64
1460 fir.store %12 to %0 : !fir.ref<f64>
1461 %13 = fir.load %0 : !fir.ref<f64>
1464 func.func private @llvm.powi.f32.i32(f32, i32) -> f32
1465 func.func private @powf(f32, f32) -> f32
1466 func.func private @llvm.powi.f64.i32(f64, i32) -> f64
1467 func.func private @pow(f64, f64) -> f64
1469 //--- exponentiation_integer.fir
1470 // RUN: fir-opt %t/exponentiation_integer.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/exponentiation_integer.fir
1471 // CHECK: @_QPtest_int4
1472 // CHECK: llvm.call @__mlir_math_ipowi_i32({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (i32, i32) -> i32
1474 func.func @_QPtest_int4(%arg0: !fir.ref<i32> {fir.bindc_name = "x"}, %arg1: !fir.ref<i32> {fir.bindc_name = "y"}, %arg2: !fir.ref<i32> {fir.bindc_name = "z"}) {
1475 %0 = fir.load %arg0 : !fir.ref<i32>
1476 %1 = fir.load %arg1 : !fir.ref<i32>
1477 %2 = math.ipowi %0, %1 : i32
1478 fir.store %2 to %arg2 : !fir.ref<i32>
1483 // RUN: fir-opt %t/sign_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/sign_fast.fir
1484 // CHECK: @_QPtest_real4
1485 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.copysign({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, f32) -> f32
1487 // CHECK: @_QPtest_real8
1488 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.copysign({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, f64) -> f64
1490 // CHECK: @_QPtest_real10
1491 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.copysign({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f80, f80) -> f80
1493 // CHECK: @_QPtest_real16
1494 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.copysign({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f128, f128) -> f128
1496 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}, %arg1: !fir.ref<f32> {fir.bindc_name = "y"}) -> f32 {
1497 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1498 %1 = fir.load %arg0 : !fir.ref<f32>
1499 %2 = fir.load %arg1 : !fir.ref<f32>
1500 %3 = math.copysign %1, %2 : f32
1501 fir.store %3 to %0 : !fir.ref<f32>
1502 %4 = fir.load %0 : !fir.ref<f32>
1505 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}, %arg1: !fir.ref<f64> {fir.bindc_name = "y"}) -> f64 {
1506 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1507 %1 = fir.load %arg0 : !fir.ref<f64>
1508 %2 = fir.load %arg1 : !fir.ref<f64>
1509 %3 = math.copysign %1, %2 : f64
1510 fir.store %3 to %0 : !fir.ref<f64>
1511 %4 = fir.load %0 : !fir.ref<f64>
1514 func.func @_QPtest_real10(%arg0: !fir.ref<f80> {fir.bindc_name = "x"}, %arg1: !fir.ref<f80> {fir.bindc_name = "y"}) -> f80 {
1515 %0 = fir.alloca f80 {bindc_name = "test_real10", uniq_name = "_QFtest_real10Etest_real10"}
1516 %1 = fir.load %arg0 : !fir.ref<f80>
1517 %2 = fir.load %arg1 : !fir.ref<f80>
1518 %3 = math.copysign %1, %2 : f80
1519 fir.store %3 to %0 : !fir.ref<f80>
1520 %4 = fir.load %0 : !fir.ref<f80>
1523 func.func @_QPtest_real16(%arg0: !fir.ref<f128> {fir.bindc_name = "x"}, %arg1: !fir.ref<f128> {fir.bindc_name = "y"}) -> f128 {
1524 %0 = fir.alloca f128 {bindc_name = "test_real16", uniq_name = "_QFtest_real16Etest_real16"}
1525 %1 = fir.load %arg0 : !fir.ref<f128>
1526 %2 = fir.load %arg1 : !fir.ref<f128>
1527 %3 = math.copysign %1, %2 : f128
1528 fir.store %3 to %0 : !fir.ref<f128>
1529 %4 = fir.load %0 : !fir.ref<f128>
1533 //--- sign_relaxed.fir
1534 // RUN: fir-opt %t/sign_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/sign_relaxed.fir
1535 // CHECK: @_QPtest_real4
1536 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.copysign({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, f32) -> f32
1538 // CHECK: @_QPtest_real8
1539 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.copysign({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, f64) -> f64
1541 // CHECK: @_QPtest_real10
1542 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.copysign({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f80, f80) -> f80
1544 // CHECK: @_QPtest_real16
1545 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.copysign({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f128, f128) -> f128
1547 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}, %arg1: !fir.ref<f32> {fir.bindc_name = "y"}) -> f32 {
1548 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1549 %1 = fir.load %arg0 : !fir.ref<f32>
1550 %2 = fir.load %arg1 : !fir.ref<f32>
1551 %3 = math.copysign %1, %2 : f32
1552 fir.store %3 to %0 : !fir.ref<f32>
1553 %4 = fir.load %0 : !fir.ref<f32>
1556 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}, %arg1: !fir.ref<f64> {fir.bindc_name = "y"}) -> f64 {
1557 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1558 %1 = fir.load %arg0 : !fir.ref<f64>
1559 %2 = fir.load %arg1 : !fir.ref<f64>
1560 %3 = math.copysign %1, %2 : f64
1561 fir.store %3 to %0 : !fir.ref<f64>
1562 %4 = fir.load %0 : !fir.ref<f64>
1565 func.func @_QPtest_real10(%arg0: !fir.ref<f80> {fir.bindc_name = "x"}, %arg1: !fir.ref<f80> {fir.bindc_name = "y"}) -> f80 {
1566 %0 = fir.alloca f80 {bindc_name = "test_real10", uniq_name = "_QFtest_real10Etest_real10"}
1567 %1 = fir.load %arg0 : !fir.ref<f80>
1568 %2 = fir.load %arg1 : !fir.ref<f80>
1569 %3 = math.copysign %1, %2 : f80
1570 fir.store %3 to %0 : !fir.ref<f80>
1571 %4 = fir.load %0 : !fir.ref<f80>
1574 func.func @_QPtest_real16(%arg0: !fir.ref<f128> {fir.bindc_name = "x"}, %arg1: !fir.ref<f128> {fir.bindc_name = "y"}) -> f128 {
1575 %0 = fir.alloca f128 {bindc_name = "test_real16", uniq_name = "_QFtest_real16Etest_real16"}
1576 %1 = fir.load %arg0 : !fir.ref<f128>
1577 %2 = fir.load %arg1 : !fir.ref<f128>
1578 %3 = math.copysign %1, %2 : f128
1579 fir.store %3 to %0 : !fir.ref<f128>
1580 %4 = fir.load %0 : !fir.ref<f128>
1584 //--- sign_precise.fir
1585 // RUN: fir-opt %t/sign_precise.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/sign_precise.fir
1586 // CHECK: @_QPtest_real4
1587 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @copysignf({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f32, f32) -> f32
1589 // CHECK: @_QPtest_real8
1590 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @copysign({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f64, f64) -> f64
1592 // CHECK: @_QPtest_real10
1593 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @copysignl({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f80, f80) -> f80
1595 // CHECK: @_QPtest_real16
1596 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @llvm.copysign.f128({{%[A-Za-z0-9._]+}}, {{%[A-Za-z0-9._]+}}) : (f128, f128) -> f128
1598 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}, %arg1: !fir.ref<f32> {fir.bindc_name = "y"}) -> f32 {
1599 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1600 %1 = fir.load %arg0 : !fir.ref<f32>
1601 %2 = fir.load %arg1 : !fir.ref<f32>
1602 %3 = fir.call @copysignf(%1, %2) : (f32, f32) -> f32
1603 fir.store %3 to %0 : !fir.ref<f32>
1604 %4 = fir.load %0 : !fir.ref<f32>
1607 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}, %arg1: !fir.ref<f64> {fir.bindc_name = "y"}) -> f64 {
1608 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1609 %1 = fir.load %arg0 : !fir.ref<f64>
1610 %2 = fir.load %arg1 : !fir.ref<f64>
1611 %3 = fir.call @copysign(%1, %2) : (f64, f64) -> f64
1612 fir.store %3 to %0 : !fir.ref<f64>
1613 %4 = fir.load %0 : !fir.ref<f64>
1616 func.func @_QPtest_real10(%arg0: !fir.ref<f80> {fir.bindc_name = "x"}, %arg1: !fir.ref<f80> {fir.bindc_name = "y"}) -> f80 {
1617 %0 = fir.alloca f80 {bindc_name = "test_real10", uniq_name = "_QFtest_real10Etest_real10"}
1618 %1 = fir.load %arg0 : !fir.ref<f80>
1619 %2 = fir.load %arg1 : !fir.ref<f80>
1620 %3 = fir.call @copysignl(%1, %2) : (f80, f80) -> f80
1621 fir.store %3 to %0 : !fir.ref<f80>
1622 %4 = fir.load %0 : !fir.ref<f80>
1625 func.func @_QPtest_real16(%arg0: !fir.ref<f128> {fir.bindc_name = "x"}, %arg1: !fir.ref<f128> {fir.bindc_name = "y"}) -> f128 {
1626 %0 = fir.alloca f128 {bindc_name = "test_real16", uniq_name = "_QFtest_real16Etest_real16"}
1627 %1 = fir.load %arg0 : !fir.ref<f128>
1628 %2 = fir.load %arg1 : !fir.ref<f128>
1629 %3 = fir.call @llvm.copysign.f128(%1, %2) : (f128, f128) -> f128
1630 fir.store %3 to %0 : !fir.ref<f128>
1631 %4 = fir.load %0 : !fir.ref<f128>
1634 func.func private @copysignf(f32, f32) -> f32
1635 func.func private @copysign(f64, f64) -> f64
1636 func.func private @copysignl(f80, f80) -> f80
1637 func.func private @llvm.copysign.f128(f128, f128) -> f128
1640 // RUN: fir-opt %t/sin_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/sin_fast.fir
1641 // CHECK: @_QPtest_real4
1642 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.sin({{%[A-Za-z0-9._]+}}) : (f32) -> f32
1644 // CHECK: @_QPtest_real8
1645 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.sin({{%[A-Za-z0-9._]+}}) : (f64) -> f64
1647 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
1648 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1649 %1 = fir.load %arg0 : !fir.ref<f32>
1650 %2 = math.sin %1 : f32
1651 fir.store %2 to %0 : !fir.ref<f32>
1652 %3 = fir.load %0 : !fir.ref<f32>
1655 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
1656 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1657 %1 = fir.load %arg0 : !fir.ref<f64>
1658 %2 = math.sin %1 : f64
1659 fir.store %2 to %0 : !fir.ref<f64>
1660 %3 = fir.load %0 : !fir.ref<f64>
1664 //--- sin_relaxed.fir
1665 // RUN: fir-opt %t/sin_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/sin_relaxed.fir
1666 // CHECK: @_QPtest_real4
1667 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.sin({{%[A-Za-z0-9._]+}}) : (f32) -> f32
1669 // CHECK: @_QPtest_real8
1670 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.intr.sin({{%[A-Za-z0-9._]+}}) : (f64) -> f64
1672 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
1673 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1674 %1 = fir.load %arg0 : !fir.ref<f32>
1675 %2 = math.sin %1 : f32
1676 fir.store %2 to %0 : !fir.ref<f32>
1677 %3 = fir.load %0 : !fir.ref<f32>
1680 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
1681 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1682 %1 = fir.load %arg0 : !fir.ref<f64>
1683 %2 = math.sin %1 : f64
1684 fir.store %2 to %0 : !fir.ref<f64>
1685 %3 = fir.load %0 : !fir.ref<f64>
1689 //--- sin_precise.fir
1690 // RUN: fir-opt %t/sin_precise.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/sin_precise.fir
1691 // CHECK: @_QPtest_real4
1692 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @sinf({{%[A-Za-z0-9._]+}}) : (f32) -> f32
1694 // CHECK: @_QPtest_real8
1695 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @sin({{%[A-Za-z0-9._]+}}) : (f64) -> f64
1697 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
1698 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1699 %1 = fir.load %arg0 : !fir.ref<f32>
1700 %2 = fir.call @sinf(%1) : (f32) -> f32
1701 fir.store %2 to %0 : !fir.ref<f32>
1702 %3 = fir.load %0 : !fir.ref<f32>
1705 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
1706 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1707 %1 = fir.load %arg0 : !fir.ref<f64>
1708 %2 = fir.call @sin(%1) : (f64) -> f64
1709 fir.store %2 to %0 : !fir.ref<f64>
1710 %3 = fir.load %0 : !fir.ref<f64>
1713 func.func private @sinf(f32) -> f32
1714 func.func private @sin(f64) -> f64
1717 // RUN: fir-opt %t/sinh_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/sinh_fast.fir
1718 // CHECK: @_QPtest_real4
1719 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @sinhf({{%[A-Za-z0-9._]+}}) : (f32) -> f32
1721 // CHECK: @_QPtest_real8
1722 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @sinh({{%[A-Za-z0-9._]+}}) : (f64) -> f64
1724 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
1725 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1726 %1 = fir.load %arg0 : !fir.ref<f32>
1727 %2 = fir.call @sinhf(%1) : (f32) -> f32
1728 fir.store %2 to %0 : !fir.ref<f32>
1729 %3 = fir.load %0 : !fir.ref<f32>
1732 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
1733 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1734 %1 = fir.load %arg0 : !fir.ref<f64>
1735 %2 = fir.call @sinh(%1) : (f64) -> f64
1736 fir.store %2 to %0 : !fir.ref<f64>
1737 %3 = fir.load %0 : !fir.ref<f64>
1740 func.func private @sinhf(f32) -> f32
1741 func.func private @sinh(f64) -> f64
1743 //--- sinh_relaxed.fir
1744 // RUN: fir-opt %t/sinh_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/sinh_relaxed.fir
1745 // CHECK: @_QPtest_real4
1746 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @sinhf({{%[A-Za-z0-9._]+}}) : (f32) -> f32
1748 // CHECK: @_QPtest_real8
1749 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @sinh({{%[A-Za-z0-9._]+}}) : (f64) -> f64
1751 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
1752 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1753 %1 = fir.load %arg0 : !fir.ref<f32>
1754 %2 = fir.call @sinhf(%1) : (f32) -> f32
1755 fir.store %2 to %0 : !fir.ref<f32>
1756 %3 = fir.load %0 : !fir.ref<f32>
1759 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
1760 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1761 %1 = fir.load %arg0 : !fir.ref<f64>
1762 %2 = fir.call @sinh(%1) : (f64) -> f64
1763 fir.store %2 to %0 : !fir.ref<f64>
1764 %3 = fir.load %0 : !fir.ref<f64>
1767 func.func private @sinhf(f32) -> f32
1768 func.func private @sinh(f64) -> f64
1770 //--- sinh_precise.fir
1771 // RUN: fir-opt %t/sinh_precise.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/sinh_precise.fir
1772 // CHECK: @_QPtest_real4
1773 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @sinhf({{%[A-Za-z0-9._]+}}) : (f32) -> f32
1775 // CHECK: @_QPtest_real8
1776 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @sinh({{%[A-Za-z0-9._]+}}) : (f64) -> f64
1778 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
1779 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1780 %1 = fir.load %arg0 : !fir.ref<f32>
1781 %2 = fir.call @sinhf(%1) : (f32) -> f32
1782 fir.store %2 to %0 : !fir.ref<f32>
1783 %3 = fir.load %0 : !fir.ref<f32>
1786 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
1787 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1788 %1 = fir.load %arg0 : !fir.ref<f64>
1789 %2 = fir.call @sinh(%1) : (f64) -> f64
1790 fir.store %2 to %0 : !fir.ref<f64>
1791 %3 = fir.load %0 : !fir.ref<f64>
1794 func.func private @sinhf(f32) -> f32
1795 func.func private @sinh(f64) -> f64
1798 // RUN: fir-opt %t/tanh_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/tanh_fast.fir
1799 // CHECK: @_QPtest_real4
1800 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @tanhf({{%[A-Za-z0-9._]+}}) : (f32) -> f32
1802 // CHECK: @_QPtest_real8
1803 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @tanh({{%[A-Za-z0-9._]+}}) : (f64) -> f64
1805 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
1806 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1807 %1 = fir.load %arg0 : !fir.ref<f32>
1808 %2 = math.tanh %1 : f32
1809 fir.store %2 to %0 : !fir.ref<f32>
1810 %3 = fir.load %0 : !fir.ref<f32>
1813 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
1814 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1815 %1 = fir.load %arg0 : !fir.ref<f64>
1816 %2 = math.tanh %1 : f64
1817 fir.store %2 to %0 : !fir.ref<f64>
1818 %3 = fir.load %0 : !fir.ref<f64>
1822 //--- tanh_relaxed.fir
1823 // RUN: fir-opt %t/tanh_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/tanh_relaxed.fir
1824 // CHECK: @_QPtest_real4
1825 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @tanhf({{%[A-Za-z0-9._]+}}) : (f32) -> f32
1827 // CHECK: @_QPtest_real8
1828 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @tanh({{%[A-Za-z0-9._]+}}) : (f64) -> f64
1830 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
1831 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1832 %1 = fir.load %arg0 : !fir.ref<f32>
1833 %2 = math.tanh %1 : f32
1834 fir.store %2 to %0 : !fir.ref<f32>
1835 %3 = fir.load %0 : !fir.ref<f32>
1838 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
1839 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1840 %1 = fir.load %arg0 : !fir.ref<f64>
1841 %2 = math.tanh %1 : f64
1842 fir.store %2 to %0 : !fir.ref<f64>
1843 %3 = fir.load %0 : !fir.ref<f64>
1847 //--- tanh_precise.fir
1848 // RUN: fir-opt %t/tanh_precise.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/tanh_precise.fir
1849 // CHECK: @_QPtest_real4
1850 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @tanhf({{%[A-Za-z0-9._]+}}) : (f32) -> f32
1852 // CHECK: @_QPtest_real8
1853 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @tanh({{%[A-Za-z0-9._]+}}) : (f64) -> f64
1855 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
1856 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1857 %1 = fir.load %arg0 : !fir.ref<f32>
1858 %2 = fir.call @tanhf(%1) : (f32) -> f32
1859 fir.store %2 to %0 : !fir.ref<f32>
1860 %3 = fir.load %0 : !fir.ref<f32>
1863 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
1864 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1865 %1 = fir.load %arg0 : !fir.ref<f64>
1866 %2 = fir.call @tanh(%1) : (f64) -> f64
1867 fir.store %2 to %0 : !fir.ref<f64>
1868 %3 = fir.load %0 : !fir.ref<f64>
1871 func.func private @tanhf(f32) -> f32
1872 func.func private @tanh(f64) -> f64
1875 // RUN: fir-opt %t/tan_fast.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/tan_fast.fir
1876 // CHECK: @_QPtest_real4
1877 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @tanf({{%[A-Za-z0-9._]+}}) : (f32) -> f32
1879 // CHECK: @_QPtest_real8
1880 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @tan({{%[A-Za-z0-9._]+}}) : (f64) -> f64
1882 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
1883 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1884 %1 = fir.load %arg0 : !fir.ref<f32>
1885 %2 = math.tan %1 : f32
1886 fir.store %2 to %0 : !fir.ref<f32>
1887 %3 = fir.load %0 : !fir.ref<f32>
1890 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
1891 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1892 %1 = fir.load %arg0 : !fir.ref<f64>
1893 %2 = math.tan %1 : f64
1894 fir.store %2 to %0 : !fir.ref<f64>
1895 %3 = fir.load %0 : !fir.ref<f64>
1899 //--- tan_relaxed.fir
1900 // RUN: fir-opt %t/tan_relaxed.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/tan_relaxed.fir
1901 // CHECK: @_QPtest_real4
1902 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @tanf({{%[A-Za-z0-9._]+}}) : (f32) -> f32
1904 // CHECK: @_QPtest_real8
1905 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @tan({{%[A-Za-z0-9._]+}}) : (f64) -> f64
1907 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
1908 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1909 %1 = fir.load %arg0 : !fir.ref<f32>
1910 %2 = math.tan %1 : f32
1911 fir.store %2 to %0 : !fir.ref<f32>
1912 %3 = fir.load %0 : !fir.ref<f32>
1915 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
1916 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1917 %1 = fir.load %arg0 : !fir.ref<f64>
1918 %2 = math.tan %1 : f64
1919 fir.store %2 to %0 : !fir.ref<f64>
1920 %3 = fir.load %0 : !fir.ref<f64>
1924 //--- tan_precise.fir
1925 // RUN: fir-opt %t/tan_precise.fir --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" | FileCheck %t/tan_precise.fir
1926 // CHECK: @_QPtest_real4
1927 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @tanf({{%[A-Za-z0-9._]+}}) : (f32) -> f32
1929 // CHECK: @_QPtest_real8
1930 // CHECK: {{%[A-Za-z0-9._]+}} = llvm.call @tan({{%[A-Za-z0-9._]+}}) : (f64) -> f64
1932 func.func @_QPtest_real4(%arg0: !fir.ref<f32> {fir.bindc_name = "x"}) -> f32 {
1933 %0 = fir.alloca f32 {bindc_name = "test_real4", uniq_name = "_QFtest_real4Etest_real4"}
1934 %1 = fir.load %arg0 : !fir.ref<f32>
1935 %2 = fir.call @tanf(%1) : (f32) -> f32
1936 fir.store %2 to %0 : !fir.ref<f32>
1937 %3 = fir.load %0 : !fir.ref<f32>
1940 func.func @_QPtest_real8(%arg0: !fir.ref<f64> {fir.bindc_name = "x"}) -> f64 {
1941 %0 = fir.alloca f64 {bindc_name = "test_real8", uniq_name = "_QFtest_real8Etest_real8"}
1942 %1 = fir.load %arg0 : !fir.ref<f64>
1943 %2 = fir.call @tan(%1) : (f64) -> f64
1944 fir.store %2 to %0 : !fir.ref<f64>
1945 %3 = fir.load %0 : !fir.ref<f64>
1948 func.func private @tanf(f32) -> f32
1949 func.func private @tan(f64) -> f64