1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
2 ; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -passes=amdgpu-simplifylib,instcombine -amdgpu-prelink %s | FileCheck %s
4 target datalayout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9"
6 declare float @_Z3powff(float, float)
7 declare <2 x float> @_Z3powDv2_fS_(<2 x float>, <2 x float>)
8 declare <3 x float> @_Z3powDv3_fS_(<3 x float>, <3 x float>)
9 declare <4 x float> @_Z3powDv4_fS_(<4 x float>, <4 x float>)
10 declare <8 x float> @_Z3powDv8_fS_(<8 x float>, <8 x float>)
11 declare <16 x float> @_Z3powDv16_fS_(<16 x float>, <16 x float>)
12 declare double @_Z3powdd(double, double)
13 declare <2 x double> @_Z3powDv2_dS_(<2 x double>, <2 x double>)
14 declare <3 x double> @_Z3powDv3_dS_(<3 x double>, <3 x double>)
15 declare <4 x double> @_Z3powDv4_dS_(<4 x double>, <4 x double>)
16 declare <8 x double> @_Z3powDv8_dS_(<8 x double>, <8 x double>)
17 declare <16 x double> @_Z3powDv16_dS_(<16 x double>, <16 x double>)
18 declare half @_Z3powDhDh(half, half)
19 declare <2 x half> @_Z3powDv2_DhS_(<2 x half>, <2 x half>)
20 declare <3 x half> @_Z3powDv3_DhS_(<3 x half>, <3 x half>)
21 declare <4 x half> @_Z3powDv4_DhS_(<4 x half>, <4 x half>)
22 declare <8 x half> @_Z3powDv8_DhS_(<8 x half>, <8 x half>)
23 declare <16 x half> @_Z3powDv16_DhS_(<16 x half>, <16 x half>)
24 declare void @llvm.assume(i1 noundef)
25 declare float @llvm.floor.f32(float)
26 declare float @llvm.ceil.f32(float)
27 declare float @llvm.trunc.f32(float)
28 declare float @llvm.rint.f32(float)
29 declare float @llvm.nearbyint.f32(float)
30 declare float @llvm.round.f32(float)
31 declare float @llvm.roundeven.f32(float)
33 define float @test_pow_fast_f32(float %x, float %y) {
34 ; CHECK-LABEL: define float @test_pow_fast_f32
35 ; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) {
36 ; CHECK-NEXT: [[POW:%.*]] = tail call fast float @_Z3powff(float [[X]], float [[Y]])
37 ; CHECK-NEXT: ret float [[POW]]
39 %pow = tail call fast float @_Z3powff(float %x, float %y)
43 define <2 x float> @test_pow_fast_v2f32(<2 x float> %x, <2 x float> %y) {
44 ; CHECK-LABEL: define <2 x float> @test_pow_fast_v2f32
45 ; CHECK-SAME: (<2 x float> [[X:%.*]], <2 x float> [[Y:%.*]]) {
46 ; CHECK-NEXT: [[POW:%.*]] = tail call fast <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> [[Y]])
47 ; CHECK-NEXT: ret <2 x float> [[POW]]
49 %pow = tail call fast <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> %y)
53 define float @test_pow_afn_f32_nnan(float %x, float %y) {
54 ; CHECK-LABEL: define float @test_pow_afn_f32_nnan
55 ; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) {
56 ; CHECK-NEXT: [[POW:%.*]] = tail call nnan afn float @_Z3powff(float [[X]], float [[Y]])
57 ; CHECK-NEXT: ret float [[POW]]
59 %pow = tail call afn nnan float @_Z3powff(float %x, float %y)
63 define float @test_pow_afn_f32_nnan_ninf(float %x, float %y) {
64 ; CHECK-LABEL: define float @test_pow_afn_f32_nnan_ninf
65 ; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) {
66 ; CHECK-NEXT: [[POW:%.*]] = tail call nnan ninf afn float @_Z3powff(float [[X]], float [[Y]])
67 ; CHECK-NEXT: ret float [[POW]]
69 %pow = tail call afn nnan ninf float @_Z3powff(float %x, float %y)
73 define <2 x float> @test_pow_afn_v2f32_nnan(<2 x float> %x, <2 x float> %y) {
74 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_nnan
75 ; CHECK-SAME: (<2 x float> [[X:%.*]], <2 x float> [[Y:%.*]]) {
76 ; CHECK-NEXT: [[POW:%.*]] = tail call nnan afn <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> [[Y]])
77 ; CHECK-NEXT: ret <2 x float> [[POW]]
79 %pow = tail call afn nnan <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> %y)
83 define <2 x float> @test_pow_afn_v2f32_nnan_ninf(<2 x float> %x, <2 x float> %y) {
84 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_nnan_ninf
85 ; CHECK-SAME: (<2 x float> [[X:%.*]], <2 x float> [[Y:%.*]]) {
86 ; CHECK-NEXT: [[POW:%.*]] = tail call nnan ninf afn <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> [[Y]])
87 ; CHECK-NEXT: ret <2 x float> [[POW]]
89 %pow = tail call afn nnan ninf <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> %y)
93 define float @test_pow_afn_f32(float %x, float %y) {
94 ; CHECK-LABEL: define float @test_pow_afn_f32
95 ; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) {
96 ; CHECK-NEXT: [[POW:%.*]] = tail call afn float @_Z3powff(float [[X]], float [[Y]])
97 ; CHECK-NEXT: ret float [[POW]]
99 %pow = tail call afn float @_Z3powff(float %x, float %y)
103 define <2 x float> @test_pow_afn_v2f32(<2 x float> %x, <2 x float> %y) {
104 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32
105 ; CHECK-SAME: (<2 x float> [[X:%.*]], <2 x float> [[Y:%.*]]) {
106 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> [[Y]])
107 ; CHECK-NEXT: ret <2 x float> [[POW]]
109 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> %y)
113 define <3 x float> @test_pow_afn_v3f32(<3 x float> %x, <3 x float> %y) {
114 ; CHECK-LABEL: define <3 x float> @test_pow_afn_v3f32
115 ; CHECK-SAME: (<3 x float> [[X:%.*]], <3 x float> [[Y:%.*]]) {
116 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <3 x float> @_Z3powDv3_fS_(<3 x float> [[X]], <3 x float> [[Y]])
117 ; CHECK-NEXT: ret <3 x float> [[POW]]
119 %pow = tail call afn <3 x float> @_Z3powDv3_fS_(<3 x float> %x, <3 x float> %y)
123 define <4 x float> @test_pow_afn_v4f32(<4 x float> %x, <4 x float> %y) {
124 ; CHECK-LABEL: define <4 x float> @test_pow_afn_v4f32
125 ; CHECK-SAME: (<4 x float> [[X:%.*]], <4 x float> [[Y:%.*]]) {
126 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <4 x float> @_Z3powDv4_fS_(<4 x float> [[X]], <4 x float> [[Y]])
127 ; CHECK-NEXT: ret <4 x float> [[POW]]
129 %pow = tail call afn <4 x float> @_Z3powDv4_fS_(<4 x float> %x, <4 x float> %y)
133 define <8 x float> @test_pow_afn_v8f32(<8 x float> %x, <8 x float> %y) {
134 ; CHECK-LABEL: define <8 x float> @test_pow_afn_v8f32
135 ; CHECK-SAME: (<8 x float> [[X:%.*]], <8 x float> [[Y:%.*]]) {
136 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <8 x float> @_Z3powDv8_fS_(<8 x float> [[X]], <8 x float> [[Y]])
137 ; CHECK-NEXT: ret <8 x float> [[POW]]
139 %pow = tail call afn <8 x float> @_Z3powDv8_fS_(<8 x float> %x, <8 x float> %y)
143 define <16 x float> @test_pow_afn_v16f32(<16 x float> %x, <16 x float> %y) {
144 ; CHECK-LABEL: define <16 x float> @test_pow_afn_v16f32
145 ; CHECK-SAME: (<16 x float> [[X:%.*]], <16 x float> [[Y:%.*]]) {
146 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <16 x float> @_Z3powDv16_fS_(<16 x float> [[X]], <16 x float> [[Y]])
147 ; CHECK-NEXT: ret <16 x float> [[POW]]
149 %pow = tail call afn <16 x float> @_Z3powDv16_fS_(<16 x float> %x, <16 x float> %y)
150 ret <16 x float> %pow
153 define double @test_pow_afn_f64(double %x, double %y) {
154 ; CHECK-LABEL: define double @test_pow_afn_f64
155 ; CHECK-SAME: (double [[X:%.*]], double [[Y:%.*]]) {
156 ; CHECK-NEXT: [[POW:%.*]] = tail call afn double @_Z3powdd(double [[X]], double [[Y]])
157 ; CHECK-NEXT: ret double [[POW]]
159 %pow = tail call afn double @_Z3powdd(double %x, double %y)
163 define <2 x double> @test_pow_afn_v2f64(<2 x double> %x, <2 x double> %y) {
164 ; CHECK-LABEL: define <2 x double> @test_pow_afn_v2f64
165 ; CHECK-SAME: (<2 x double> [[X:%.*]], <2 x double> [[Y:%.*]]) {
166 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x double> @_Z3powDv2_dS_(<2 x double> [[X]], <2 x double> [[Y]])
167 ; CHECK-NEXT: ret <2 x double> [[POW]]
169 %pow = tail call afn <2 x double> @_Z3powDv2_dS_(<2 x double> %x, <2 x double> %y)
170 ret <2 x double> %pow
173 define <3 x double> @test_pow_afn_v3f64(<3 x double> %x, <3 x double> %y) {
174 ; CHECK-LABEL: define <3 x double> @test_pow_afn_v3f64
175 ; CHECK-SAME: (<3 x double> [[X:%.*]], <3 x double> [[Y:%.*]]) {
176 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <3 x double> @_Z3powDv3_dS_(<3 x double> [[X]], <3 x double> [[Y]])
177 ; CHECK-NEXT: ret <3 x double> [[POW]]
179 %pow = tail call afn <3 x double> @_Z3powDv3_dS_(<3 x double> %x, <3 x double> %y)
180 ret <3 x double> %pow
183 define <4 x double> @test_pow_afn_v4f64(<4 x double> %x, <4 x double> %y) {
184 ; CHECK-LABEL: define <4 x double> @test_pow_afn_v4f64
185 ; CHECK-SAME: (<4 x double> [[X:%.*]], <4 x double> [[Y:%.*]]) {
186 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <4 x double> @_Z3powDv4_dS_(<4 x double> [[X]], <4 x double> [[Y]])
187 ; CHECK-NEXT: ret <4 x double> [[POW]]
189 %pow = tail call afn <4 x double> @_Z3powDv4_dS_(<4 x double> %x, <4 x double> %y)
190 ret <4 x double> %pow
193 define <8 x double> @test_pow_afn_v8f64(<8 x double> %x, <8 x double> %y) {
194 ; CHECK-LABEL: define <8 x double> @test_pow_afn_v8f64
195 ; CHECK-SAME: (<8 x double> [[X:%.*]], <8 x double> [[Y:%.*]]) {
196 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <8 x double> @_Z3powDv8_dS_(<8 x double> [[X]], <8 x double> [[Y]])
197 ; CHECK-NEXT: ret <8 x double> [[POW]]
199 %pow = tail call afn <8 x double> @_Z3powDv8_dS_(<8 x double> %x, <8 x double> %y)
200 ret <8 x double> %pow
203 define <16 x double> @test_pow_afn_v16f64(<16 x double> %x, <16 x double> %y) {
204 ; CHECK-LABEL: define <16 x double> @test_pow_afn_v16f64
205 ; CHECK-SAME: (<16 x double> [[X:%.*]], <16 x double> [[Y:%.*]]) {
206 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <16 x double> @_Z3powDv16_dS_(<16 x double> [[X]], <16 x double> [[Y]])
207 ; CHECK-NEXT: ret <16 x double> [[POW]]
209 %pow = tail call afn <16 x double> @_Z3powDv16_dS_(<16 x double> %x, <16 x double> %y)
210 ret <16 x double> %pow
213 define half @test_pow_afn_f16(half %x, half %y) {
214 ; CHECK-LABEL: define half @test_pow_afn_f16
215 ; CHECK-SAME: (half [[X:%.*]], half [[Y:%.*]]) {
216 ; CHECK-NEXT: [[POW:%.*]] = tail call afn half @_Z3powDhDh(half [[X]], half [[Y]])
217 ; CHECK-NEXT: ret half [[POW]]
219 %pow = tail call afn half @_Z3powDhDh(half %x, half %y)
223 define <2 x half> @test_pow_afn_v2f16(<2 x half> %x, <2 x half> %y) {
224 ; CHECK-LABEL: define <2 x half> @test_pow_afn_v2f16
225 ; CHECK-SAME: (<2 x half> [[X:%.*]], <2 x half> [[Y:%.*]]) {
226 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x half> @_Z3powDv2_DhS_(<2 x half> [[X]], <2 x half> [[Y]])
227 ; CHECK-NEXT: ret <2 x half> [[POW]]
229 %pow = tail call afn <2 x half> @_Z3powDv2_DhS_(<2 x half> %x, <2 x half> %y)
233 define <3 x half> @test_pow_afn_v3f16(<3 x half> %x, <3 x half> %y) {
234 ; CHECK-LABEL: define <3 x half> @test_pow_afn_v3f16
235 ; CHECK-SAME: (<3 x half> [[X:%.*]], <3 x half> [[Y:%.*]]) {
236 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <3 x half> @_Z3powDv3_DhS_(<3 x half> [[X]], <3 x half> [[Y]])
237 ; CHECK-NEXT: ret <3 x half> [[POW]]
239 %pow = tail call afn <3 x half> @_Z3powDv3_DhS_(<3 x half> %x, <3 x half> %y)
243 define <4 x half> @test_pow_afn_v4f16(<4 x half> %x, <4 x half> %y) {
244 ; CHECK-LABEL: define <4 x half> @test_pow_afn_v4f16
245 ; CHECK-SAME: (<4 x half> [[X:%.*]], <4 x half> [[Y:%.*]]) {
246 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <4 x half> @_Z3powDv4_DhS_(<4 x half> [[X]], <4 x half> [[Y]])
247 ; CHECK-NEXT: ret <4 x half> [[POW]]
249 %pow = tail call afn <4 x half> @_Z3powDv4_DhS_(<4 x half> %x, <4 x half> %y)
253 define <8 x half> @test_pow_afn_v8f16(<8 x half> %x, <8 x half> %y) {
254 ; CHECK-LABEL: define <8 x half> @test_pow_afn_v8f16
255 ; CHECK-SAME: (<8 x half> [[X:%.*]], <8 x half> [[Y:%.*]]) {
256 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <8 x half> @_Z3powDv8_DhS_(<8 x half> [[X]], <8 x half> [[Y]])
257 ; CHECK-NEXT: ret <8 x half> [[POW]]
259 %pow = tail call afn <8 x half> @_Z3powDv8_DhS_(<8 x half> %x, <8 x half> %y)
263 define <16 x half> @test_pow_afn_v16f16(<16 x half> %x, <16 x half> %y) {
264 ; CHECK-LABEL: define <16 x half> @test_pow_afn_v16f16
265 ; CHECK-SAME: (<16 x half> [[X:%.*]], <16 x half> [[Y:%.*]]) {
266 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <16 x half> @_Z3powDv16_DhS_(<16 x half> [[X]], <16 x half> [[Y]])
267 ; CHECK-NEXT: ret <16 x half> [[POW]]
269 %pow = tail call afn <16 x half> @_Z3powDv16_DhS_(<16 x half> %x, <16 x half> %y)
273 define float @test_pow_f32(float %x, float %y) {
274 ; CHECK-LABEL: define float @test_pow_f32
275 ; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) {
276 ; CHECK-NEXT: [[POW:%.*]] = tail call float @_Z3powff(float [[X]], float [[Y]])
277 ; CHECK-NEXT: ret float [[POW]]
279 %pow = tail call float @_Z3powff(float %x, float %y)
283 define float @test_pow_f32_nnan(float %x, float %y) {
284 ; CHECK-LABEL: define float @test_pow_f32_nnan
285 ; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) {
286 ; CHECK-NEXT: [[POW:%.*]] = tail call nnan float @_Z3powff(float [[X]], float [[Y]])
287 ; CHECK-NEXT: ret float [[POW]]
289 %pow = tail call nnan float @_Z3powff(float %x, float %y)
293 define <2 x float> @test_pow_v2f32(<2 x float> %x, <2 x float> %y) {
294 ; CHECK-LABEL: define <2 x float> @test_pow_v2f32
295 ; CHECK-SAME: (<2 x float> [[X:%.*]], <2 x float> [[Y:%.*]]) {
296 ; CHECK-NEXT: [[POW:%.*]] = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> [[Y]])
297 ; CHECK-NEXT: ret <2 x float> [[POW]]
299 %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> %y)
303 define <3 x float> @test_pow_v3f32(<3 x float> %x, <3 x float> %y) {
304 ; CHECK-LABEL: define <3 x float> @test_pow_v3f32
305 ; CHECK-SAME: (<3 x float> [[X:%.*]], <3 x float> [[Y:%.*]]) {
306 ; CHECK-NEXT: [[POW:%.*]] = tail call <3 x float> @_Z3powDv3_fS_(<3 x float> [[X]], <3 x float> [[Y]])
307 ; CHECK-NEXT: ret <3 x float> [[POW]]
309 %pow = tail call <3 x float> @_Z3powDv3_fS_(<3 x float> %x, <3 x float> %y)
313 define <4 x float> @test_pow_v4f32(<4 x float> %x, <4 x float> %y) {
314 ; CHECK-LABEL: define <4 x float> @test_pow_v4f32
315 ; CHECK-SAME: (<4 x float> [[X:%.*]], <4 x float> [[Y:%.*]]) {
316 ; CHECK-NEXT: [[POW:%.*]] = tail call <4 x float> @_Z3powDv4_fS_(<4 x float> [[X]], <4 x float> [[Y]])
317 ; CHECK-NEXT: ret <4 x float> [[POW]]
319 %pow = tail call <4 x float> @_Z3powDv4_fS_(<4 x float> %x, <4 x float> %y)
323 define <8 x float> @test_pow_v8f32(<8 x float> %x, <8 x float> %y) {
324 ; CHECK-LABEL: define <8 x float> @test_pow_v8f32
325 ; CHECK-SAME: (<8 x float> [[X:%.*]], <8 x float> [[Y:%.*]]) {
326 ; CHECK-NEXT: [[POW:%.*]] = tail call <8 x float> @_Z3powDv8_fS_(<8 x float> [[X]], <8 x float> [[Y]])
327 ; CHECK-NEXT: ret <8 x float> [[POW]]
329 %pow = tail call <8 x float> @_Z3powDv8_fS_(<8 x float> %x, <8 x float> %y)
333 define <16 x float> @test_pow_v16f32(<16 x float> %x, <16 x float> %y) {
334 ; CHECK-LABEL: define <16 x float> @test_pow_v16f32
335 ; CHECK-SAME: (<16 x float> [[X:%.*]], <16 x float> [[Y:%.*]]) {
336 ; CHECK-NEXT: [[POW:%.*]] = tail call <16 x float> @_Z3powDv16_fS_(<16 x float> [[X]], <16 x float> [[Y]])
337 ; CHECK-NEXT: ret <16 x float> [[POW]]
339 %pow = tail call <16 x float> @_Z3powDv16_fS_(<16 x float> %x, <16 x float> %y)
340 ret <16 x float> %pow
343 define double @test_pow_f64(double %x, double %y) {
344 ; CHECK-LABEL: define double @test_pow_f64
345 ; CHECK-SAME: (double [[X:%.*]], double [[Y:%.*]]) {
346 ; CHECK-NEXT: [[POW:%.*]] = tail call double @_Z3powdd(double [[X]], double [[Y]])
347 ; CHECK-NEXT: ret double [[POW]]
349 %pow = tail call double @_Z3powdd(double %x, double %y)
353 define <2 x double> @test_pow_v2f64(<2 x double> %x, <2 x double> %y) {
354 ; CHECK-LABEL: define <2 x double> @test_pow_v2f64
355 ; CHECK-SAME: (<2 x double> [[X:%.*]], <2 x double> [[Y:%.*]]) {
356 ; CHECK-NEXT: [[POW:%.*]] = tail call <2 x double> @_Z3powDv2_dS_(<2 x double> [[X]], <2 x double> [[Y]])
357 ; CHECK-NEXT: ret <2 x double> [[POW]]
359 %pow = tail call <2 x double> @_Z3powDv2_dS_(<2 x double> %x, <2 x double> %y)
360 ret <2 x double> %pow
363 define <3 x double> @test_pow_v3f64(<3 x double> %x, <3 x double> %y) {
364 ; CHECK-LABEL: define <3 x double> @test_pow_v3f64
365 ; CHECK-SAME: (<3 x double> [[X:%.*]], <3 x double> [[Y:%.*]]) {
366 ; CHECK-NEXT: [[POW:%.*]] = tail call <3 x double> @_Z3powDv3_dS_(<3 x double> [[X]], <3 x double> [[Y]])
367 ; CHECK-NEXT: ret <3 x double> [[POW]]
369 %pow = tail call <3 x double> @_Z3powDv3_dS_(<3 x double> %x, <3 x double> %y)
370 ret <3 x double> %pow
373 define <4 x double> @test_pow_v4f64(<4 x double> %x, <4 x double> %y) {
374 ; CHECK-LABEL: define <4 x double> @test_pow_v4f64
375 ; CHECK-SAME: (<4 x double> [[X:%.*]], <4 x double> [[Y:%.*]]) {
376 ; CHECK-NEXT: [[POW:%.*]] = tail call <4 x double> @_Z3powDv4_dS_(<4 x double> [[X]], <4 x double> [[Y]])
377 ; CHECK-NEXT: ret <4 x double> [[POW]]
379 %pow = tail call <4 x double> @_Z3powDv4_dS_(<4 x double> %x, <4 x double> %y)
380 ret <4 x double> %pow
383 define <8 x double> @test_pow_v8f64(<8 x double> %x, <8 x double> %y) {
384 ; CHECK-LABEL: define <8 x double> @test_pow_v8f64
385 ; CHECK-SAME: (<8 x double> [[X:%.*]], <8 x double> [[Y:%.*]]) {
386 ; CHECK-NEXT: [[POW:%.*]] = tail call <8 x double> @_Z3powDv8_dS_(<8 x double> [[X]], <8 x double> [[Y]])
387 ; CHECK-NEXT: ret <8 x double> [[POW]]
389 %pow = tail call <8 x double> @_Z3powDv8_dS_(<8 x double> %x, <8 x double> %y)
390 ret <8 x double> %pow
393 define <16 x double> @test_pow_v16f64(<16 x double> %x, <16 x double> %y) {
394 ; CHECK-LABEL: define <16 x double> @test_pow_v16f64
395 ; CHECK-SAME: (<16 x double> [[X:%.*]], <16 x double> [[Y:%.*]]) {
396 ; CHECK-NEXT: [[POW:%.*]] = tail call <16 x double> @_Z3powDv16_dS_(<16 x double> [[X]], <16 x double> [[Y]])
397 ; CHECK-NEXT: ret <16 x double> [[POW]]
399 %pow = tail call <16 x double> @_Z3powDv16_dS_(<16 x double> %x, <16 x double> %y)
400 ret <16 x double> %pow
403 define half @test_pow_f16(half %x, half %y) {
404 ; CHECK-LABEL: define half @test_pow_f16
405 ; CHECK-SAME: (half [[X:%.*]], half [[Y:%.*]]) {
406 ; CHECK-NEXT: [[POW:%.*]] = tail call half @_Z3powDhDh(half [[X]], half [[Y]])
407 ; CHECK-NEXT: ret half [[POW]]
409 %pow = tail call half @_Z3powDhDh(half %x, half %y)
413 define <2 x half> @test_pow_v2f16(<2 x half> %x, <2 x half> %y) {
414 ; CHECK-LABEL: define <2 x half> @test_pow_v2f16
415 ; CHECK-SAME: (<2 x half> [[X:%.*]], <2 x half> [[Y:%.*]]) {
416 ; CHECK-NEXT: [[POW:%.*]] = tail call <2 x half> @_Z3powDv2_DhS_(<2 x half> [[X]], <2 x half> [[Y]])
417 ; CHECK-NEXT: ret <2 x half> [[POW]]
419 %pow = tail call <2 x half> @_Z3powDv2_DhS_(<2 x half> %x, <2 x half> %y)
423 define <3 x half> @test_pow_v3f16(<3 x half> %x, <3 x half> %y) {
424 ; CHECK-LABEL: define <3 x half> @test_pow_v3f16
425 ; CHECK-SAME: (<3 x half> [[X:%.*]], <3 x half> [[Y:%.*]]) {
426 ; CHECK-NEXT: [[POW:%.*]] = tail call <3 x half> @_Z3powDv3_DhS_(<3 x half> [[X]], <3 x half> [[Y]])
427 ; CHECK-NEXT: ret <3 x half> [[POW]]
429 %pow = tail call <3 x half> @_Z3powDv3_DhS_(<3 x half> %x, <3 x half> %y)
433 define <4 x half> @test_pow_v4f16(<4 x half> %x, <4 x half> %y) {
434 ; CHECK-LABEL: define <4 x half> @test_pow_v4f16
435 ; CHECK-SAME: (<4 x half> [[X:%.*]], <4 x half> [[Y:%.*]]) {
436 ; CHECK-NEXT: [[POW:%.*]] = tail call <4 x half> @_Z3powDv4_DhS_(<4 x half> [[X]], <4 x half> [[Y]])
437 ; CHECK-NEXT: ret <4 x half> [[POW]]
439 %pow = tail call <4 x half> @_Z3powDv4_DhS_(<4 x half> %x, <4 x half> %y)
443 define <8 x half> @test_pow_v8f16(<8 x half> %x, <8 x half> %y) {
444 ; CHECK-LABEL: define <8 x half> @test_pow_v8f16
445 ; CHECK-SAME: (<8 x half> [[X:%.*]], <8 x half> [[Y:%.*]]) {
446 ; CHECK-NEXT: [[POW:%.*]] = tail call <8 x half> @_Z3powDv8_DhS_(<8 x half> [[X]], <8 x half> [[Y]])
447 ; CHECK-NEXT: ret <8 x half> [[POW]]
449 %pow = tail call <8 x half> @_Z3powDv8_DhS_(<8 x half> %x, <8 x half> %y)
453 define <16 x half> @test_pow_v16f16(<16 x half> %x, <16 x half> %y) {
454 ; CHECK-LABEL: define <16 x half> @test_pow_v16f16
455 ; CHECK-SAME: (<16 x half> [[X:%.*]], <16 x half> [[Y:%.*]]) {
456 ; CHECK-NEXT: [[POW:%.*]] = tail call <16 x half> @_Z3powDv16_DhS_(<16 x half> [[X]], <16 x half> [[Y]])
457 ; CHECK-NEXT: ret <16 x half> [[POW]]
459 %pow = tail call <16 x half> @_Z3powDv16_DhS_(<16 x half> %x, <16 x half> %y)
463 define float @test_pow_afn_f32_minsize(float %x, float %y) #0 {
464 ; CHECK-LABEL: define float @test_pow_afn_f32_minsize
465 ; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) #[[ATTR2:[0-9]+]] {
466 ; CHECK-NEXT: [[POW:%.*]] = tail call afn float @_Z3powff(float [[X]], float [[Y]])
467 ; CHECK-NEXT: ret float [[POW]]
469 %pow = tail call afn float @_Z3powff(float %x, float %y)
473 define float @test_pow_afn_f32_nnan_minsize(float %x, float %y) #0 {
474 ; CHECK-LABEL: define float @test_pow_afn_f32_nnan_minsize
475 ; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) #[[ATTR2]] {
476 ; CHECK-NEXT: [[POW:%.*]] = tail call nnan afn float @_Z3powff(float [[X]], float [[Y]])
477 ; CHECK-NEXT: ret float [[POW]]
479 %pow = tail call afn nnan float @_Z3powff(float %x, float %y)
483 define float @test_pow_afn_f32_noinline(float %x, float %y) {
484 ; CHECK-LABEL: define float @test_pow_afn_f32_noinline
485 ; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) {
486 ; CHECK-NEXT: [[POW:%.*]] = tail call afn float @_Z3powff(float [[X]], float [[Y]]) #[[ATTR5:[0-9]+]]
487 ; CHECK-NEXT: ret float [[POW]]
489 %pow = tail call afn float @_Z3powff(float %x, float %y) #1
493 define float @test_pow_afn_f32_nnan_noinline(float %x, float %y) {
494 ; CHECK-LABEL: define float @test_pow_afn_f32_nnan_noinline
495 ; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) {
496 ; CHECK-NEXT: [[POW:%.*]] = tail call nnan afn float @_Z3powff(float [[X]], float [[Y]]) #[[ATTR5]]
497 ; CHECK-NEXT: ret float [[POW]]
499 %pow = tail call afn nnan float @_Z3powff(float %x, float %y) #1
503 define float @test_pow_afn_f32_strictfp(float %x, float %y) #2 {
504 ; CHECK-LABEL: define float @test_pow_afn_f32_strictfp
505 ; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) #[[ATTR3:[0-9]+]] {
506 ; CHECK-NEXT: [[POW:%.*]] = tail call nnan nsz afn float @_Z3powff(float [[X]], float [[Y]]) #[[ATTR3]]
507 ; CHECK-NEXT: ret float [[POW]]
509 %pow = tail call afn nsz nnan float @_Z3powff(float %x, float %y) #2
513 define float @test_pow_fast_f32_nobuiltin(float %x, float %y) {
514 ; CHECK-LABEL: define float @test_pow_fast_f32_nobuiltin
515 ; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) {
516 ; CHECK-NEXT: [[POW:%.*]] = tail call fast float @_Z3powff(float [[X]], float [[Y]]) #[[ATTR6:[0-9]+]]
517 ; CHECK-NEXT: ret float [[POW]]
519 %pow = tail call fast float @_Z3powff(float %x, float %y) #3
523 define float @test_pow_afn_f32_0.0(float %x) {
524 ; CHECK-LABEL: define float @test_pow_afn_f32_0.0
525 ; CHECK-SAME: (float [[X:%.*]]) {
526 ; CHECK-NEXT: ret float 1.000000e+00
528 %pow = tail call afn float @_Z3powff(float %x, float 0.0)
532 define float @test_pow_afn_f32_neg0.0(float %x) {
533 ; CHECK-LABEL: define float @test_pow_afn_f32_neg0.0
534 ; CHECK-SAME: (float [[X:%.*]]) {
535 ; CHECK-NEXT: ret float 1.000000e+00
537 %pow = tail call afn float @_Z3powff(float %x, float -0.0)
541 define <2 x float> @test_pow_afn_v2f32_0.0(<2 x float> %x) {
542 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_0.0
543 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
544 ; CHECK-NEXT: ret <2 x float> splat (float 1.000000e+00)
546 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 0.0, float 0.0>)
550 define <2 x float> @test_pow_afn_v2f32_neg0.0(<2 x float> %x) {
551 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_neg0.0
552 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
553 ; CHECK-NEXT: ret <2 x float> splat (float 1.000000e+00)
555 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -0.0, float -0.0>)
559 define <2 x float> @test_pow_afn_v2f32_plus_minus_0.0(<2 x float> %x) {
560 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_plus_minus_0.0
561 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
562 ; CHECK-NEXT: ret <2 x float> splat (float 1.000000e+00)
564 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 0.0, float -0.0>)
568 define <3 x float> @test_pow_afn_v3f32_0.0_splat_undef(<3 x float> %x, <3 x float> %y) {
569 ; CHECK-LABEL: define <3 x float> @test_pow_afn_v3f32_0.0_splat_undef
570 ; CHECK-SAME: (<3 x float> [[X:%.*]], <3 x float> [[Y:%.*]]) {
571 ; CHECK-NEXT: ret <3 x float> splat (float 1.000000e+00)
573 %pow = tail call afn <3 x float> @_Z3powDv3_fS_(<3 x float> %x, <3 x float> <float 0.0, float poison, float 0.0>)
577 define <3 x float> @test_pow_afn_v3f32_neg0.0_splat_undef(<3 x float> %x, <3 x float> %y) {
578 ; CHECK-LABEL: define <3 x float> @test_pow_afn_v3f32_neg0.0_splat_undef
579 ; CHECK-SAME: (<3 x float> [[X:%.*]], <3 x float> [[Y:%.*]]) {
580 ; CHECK-NEXT: ret <3 x float> splat (float 1.000000e+00)
582 %pow = tail call afn <3 x float> @_Z3powDv3_fS_(<3 x float> %x, <3 x float> <float -0.0, float poison, float -0.0>)
586 define float @test_pow_afn_f32_0.5(float %x) {
587 ; CHECK-LABEL: define float @test_pow_afn_f32_0.5
588 ; CHECK-SAME: (float [[X:%.*]]) {
589 ; CHECK-NEXT: [[__POW2SQRT:%.*]] = call afn float @_Z4sqrtf(float [[X]])
590 ; CHECK-NEXT: ret float [[__POW2SQRT]]
592 %pow = tail call afn float @_Z3powff(float %x, float 0.5)
596 define float @test_pow_afn_f32_neg0.5(float %x) {
597 ; CHECK-LABEL: define float @test_pow_afn_f32_neg0.5
598 ; CHECK-SAME: (float [[X:%.*]]) {
599 ; CHECK-NEXT: [[__POW2RSQRT:%.*]] = call afn float @_Z5rsqrtf(float [[X]])
600 ; CHECK-NEXT: ret float [[__POW2RSQRT]]
602 %pow = tail call afn float @_Z3powff(float %x, float -0.5)
606 define <2 x float> @test_pow_afn_v2f32_0.5(<2 x float> %x) {
607 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_0.5
608 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
609 ; CHECK-NEXT: [[__POW2SQRT:%.*]] = call afn <2 x float> @_Z4sqrtDv2_f(<2 x float> [[X]])
610 ; CHECK-NEXT: ret <2 x float> [[__POW2SQRT]]
612 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 0.5, float 0.5>)
616 define <2 x float> @test_pow_afn_v2f32_neg0.5(<2 x float> %x) {
617 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_neg0.5
618 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
619 ; CHECK-NEXT: [[__POW2RSQRT:%.*]] = call afn <2 x float> @_Z5rsqrtDv2_f(<2 x float> [[X]])
620 ; CHECK-NEXT: ret <2 x float> [[__POW2RSQRT]]
622 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -0.5, float -0.5>)
626 define <2 x float> @test_pow_afn_v2f32_plus_minus_0.5(<2 x float> %x) {
627 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_plus_minus_0.5
628 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
629 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> <float 5.000000e-01, float -5.000000e-01>)
630 ; CHECK-NEXT: ret <2 x float> [[POW]]
632 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 0.5, float -0.5>)
636 define <3 x float> @test_pow_afn_v3f32_0.5_splat_undef(<3 x float> %x, <3 x float> %y) {
637 ; CHECK-LABEL: define <3 x float> @test_pow_afn_v3f32_0.5_splat_undef
638 ; CHECK-SAME: (<3 x float> [[X:%.*]], <3 x float> [[Y:%.*]]) {
639 ; CHECK-NEXT: [[__POW2SQRT:%.*]] = call afn <3 x float> @_Z4sqrtDv3_f(<3 x float> [[X]])
640 ; CHECK-NEXT: ret <3 x float> [[__POW2SQRT]]
642 %pow = tail call afn <3 x float> @_Z3powDv3_fS_(<3 x float> %x, <3 x float> <float 0.5, float poison, float 0.5>)
646 define <3 x float> @test_pow_afn_v3f32_neg0.5_splat_undef(<3 x float> %x, <3 x float> %y) {
647 ; CHECK-LABEL: define <3 x float> @test_pow_afn_v3f32_neg0.5_splat_undef
648 ; CHECK-SAME: (<3 x float> [[X:%.*]], <3 x float> [[Y:%.*]]) {
649 ; CHECK-NEXT: [[__POW2RSQRT:%.*]] = call afn <3 x float> @_Z5rsqrtDv3_f(<3 x float> [[X]])
650 ; CHECK-NEXT: ret <3 x float> [[__POW2RSQRT]]
652 %pow = tail call afn <3 x float> @_Z3powDv3_fS_(<3 x float> %x, <3 x float> <float -0.5, float poison, float -0.5>)
656 define float @test_pow_afn_f32_1.0(float %x) {
657 ; CHECK-LABEL: define float @test_pow_afn_f32_1.0
658 ; CHECK-SAME: (float [[X:%.*]]) {
659 ; CHECK-NEXT: ret float [[X]]
661 %pow = tail call afn float @_Z3powff(float %x, float 1.0)
665 define float @test_pow_afn_f32_neg1.0(float %x) {
666 ; CHECK-LABEL: define float @test_pow_afn_f32_neg1.0
667 ; CHECK-SAME: (float [[X:%.*]]) {
668 ; CHECK-NEXT: [[__POWRECIP:%.*]] = fdiv afn float 1.000000e+00, [[X]]
669 ; CHECK-NEXT: ret float [[__POWRECIP]]
671 %pow = tail call afn float @_Z3powff(float %x, float -1.0)
675 define <2 x float> @test_pow_afn_v2f32_1.0(<2 x float> %x) {
676 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_1.0
677 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
678 ; CHECK-NEXT: ret <2 x float> [[X]]
680 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 1.0, float 1.0>)
684 define <2 x float> @test_pow_afn_v2f32_neg1.0(<2 x float> %x) {
685 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_neg1.0
686 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
687 ; CHECK-NEXT: [[__POWRECIP:%.*]] = fdiv afn <2 x float> splat (float 1.000000e+00), [[X]]
688 ; CHECK-NEXT: ret <2 x float> [[__POWRECIP]]
690 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -1.0, float -1.0>)
694 define <2 x float> @test_pow_afn_v2f32_plus_minus_1.0(<2 x float> %x) {
695 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_plus_minus_1.0
696 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
697 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> <i32 1, i32 -1>)
698 ; CHECK-NEXT: ret <2 x float> [[POW]]
700 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 1.0, float -1.0>)
704 define <3 x float> @test_pow_afn_v3f32_1.0_splat_undef(<3 x float> %x, <3 x float> %y) {
705 ; CHECK-LABEL: define <3 x float> @test_pow_afn_v3f32_1.0_splat_undef
706 ; CHECK-SAME: (<3 x float> [[X:%.*]], <3 x float> [[Y:%.*]]) {
707 ; CHECK-NEXT: ret <3 x float> [[X]]
709 %pow = tail call afn <3 x float> @_Z3powDv3_fS_(<3 x float> %x, <3 x float> <float 1.0, float poison, float 1.0>)
713 define <3 x float> @test_pow_afn_v3f32_neg1.0_splat_undef(<3 x float> %x, <3 x float> %y) {
714 ; CHECK-LABEL: define <3 x float> @test_pow_afn_v3f32_neg1.0_splat_undef
715 ; CHECK-SAME: (<3 x float> [[X:%.*]], <3 x float> [[Y:%.*]]) {
716 ; CHECK-NEXT: [[__POWRECIP:%.*]] = fdiv afn <3 x float> splat (float 1.000000e+00), [[X]]
717 ; CHECK-NEXT: ret <3 x float> [[__POWRECIP]]
719 %pow = tail call afn <3 x float> @_Z3powDv3_fS_(<3 x float> %x, <3 x float> <float -1.0, float poison, float -1.0>)
723 define float @test_pow_afn_f32_2.0(float %x) {
724 ; CHECK-LABEL: define float @test_pow_afn_f32_2.0
725 ; CHECK-SAME: (float [[X:%.*]]) {
726 ; CHECK-NEXT: [[__POW2:%.*]] = fmul afn float [[X]], [[X]]
727 ; CHECK-NEXT: ret float [[__POW2]]
729 %pow = tail call afn float @_Z3powff(float %x, float 2.0)
733 define float @test_pow_afn_f32_neg2.0(float %x) {
734 ; CHECK-LABEL: define float @test_pow_afn_f32_neg2.0
735 ; CHECK-SAME: (float [[X:%.*]]) {
736 ; CHECK-NEXT: [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 -2)
737 ; CHECK-NEXT: ret float [[POW]]
739 %pow = tail call afn float @_Z3powff(float %x, float -2.0)
743 define <2 x float> @test_pow_afn_v2f32_2.0(<2 x float> %x) {
744 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_2.0
745 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
746 ; CHECK-NEXT: [[__POW2:%.*]] = fmul afn <2 x float> [[X]], [[X]]
747 ; CHECK-NEXT: ret <2 x float> [[__POW2]]
749 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 2.0, float 2.0>)
753 define <2 x float> @test_pow_afn_v2f32_neg2.0(<2 x float> %x) {
754 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_neg2.0
755 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
756 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 -2))
757 ; CHECK-NEXT: ret <2 x float> [[POW]]
759 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -2.0, float -2.0>)
763 define <2 x float> @test_pow_afn_v2f32_plus_minus_2.0(<2 x float> %x) {
764 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_plus_minus_2.0
765 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
766 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> <i32 2, i32 -2>)
767 ; CHECK-NEXT: ret <2 x float> [[POW]]
769 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 2.0, float -2.0>)
773 define float @test_pow_afn_f32_3.0(float %x) {
774 ; CHECK-LABEL: define float @test_pow_afn_f32_3.0
775 ; CHECK-SAME: (float [[X:%.*]]) {
776 ; CHECK-NEXT: [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 3)
777 ; CHECK-NEXT: ret float [[POW]]
779 %pow = tail call afn float @_Z3powff(float %x, float 3.0)
783 define float @test_pow_afn_f32_neg3.0(float %x) {
784 ; CHECK-LABEL: define float @test_pow_afn_f32_neg3.0
785 ; CHECK-SAME: (float [[X:%.*]]) {
786 ; CHECK-NEXT: [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 -3)
787 ; CHECK-NEXT: ret float [[POW]]
789 %pow = tail call afn float @_Z3powff(float %x, float -3.0)
793 define <2 x float> @test_pow_afn_v2f32_3.0(<2 x float> %x) {
794 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_3.0
795 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
796 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 3))
797 ; CHECK-NEXT: ret <2 x float> [[POW]]
799 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 3.0, float 3.0>)
803 define <2 x float> @test_pow_afn_v2f32_neg3.0(<2 x float> %x) {
804 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_neg3.0
805 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
806 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 -3))
807 ; CHECK-NEXT: ret <2 x float> [[POW]]
809 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -3.0, float -3.0>)
813 define <2 x float> @test_pow_afn_v2f32_plus_minus_3.0(<2 x float> %x) {
814 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_plus_minus_3.0
815 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
816 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> <i32 3, i32 -3>)
817 ; CHECK-NEXT: ret <2 x float> [[POW]]
819 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 3.0, float -3.0>)
823 define float @test_pow_afn_f32_3.99(float %x) {
824 ; CHECK-LABEL: define float @test_pow_afn_f32_3.99
825 ; CHECK-SAME: (float [[X:%.*]]) {
826 ; CHECK-NEXT: [[POW:%.*]] = tail call afn float @_Z3powff(float [[X]], float 0x400FEB8520000000)
827 ; CHECK-NEXT: ret float [[POW]]
829 %pow = tail call afn float @_Z3powff(float %x, float 0x400FEB8520000000)
833 define float @test_pow_afn_f32_neg3.99(float %x) {
834 ; CHECK-LABEL: define float @test_pow_afn_f32_neg3.99
835 ; CHECK-SAME: (float [[X:%.*]]) {
836 ; CHECK-NEXT: [[POW:%.*]] = tail call afn float @_Z3powff(float [[X]], float 0xC00FEB8520000000)
837 ; CHECK-NEXT: ret float [[POW]]
839 %pow = tail call afn float @_Z3powff(float %x, float 0xC00FEB8520000000)
843 define <2 x float> @test_pow_afn_v2f32_3.99(<2 x float> %x) {
844 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_3.99
845 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
846 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> splat (float 0x400FEB8520000000))
847 ; CHECK-NEXT: ret <2 x float> [[POW]]
849 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 0x400FEB8520000000, float 0x400FEB8520000000>)
853 define <2 x float> @test_pow_afn_v2f32_neg3.99(<2 x float> %x) {
854 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_neg3.99
855 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
856 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> splat (float 0xC00FEB8520000000))
857 ; CHECK-NEXT: ret <2 x float> [[POW]]
859 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 0xC00FEB8520000000, float 0xC00FEB8520000000>)
863 define <2 x float> @test_pow_afn_v2f32_plus_minus_3.99(<2 x float> %x) {
864 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_plus_minus_3.99
865 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
866 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> <float 0x400FEB8520000000, float 0xC00FEB8520000000>)
867 ; CHECK-NEXT: ret <2 x float> [[POW]]
869 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 0x400FEB8520000000, float 0xC00FEB8520000000>)
873 define float @test_pow_afn_f32_8.0(float %x) {
874 ; CHECK-LABEL: define float @test_pow_afn_f32_8.0
875 ; CHECK-SAME: (float [[X:%.*]]) {
876 ; CHECK-NEXT: [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 8)
877 ; CHECK-NEXT: ret float [[POW]]
879 %pow = tail call afn float @_Z3powff(float %x, float 8.0)
883 define float @test_pow_afn_f32_neg8.0(float %x) {
884 ; CHECK-LABEL: define float @test_pow_afn_f32_neg8.0
885 ; CHECK-SAME: (float [[X:%.*]]) {
886 ; CHECK-NEXT: [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 -8)
887 ; CHECK-NEXT: ret float [[POW]]
889 %pow = tail call afn float @_Z3powff(float %x, float -8.0)
893 define <2 x float> @test_pow_afn_v2f32_8.0(<2 x float> %x) {
894 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_8.0
895 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
896 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 8))
897 ; CHECK-NEXT: ret <2 x float> [[POW]]
899 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 8.0, float 8.0>)
903 define <2 x float> @test_pow_afn_v2f32_neg8.0(<2 x float> %x) {
904 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_neg8.0
905 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
906 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 -8))
907 ; CHECK-NEXT: ret <2 x float> [[POW]]
909 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -8.0, float -8.0>)
913 define <2 x float> @test_pow_afn_v2f32_plus_minus_8.0(<2 x float> %x) {
914 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_plus_minus_8.0
915 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
916 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> <i32 8, i32 -8>)
917 ; CHECK-NEXT: ret <2 x float> [[POW]]
919 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 8.0, float -8.0>)
923 define float @test_pow_afn_f32_12.0(float %x) {
924 ; CHECK-LABEL: define float @test_pow_afn_f32_12.0
925 ; CHECK-SAME: (float [[X:%.*]]) {
926 ; CHECK-NEXT: [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 12)
927 ; CHECK-NEXT: ret float [[POW]]
929 %pow = tail call afn float @_Z3powff(float %x, float 12.0)
933 define float @test_pow_afn_f32_neg12.0(float %x) {
934 ; CHECK-LABEL: define float @test_pow_afn_f32_neg12.0
935 ; CHECK-SAME: (float [[X:%.*]]) {
936 ; CHECK-NEXT: [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 -12)
937 ; CHECK-NEXT: ret float [[POW]]
939 %pow = tail call afn float @_Z3powff(float %x, float -12.0)
943 define <2 x float> @test_pow_afn_v2f32_12.0(<2 x float> %x) {
944 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_12.0
945 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
946 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 12))
947 ; CHECK-NEXT: ret <2 x float> [[POW]]
949 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 12.0, float 12.0>)
953 define <2 x float> @test_pow_afn_v2f32_neg12.0(<2 x float> %x) {
954 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_neg12.0
955 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
956 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 -12))
957 ; CHECK-NEXT: ret <2 x float> [[POW]]
959 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -12.0, float -12.0>)
963 define <2 x float> @test_pow_afn_v2f32_plus_minus_12.0(<2 x float> %x) {
964 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_plus_minus_12.0
965 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
966 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> <i32 12, i32 -12>)
967 ; CHECK-NEXT: ret <2 x float> [[POW]]
969 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 12.0, float -12.0>)
973 define float @test_pow_afn_f32_13.0(float %x) {
974 ; CHECK-LABEL: define float @test_pow_afn_f32_13.0
975 ; CHECK-SAME: (float [[X:%.*]]) {
976 ; CHECK-NEXT: [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 13)
977 ; CHECK-NEXT: ret float [[POW]]
979 %pow = tail call afn float @_Z3powff(float %x, float 13.0)
983 define float @test_pow_afn_f32_neg13.0(float %x) {
984 ; CHECK-LABEL: define float @test_pow_afn_f32_neg13.0
985 ; CHECK-SAME: (float [[X:%.*]]) {
986 ; CHECK-NEXT: [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 -13)
987 ; CHECK-NEXT: ret float [[POW]]
989 %pow = tail call afn float @_Z3powff(float %x, float -13.0)
993 define <2 x float> @test_pow_afn_v2f32_13.0(<2 x float> %x) {
994 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_13.0
995 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
996 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 13))
997 ; CHECK-NEXT: ret <2 x float> [[POW]]
999 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 13.0, float 13.0>)
1000 ret <2 x float> %pow
1003 define <2 x float> @test_pow_afn_v2f32_neg13.0(<2 x float> %x) {
1004 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_neg13.0
1005 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1006 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 -13))
1007 ; CHECK-NEXT: ret <2 x float> [[POW]]
1009 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -13.0, float -13.0>)
1010 ret <2 x float> %pow
1013 define <2 x float> @test_pow_afn_v2f32_13.0_15.0(<2 x float> %x) {
1014 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_13.0_15.0
1015 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1016 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> <i32 13, i32 15>)
1017 ; CHECK-NEXT: ret <2 x float> [[POW]]
1019 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 13.0, float 15.0>)
1020 ret <2 x float> %pow
1023 define <2 x float> @test_pow_afn_v2f32_13.0_14.0(<2 x float> %x) {
1024 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_13.0_14.0
1025 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1026 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> <i32 13, i32 14>)
1027 ; CHECK-NEXT: ret <2 x float> [[POW]]
1029 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 13.0, float 14.0>)
1030 ret <2 x float> %pow
1033 define <2 x float> @test_pow_afn_v2f32_14.0_16.0(<2 x float> %x) {
1034 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_14.0_16.0
1035 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1036 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> <i32 14, i32 16>)
1037 ; CHECK-NEXT: ret <2 x float> [[POW]]
1039 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 14.0, float 16.0>)
1040 ret <2 x float> %pow
1043 define <2 x float> @test_pow_afn_v2f32_plus_minus_13.0(<2 x float> %x) {
1044 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_plus_minus_13.0
1045 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1046 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> <i32 13, i32 -13>)
1047 ; CHECK-NEXT: ret <2 x float> [[POW]]
1049 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 13.0, float -13.0>)
1050 ret <2 x float> %pow
1053 define <2 x float> @test_pow_afn_v2f32_plus_minus_13.0_minus_14.0(<2 x float> %x) {
1054 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_plus_minus_13.0_minus_14.0
1055 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1056 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> <i32 -13, i32 -14>)
1057 ; CHECK-NEXT: ret <2 x float> [[POW]]
1059 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -13.0, float -14.0>)
1060 ret <2 x float> %pow
1063 define float @test_pow_afn_f32_nnan_x_known_positive(float nofpclass(ninf nnorm nsub) %x, float %y) {
1064 ; CHECK-LABEL: define float @test_pow_afn_f32_nnan_x_known_positive
1065 ; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]], float [[Y:%.*]]) {
1066 ; CHECK-NEXT: [[POW:%.*]] = tail call nnan afn float @_Z4powrff(float [[X]], float [[Y]])
1067 ; CHECK-NEXT: ret float [[POW]]
1069 %pow = tail call afn nnan float @_Z3powff(float %x, float %y)
1073 define float @test_pow_afn_f32_nnan_ninf_x_known_positive(float nofpclass(ninf nnorm nsub) %x, float %y) {
1074 ; CHECK-LABEL: define float @test_pow_afn_f32_nnan_ninf_x_known_positive
1075 ; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]], float [[Y:%.*]]) {
1076 ; CHECK-NEXT: [[__LOG2:%.*]] = call nnan ninf afn float @llvm.log2.f32(float [[X]])
1077 ; CHECK-NEXT: [[__YLOGX:%.*]] = fmul nnan ninf afn float [[Y]], [[__LOG2]]
1078 ; CHECK-NEXT: [[__EXP2:%.*]] = call nnan ninf afn float @llvm.exp2.f32(float [[__YLOGX]])
1079 ; CHECK-NEXT: ret float [[__EXP2]]
1081 %pow = tail call afn nnan ninf float @_Z3powff(float %x, float %y)
1085 define <2 x float> @test_pow_afn_v2f32_nnan_x_known_positive(<2 x float> nofpclass(ninf nnorm nsub) %x, <2 x float> %y) {
1086 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_nnan_x_known_positive
1087 ; CHECK-SAME: (<2 x float> nofpclass(ninf nsub nnorm) [[X:%.*]], <2 x float> [[Y:%.*]]) {
1088 ; CHECK-NEXT: [[POW:%.*]] = tail call nnan afn <2 x float> @_Z4powrDv2_fS_(<2 x float> [[X]], <2 x float> [[Y]])
1089 ; CHECK-NEXT: ret <2 x float> [[POW]]
1091 %pow = tail call afn nnan <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> %y)
1092 ret <2 x float> %pow
1095 define <2 x float> @test_pow_afn_v2f32_nnan_ninf_x_known_positive(<2 x float> nofpclass(ninf nnorm nsub) %x, <2 x float> %y) {
1096 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_nnan_ninf_x_known_positive
1097 ; CHECK-SAME: (<2 x float> nofpclass(ninf nsub nnorm) [[X:%.*]], <2 x float> [[Y:%.*]]) {
1098 ; CHECK-NEXT: [[__LOG2:%.*]] = call nnan ninf afn <2 x float> @llvm.log2.v2f32(<2 x float> [[X]])
1099 ; CHECK-NEXT: [[__YLOGX:%.*]] = fmul nnan ninf afn <2 x float> [[Y]], [[__LOG2]]
1100 ; CHECK-NEXT: [[__EXP2:%.*]] = call nnan ninf afn <2 x float> @llvm.exp2.v2f32(<2 x float> [[__YLOGX]])
1101 ; CHECK-NEXT: ret <2 x float> [[__EXP2]]
1103 %pow = tail call afn nnan ninf <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> %y)
1104 ret <2 x float> %pow
1107 define float @test_pow_f32_x_known_positive(float nofpclass(ninf nnorm nsub) %x, float %y) {
1108 ; CHECK-LABEL: define float @test_pow_f32_x_known_positive
1109 ; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]], float [[Y:%.*]]) {
1110 ; CHECK-NEXT: [[POW:%.*]] = tail call float @_Z4powrff(float [[X]], float [[Y]])
1111 ; CHECK-NEXT: ret float [[POW]]
1113 %pow = tail call float @_Z3powff(float %x, float %y)
1117 define float @test_pow_afn_f32_x_known_positive(float nofpclass(ninf nnorm nsub) %x, float %y) {
1118 ; CHECK-LABEL: define float @test_pow_afn_f32_x_known_positive
1119 ; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]], float [[Y:%.*]]) {
1120 ; CHECK-NEXT: [[POW:%.*]] = tail call afn float @_Z4powrff(float [[X]], float [[Y]])
1121 ; CHECK-NEXT: ret float [[POW]]
1123 %pow = tail call afn float @_Z3powff(float %x, float %y)
1127 define <2 x float> @test_pow_v2f32_x_known_positive(<2 x float> nofpclass(ninf nnorm nsub) %x, <2 x float> %y) {
1128 ; CHECK-LABEL: define <2 x float> @test_pow_v2f32_x_known_positive
1129 ; CHECK-SAME: (<2 x float> nofpclass(ninf nsub nnorm) [[X:%.*]], <2 x float> [[Y:%.*]]) {
1130 ; CHECK-NEXT: [[POW:%.*]] = tail call <2 x float> @_Z4powrDv2_fS_(<2 x float> [[X]], <2 x float> [[Y]])
1131 ; CHECK-NEXT: ret <2 x float> [[POW]]
1133 %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> %y)
1134 ret <2 x float> %pow
1137 define <2 x float> @test_pow_afn_v2f32_x_known_positive(<2 x float> nofpclass(ninf nnorm nsub) %x, <2 x float> %y) {
1138 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_x_known_positive
1139 ; CHECK-SAME: (<2 x float> nofpclass(ninf nsub nnorm) [[X:%.*]], <2 x float> [[Y:%.*]]) {
1140 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x float> @_Z4powrDv2_fS_(<2 x float> [[X]], <2 x float> [[Y]])
1141 ; CHECK-NEXT: ret <2 x float> [[POW]]
1143 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> %y)
1144 ret <2 x float> %pow
1147 define double @test_pow_afn_f64_nnan_x_known_positive(double nofpclass(ninf nnorm nsub) %x, double %y) {
1148 ; CHECK-LABEL: define double @test_pow_afn_f64_nnan_x_known_positive
1149 ; CHECK-SAME: (double nofpclass(ninf nsub nnorm) [[X:%.*]], double [[Y:%.*]]) {
1150 ; CHECK-NEXT: [[POW:%.*]] = tail call nnan afn double @_Z4powrdd(double [[X]], double [[Y]])
1151 ; CHECK-NEXT: ret double [[POW]]
1153 %pow = tail call afn nnan double @_Z3powdd(double %x, double %y)
1157 define double @test_pow_afn_f64_nnan_ninf_x_known_positive(double nofpclass(ninf nnorm nsub) %x, double %y) {
1158 ; CHECK-LABEL: define double @test_pow_afn_f64_nnan_ninf_x_known_positive
1159 ; CHECK-SAME: (double nofpclass(ninf nsub nnorm) [[X:%.*]], double [[Y:%.*]]) {
1160 ; CHECK-NEXT: [[__LOG2:%.*]] = call nnan ninf afn double @_Z4log2d(double [[X]])
1161 ; CHECK-NEXT: [[__YLOGX:%.*]] = fmul nnan ninf afn double [[Y]], [[__LOG2]]
1162 ; CHECK-NEXT: [[__EXP2:%.*]] = call nnan ninf afn double @_Z4exp2d(double [[__YLOGX]])
1163 ; CHECK-NEXT: ret double [[__EXP2]]
1165 %pow = tail call afn nnan ninf double @_Z3powdd(double %x, double %y)
1169 define <2 x double> @test_pow_afn_v2f64_nnan_x_known_positive(<2 x double> nofpclass(ninf nnorm nsub) %x, <2 x double> %y) {
1170 ; CHECK-LABEL: define <2 x double> @test_pow_afn_v2f64_nnan_x_known_positive
1171 ; CHECK-SAME: (<2 x double> nofpclass(ninf nsub nnorm) [[X:%.*]], <2 x double> [[Y:%.*]]) {
1172 ; CHECK-NEXT: [[POW:%.*]] = tail call nnan afn <2 x double> @_Z4powrDv2_dS_(<2 x double> [[X]], <2 x double> [[Y]])
1173 ; CHECK-NEXT: ret <2 x double> [[POW]]
1175 %pow = tail call afn nnan <2 x double> @_Z3powDv2_dS_(<2 x double> %x, <2 x double> %y)
1176 ret <2 x double> %pow
1179 define <2 x double> @test_pow_afn_v2f64_nnan_ninf_x_known_positive(<2 x double> nofpclass(ninf nnorm nsub) %x, <2 x double> %y) {
1180 ; CHECK-LABEL: define <2 x double> @test_pow_afn_v2f64_nnan_ninf_x_known_positive
1181 ; CHECK-SAME: (<2 x double> nofpclass(ninf nsub nnorm) [[X:%.*]], <2 x double> [[Y:%.*]]) {
1182 ; CHECK-NEXT: [[__LOG2:%.*]] = call nnan ninf afn <2 x double> @_Z4log2Dv2_d(<2 x double> [[X]])
1183 ; CHECK-NEXT: [[__YLOGX:%.*]] = fmul nnan ninf afn <2 x double> [[Y]], [[__LOG2]]
1184 ; CHECK-NEXT: [[__EXP2:%.*]] = call nnan ninf afn <2 x double> @_Z4exp2Dv2_d(<2 x double> [[__YLOGX]])
1185 ; CHECK-NEXT: ret <2 x double> [[__EXP2]]
1187 %pow = tail call afn nnan ninf <2 x double> @_Z3powDv2_dS_(<2 x double> %x, <2 x double> %y)
1188 ret <2 x double> %pow
1191 define double @test_pow_f64_x_known_positive(double nofpclass(ninf nnorm nsub) %x, double %y) {
1192 ; CHECK-LABEL: define double @test_pow_f64_x_known_positive
1193 ; CHECK-SAME: (double nofpclass(ninf nsub nnorm) [[X:%.*]], double [[Y:%.*]]) {
1194 ; CHECK-NEXT: [[POW:%.*]] = tail call double @_Z4powrdd(double [[X]], double [[Y]])
1195 ; CHECK-NEXT: ret double [[POW]]
1197 %pow = tail call double @_Z3powdd(double %x, double %y)
1201 define double @test_pow_afn_f64_x_known_positive(double nofpclass(ninf nnorm nsub) %x, double %y) {
1202 ; CHECK-LABEL: define double @test_pow_afn_f64_x_known_positive
1203 ; CHECK-SAME: (double nofpclass(ninf nsub nnorm) [[X:%.*]], double [[Y:%.*]]) {
1204 ; CHECK-NEXT: [[POW:%.*]] = tail call afn double @_Z4powrdd(double [[X]], double [[Y]])
1205 ; CHECK-NEXT: ret double [[POW]]
1207 %pow = tail call afn double @_Z3powdd(double %x, double %y)
1211 define <2 x double> @test_pow_v2f64_x_known_positive(<2 x double> nofpclass(ninf nnorm nsub) %x, <2 x double> %y) {
1212 ; CHECK-LABEL: define <2 x double> @test_pow_v2f64_x_known_positive
1213 ; CHECK-SAME: (<2 x double> nofpclass(ninf nsub nnorm) [[X:%.*]], <2 x double> [[Y:%.*]]) {
1214 ; CHECK-NEXT: [[POW:%.*]] = tail call <2 x double> @_Z4powrDv2_dS_(<2 x double> [[X]], <2 x double> [[Y]])
1215 ; CHECK-NEXT: ret <2 x double> [[POW]]
1217 %pow = tail call <2 x double> @_Z3powDv2_dS_(<2 x double> %x, <2 x double> %y)
1218 ret <2 x double> %pow
1221 define <2 x double> @test_pow_afn_v2f64_x_known_positive(<2 x double> nofpclass(ninf nnorm nsub) %x, <2 x double> %y) {
1222 ; CHECK-LABEL: define <2 x double> @test_pow_afn_v2f64_x_known_positive
1223 ; CHECK-SAME: (<2 x double> nofpclass(ninf nsub nnorm) [[X:%.*]], <2 x double> [[Y:%.*]]) {
1224 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x double> @_Z4powrDv2_dS_(<2 x double> [[X]], <2 x double> [[Y]])
1225 ; CHECK-NEXT: ret <2 x double> [[POW]]
1227 %pow = tail call afn <2 x double> @_Z3powDv2_dS_(<2 x double> %x, <2 x double> %y)
1228 ret <2 x double> %pow
1231 define half @test_pow_afn_f16_nnan_x_known_positive(half nofpclass(ninf nnorm nsub) %x, half %y) {
1232 ; CHECK-LABEL: define half @test_pow_afn_f16_nnan_x_known_positive
1233 ; CHECK-SAME: (half nofpclass(ninf nsub nnorm) [[X:%.*]], half [[Y:%.*]]) {
1234 ; CHECK-NEXT: [[POW:%.*]] = tail call nnan afn half @_Z4powrDhDh(half [[X]], half [[Y]])
1235 ; CHECK-NEXT: ret half [[POW]]
1237 %pow = tail call afn nnan half @_Z3powDhDh(half %x, half %y)
1241 define half @test_pow_afn_f16_nnan_ninf_x_known_positive(half nofpclass(ninf nnorm nsub) %x, half %y) {
1242 ; CHECK-LABEL: define half @test_pow_afn_f16_nnan_ninf_x_known_positive
1243 ; CHECK-SAME: (half nofpclass(ninf nsub nnorm) [[X:%.*]], half [[Y:%.*]]) {
1244 ; CHECK-NEXT: [[__LOG2:%.*]] = call nnan ninf afn half @llvm.log2.f16(half [[X]])
1245 ; CHECK-NEXT: [[__YLOGX:%.*]] = fmul nnan ninf afn half [[Y]], [[__LOG2]]
1246 ; CHECK-NEXT: [[__EXP2:%.*]] = call nnan ninf afn half @llvm.exp2.f16(half [[__YLOGX]])
1247 ; CHECK-NEXT: ret half [[__EXP2]]
1249 %pow = tail call afn nnan ninf half @_Z3powDhDh(half %x, half %y)
1253 define <2 x half> @test_pow_afn_v2f16_nnan_x_known_positive(<2 x half> nofpclass(ninf nnorm nsub) %x, <2 x half> %y) {
1254 ; CHECK-LABEL: define <2 x half> @test_pow_afn_v2f16_nnan_x_known_positive
1255 ; CHECK-SAME: (<2 x half> nofpclass(ninf nsub nnorm) [[X:%.*]], <2 x half> [[Y:%.*]]) {
1256 ; CHECK-NEXT: [[POW:%.*]] = tail call nnan afn <2 x half> @_Z4powrDv2_DhS_(<2 x half> [[X]], <2 x half> [[Y]])
1257 ; CHECK-NEXT: ret <2 x half> [[POW]]
1259 %pow = tail call afn nnan <2 x half> @_Z3powDv2_DhS_(<2 x half> %x, <2 x half> %y)
1263 define <2 x half> @test_pow_afn_v2f16_nnan_ninf_x_known_positive(<2 x half> nofpclass(ninf nnorm nsub) %x, <2 x half> %y) {
1264 ; CHECK-LABEL: define <2 x half> @test_pow_afn_v2f16_nnan_ninf_x_known_positive
1265 ; CHECK-SAME: (<2 x half> nofpclass(ninf nsub nnorm) [[X:%.*]], <2 x half> [[Y:%.*]]) {
1266 ; CHECK-NEXT: [[__LOG2:%.*]] = call nnan ninf afn <2 x half> @llvm.log2.v2f16(<2 x half> [[X]])
1267 ; CHECK-NEXT: [[__YLOGX:%.*]] = fmul nnan ninf afn <2 x half> [[Y]], [[__LOG2]]
1268 ; CHECK-NEXT: [[__EXP2:%.*]] = call nnan ninf afn <2 x half> @llvm.exp2.v2f16(<2 x half> [[__YLOGX]])
1269 ; CHECK-NEXT: ret <2 x half> [[__EXP2]]
1271 %pow = tail call afn nnan ninf <2 x half> @_Z3powDv2_DhS_(<2 x half> %x, <2 x half> %y)
1275 define half @test_pow_f16_x_known_positive(half nofpclass(ninf nnorm nsub) %x, half %y) {
1276 ; CHECK-LABEL: define half @test_pow_f16_x_known_positive
1277 ; CHECK-SAME: (half nofpclass(ninf nsub nnorm) [[X:%.*]], half [[Y:%.*]]) {
1278 ; CHECK-NEXT: [[POW:%.*]] = tail call half @_Z4powrDhDh(half [[X]], half [[Y]])
1279 ; CHECK-NEXT: ret half [[POW]]
1281 %pow = tail call half @_Z3powDhDh(half %x, half %y)
1285 define half @test_pow_afn_f16_x_known_positive(half nofpclass(ninf nnorm nsub) %x, half %y) {
1286 ; CHECK-LABEL: define half @test_pow_afn_f16_x_known_positive
1287 ; CHECK-SAME: (half nofpclass(ninf nsub nnorm) [[X:%.*]], half [[Y:%.*]]) {
1288 ; CHECK-NEXT: [[POW:%.*]] = tail call afn half @_Z4powrDhDh(half [[X]], half [[Y]])
1289 ; CHECK-NEXT: ret half [[POW]]
1291 %pow = tail call afn half @_Z3powDhDh(half %x, half %y)
1295 define <2 x half> @test_pow_v2f16_x_known_positive(<2 x half> nofpclass(ninf nnorm nsub) %x, <2 x half> %y) {
1296 ; CHECK-LABEL: define <2 x half> @test_pow_v2f16_x_known_positive
1297 ; CHECK-SAME: (<2 x half> nofpclass(ninf nsub nnorm) [[X:%.*]], <2 x half> [[Y:%.*]]) {
1298 ; CHECK-NEXT: [[POW:%.*]] = tail call <2 x half> @_Z4powrDv2_DhS_(<2 x half> [[X]], <2 x half> [[Y]])
1299 ; CHECK-NEXT: ret <2 x half> [[POW]]
1301 %pow = tail call <2 x half> @_Z3powDv2_DhS_(<2 x half> %x, <2 x half> %y)
1305 define <2 x half> @test_pow_afn_v2f16_x_known_positive(<2 x half> nofpclass(ninf nnorm nsub) %x, <2 x half> %y) {
1306 ; CHECK-LABEL: define <2 x half> @test_pow_afn_v2f16_x_known_positive
1307 ; CHECK-SAME: (<2 x half> nofpclass(ninf nsub nnorm) [[X:%.*]], <2 x half> [[Y:%.*]]) {
1308 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x half> @_Z4powrDv2_DhS_(<2 x half> [[X]], <2 x half> [[Y]])
1309 ; CHECK-NEXT: ret <2 x half> [[POW]]
1311 %pow = tail call afn <2 x half> @_Z3powDv2_DhS_(<2 x half> %x, <2 x half> %y)
1315 define float @test_pow_f32__y_0(float %x) {
1316 ; CHECK-LABEL: define float @test_pow_f32__y_0
1317 ; CHECK-SAME: (float [[X:%.*]]) {
1318 ; CHECK-NEXT: ret float 1.000000e+00
1320 %pow = tail call float @_Z3powff(float %x, float 0.0)
1324 define float @test_pow_f32__y_n0(float %x) {
1325 ; CHECK-LABEL: define float @test_pow_f32__y_n0
1326 ; CHECK-SAME: (float [[X:%.*]]) {
1327 ; CHECK-NEXT: ret float 1.000000e+00
1329 %pow = tail call float @_Z3powff(float %x, float -0.0)
1333 define float @test_pow_f32__y_1(float %x) {
1334 ; CHECK-LABEL: define float @test_pow_f32__y_1
1335 ; CHECK-SAME: (float [[X:%.*]]) {
1336 ; CHECK-NEXT: ret float [[X]]
1338 %pow = tail call float @_Z3powff(float %x, float 1.0)
1342 define float @test_pow_f32__y_n1(float %x) {
1343 ; CHECK-LABEL: define float @test_pow_f32__y_n1
1344 ; CHECK-SAME: (float [[X:%.*]]) {
1345 ; CHECK-NEXT: [[__POWRECIP:%.*]] = fdiv float 1.000000e+00, [[X]]
1346 ; CHECK-NEXT: ret float [[__POWRECIP]]
1348 %pow = tail call float @_Z3powff(float %x, float -1.0)
1352 define float @test_pow_f32__y_2(float %x) {
1353 ; CHECK-LABEL: define float @test_pow_f32__y_2
1354 ; CHECK-SAME: (float [[X:%.*]]) {
1355 ; CHECK-NEXT: [[__POW2:%.*]] = fmul float [[X]], [[X]]
1356 ; CHECK-NEXT: ret float [[__POW2]]
1358 %pow = tail call float @_Z3powff(float %x, float 2.0)
1362 define float @test_pow_f32__y_n2(float %x) {
1363 ; CHECK-LABEL: define float @test_pow_f32__y_n2
1364 ; CHECK-SAME: (float [[X:%.*]]) {
1365 ; CHECK-NEXT: [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 -2)
1366 ; CHECK-NEXT: ret float [[POW]]
1368 %pow = tail call float @_Z3powff(float %x, float -2.0)
1372 define float @test_pow_f32__y_half(float %x) {
1373 ; CHECK-LABEL: define float @test_pow_f32__y_half
1374 ; CHECK-SAME: (float [[X:%.*]]) {
1375 ; CHECK-NEXT: [[__POW2SQRT:%.*]] = call float @_Z4sqrtf(float [[X]])
1376 ; CHECK-NEXT: ret float [[__POW2SQRT]]
1378 %pow = tail call float @_Z3powff(float %x, float 0.5)
1382 define float @test_pow_f32__y_neg_half(float %x) {
1383 ; CHECK-LABEL: define float @test_pow_f32__y_neg_half
1384 ; CHECK-SAME: (float [[X:%.*]]) {
1385 ; CHECK-NEXT: [[__POW2RSQRT:%.*]] = call float @_Z5rsqrtf(float [[X]])
1386 ; CHECK-NEXT: ret float [[__POW2RSQRT]]
1388 %pow = tail call float @_Z3powff(float %x, float -0.5)
1392 define float @test_pow_f32__y_3(float %x) {
1393 ; CHECK-LABEL: define float @test_pow_f32__y_3
1394 ; CHECK-SAME: (float [[X:%.*]]) {
1395 ; CHECK-NEXT: [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 3)
1396 ; CHECK-NEXT: ret float [[POW]]
1398 %pow = tail call float @_Z3powff(float %x, float 3.0)
1402 define float @test_pow_f32__y_n3(float %x) {
1403 ; CHECK-LABEL: define float @test_pow_f32__y_n3
1404 ; CHECK-SAME: (float [[X:%.*]]) {
1405 ; CHECK-NEXT: [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 -3)
1406 ; CHECK-NEXT: ret float [[POW]]
1408 %pow = tail call float @_Z3powff(float %x, float -3.0)
1412 define float @test_pow_f32__y_2_5(float %x) {
1413 ; CHECK-LABEL: define float @test_pow_f32__y_2_5
1414 ; CHECK-SAME: (float [[X:%.*]]) {
1415 ; CHECK-NEXT: [[POW:%.*]] = tail call float @_Z3powff(float [[X]], float 2.500000e+00)
1416 ; CHECK-NEXT: ret float [[POW]]
1418 %pow = tail call float @_Z3powff(float %x, float 2.5)
1422 define float @test_pow_f32__y_n_2_5(float %x) {
1423 ; CHECK-LABEL: define float @test_pow_f32__y_n_2_5
1424 ; CHECK-SAME: (float [[X:%.*]]) {
1425 ; CHECK-NEXT: [[POW:%.*]] = tail call float @_Z3powff(float [[X]], float -2.500000e+00)
1426 ; CHECK-NEXT: ret float [[POW]]
1428 %pow = tail call float @_Z3powff(float %x, float -2.5)
1432 define <2 x float> @test_pow_v2f32__y_0(<2 x float> %x) {
1433 ; CHECK-LABEL: define <2 x float> @test_pow_v2f32__y_0
1434 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1435 ; CHECK-NEXT: ret <2 x float> splat (float 1.000000e+00)
1437 %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> zeroinitializer)
1438 ret <2 x float> %pow
1441 define <2 x float> @test_pow_v2f32__y_n0(<2 x float> %x) {
1442 ; CHECK-LABEL: define <2 x float> @test_pow_v2f32__y_n0
1443 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1444 ; CHECK-NEXT: ret <2 x float> splat (float 1.000000e+00)
1446 %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -0.0, float -0.0>)
1447 ret <2 x float> %pow
1450 define <2 x float> @test_pow_v2f32__y_1(<2 x float> %x) {
1451 ; CHECK-LABEL: define <2 x float> @test_pow_v2f32__y_1
1452 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1453 ; CHECK-NEXT: ret <2 x float> [[X]]
1455 %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 1.0,float 1.0>)
1456 ret <2 x float> %pow
1459 define <2 x float> @test_pow_v2f32__y_n1(<2 x float> %x) {
1460 ; CHECK-LABEL: define <2 x float> @test_pow_v2f32__y_n1
1461 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1462 ; CHECK-NEXT: [[__POWRECIP:%.*]] = fdiv <2 x float> splat (float 1.000000e+00), [[X]]
1463 ; CHECK-NEXT: ret <2 x float> [[__POWRECIP]]
1465 %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -1.0, float -1.0>)
1466 ret <2 x float> %pow
1469 define <2 x float> @test_pow_v2f32__y_2(<2 x float> %x) {
1470 ; CHECK-LABEL: define <2 x float> @test_pow_v2f32__y_2
1471 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1472 ; CHECK-NEXT: [[__POW2:%.*]] = fmul <2 x float> [[X]], [[X]]
1473 ; CHECK-NEXT: ret <2 x float> [[__POW2]]
1475 %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 2.0, float 2.0>)
1476 ret <2 x float> %pow
1479 define <2 x float> @test_pow_v2f32__y_n2(<2 x float> %x) {
1480 ; CHECK-LABEL: define <2 x float> @test_pow_v2f32__y_n2
1481 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1482 ; CHECK-NEXT: [[POW:%.*]] = tail call <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 -2))
1483 ; CHECK-NEXT: ret <2 x float> [[POW]]
1485 %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -2.0, float -2.0>)
1486 ret <2 x float> %pow
1489 define <2 x float> @test_pow_v2f32__y_half(<2 x float> %x) {
1490 ; CHECK-LABEL: define <2 x float> @test_pow_v2f32__y_half
1491 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1492 ; CHECK-NEXT: [[__POW2SQRT:%.*]] = call <2 x float> @_Z4sqrtDv2_f(<2 x float> [[X]])
1493 ; CHECK-NEXT: ret <2 x float> [[__POW2SQRT]]
1495 %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 0.5, float 0.5>)
1496 ret <2 x float> %pow
1499 define <2 x float> @test_pow_v2f32__y_neg_half(<2 x float> %x) {
1500 ; CHECK-LABEL: define <2 x float> @test_pow_v2f32__y_neg_half
1501 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1502 ; CHECK-NEXT: [[__POW2RSQRT:%.*]] = call <2 x float> @_Z5rsqrtDv2_f(<2 x float> [[X]])
1503 ; CHECK-NEXT: ret <2 x float> [[__POW2RSQRT]]
1505 %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -0.5, float -0.5>)
1506 ret <2 x float> %pow
1509 define <2 x float> @test_pow_v2f32__y_3(<2 x float> %x) {
1510 ; CHECK-LABEL: define <2 x float> @test_pow_v2f32__y_3
1511 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1512 ; CHECK-NEXT: [[POW:%.*]] = tail call <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 3))
1513 ; CHECK-NEXT: ret <2 x float> [[POW]]
1515 %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 3.0, float 3.0>)
1516 ret <2 x float> %pow
1519 define <2 x float> @test_pow_v2f32__y_n3(<2 x float> %x) {
1520 ; CHECK-LABEL: define <2 x float> @test_pow_v2f32__y_n3
1521 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1522 ; CHECK-NEXT: [[POW:%.*]] = tail call <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 -3))
1523 ; CHECK-NEXT: ret <2 x float> [[POW]]
1525 %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -3.0,float -3.0>)
1526 ret <2 x float> %pow
1529 define <2 x float> @test_pow_v2f32__y_2_5(<2 x float> %x) {
1530 ; CHECK-LABEL: define <2 x float> @test_pow_v2f32__y_2_5
1531 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1532 ; CHECK-NEXT: [[POW:%.*]] = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> splat (float 2.500000e+00))
1533 ; CHECK-NEXT: ret <2 x float> [[POW]]
1535 %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 2.5, float 2.5>)
1536 ret <2 x float> %pow
1539 define <2 x float> @test_pow_v2f32__y_n_2_5(<2 x float> %x) {
1540 ; CHECK-LABEL: define <2 x float> @test_pow_v2f32__y_n_2_5
1541 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1542 ; CHECK-NEXT: [[POW:%.*]] = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> splat (float -2.500000e+00))
1543 ; CHECK-NEXT: ret <2 x float> [[POW]]
1545 %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -2.5, float -2.5>)
1546 ret <2 x float> %pow
1549 define float @test_pow_f32__known_positive__y_0(float nofpclass(ninf nnorm nsub) %x) {
1550 ; CHECK-LABEL: define float @test_pow_f32__known_positive__y_0
1551 ; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]]) {
1552 ; CHECK-NEXT: ret float 1.000000e+00
1554 %pow = tail call float @_Z3powff(float %x, float 0.0)
1558 define float @test_pow_f32__known_positive__y_1(float nofpclass(ninf nnorm nsub) %x) {
1559 ; CHECK-LABEL: define float @test_pow_f32__known_positive__y_1
1560 ; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]]) {
1561 ; CHECK-NEXT: ret float [[X]]
1563 %pow = tail call float @_Z3powff(float %x, float 1.0)
1567 define float @test_pow_f32__known_positive__y_neg1(float nofpclass(ninf nnorm nsub) %x) {
1568 ; CHECK-LABEL: define float @test_pow_f32__known_positive__y_neg1
1569 ; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]]) {
1570 ; CHECK-NEXT: [[__POWRECIP:%.*]] = fdiv float 1.000000e+00, [[X]]
1571 ; CHECK-NEXT: ret float [[__POWRECIP]]
1573 %pow = tail call float @_Z3powff(float %x, float -1.0)
1577 define float @test_pow_f32__known_positive__y_2(float nofpclass(ninf nnorm nsub) %x) {
1578 ; CHECK-LABEL: define float @test_pow_f32__known_positive__y_2
1579 ; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]]) {
1580 ; CHECK-NEXT: [[__POW2:%.*]] = fmul float [[X]], [[X]]
1581 ; CHECK-NEXT: ret float [[__POW2]]
1583 %pow = tail call float @_Z3powff(float %x, float 2.0)
1587 define float @test_pow_f32__known_positive__y_half(float nofpclass(ninf nnorm nsub) %x) {
1588 ; CHECK-LABEL: define float @test_pow_f32__known_positive__y_half
1589 ; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]]) {
1590 ; CHECK-NEXT: [[__POW2SQRT:%.*]] = call float @_Z4sqrtf(float [[X]])
1591 ; CHECK-NEXT: ret float [[__POW2SQRT]]
1593 %pow = tail call float @_Z3powff(float %x, float 0.5)
1597 define float @test_pow_f32__known_positive__y_neghalf(float nofpclass(ninf nnorm nsub) %x) {
1598 ; CHECK-LABEL: define float @test_pow_f32__known_positive__y_neghalf
1599 ; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]]) {
1600 ; CHECK-NEXT: [[__POW2RSQRT:%.*]] = call float @_Z5rsqrtf(float [[X]])
1601 ; CHECK-NEXT: ret float [[__POW2RSQRT]]
1603 %pow = tail call float @_Z3powff(float %x, float -0.5)
1607 define float @test_pow_f32_x_assumed_oge_0(float %x, float %y) {
1608 ; CHECK-LABEL: define float @test_pow_f32_x_assumed_oge_0
1609 ; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) {
1610 ; CHECK-NEXT: [[X_OGE_ZERO:%.*]] = fcmp oge float [[X]], 0.000000e+00
1611 ; CHECK-NEXT: call void @llvm.assume(i1 [[X_OGE_ZERO]])
1612 ; CHECK-NEXT: [[POW:%.*]] = tail call float @_Z4powrff(float [[X]], float [[Y]])
1613 ; CHECK-NEXT: ret float [[POW]]
1615 %x.oge.zero = fcmp oge float %x, 0.0
1616 call void @llvm.assume(i1 %x.oge.zero)
1617 %pow = tail call float @_Z3powff(float %x, float %y)
1621 define float @test_pow_f32_x_assumed_ogt_0(float %x, float %y) {
1622 ; CHECK-LABEL: define float @test_pow_f32_x_assumed_ogt_0
1623 ; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) {
1624 ; CHECK-NEXT: [[X_OGE_ZERO:%.*]] = fcmp ogt float [[X]], 0.000000e+00
1625 ; CHECK-NEXT: call void @llvm.assume(i1 [[X_OGE_ZERO]])
1626 ; CHECK-NEXT: [[POW:%.*]] = tail call float @_Z4powrff(float [[X]], float [[Y]])
1627 ; CHECK-NEXT: ret float [[POW]]
1629 %x.oge.zero = fcmp ogt float %x, 0.0
1630 call void @llvm.assume(i1 %x.oge.zero)
1631 %pow = tail call float @_Z3powff(float %x, float %y)
1635 define float @test_pow_f32_x_assumed_uge_0(float %x, float %y) {
1636 ; CHECK-LABEL: define float @test_pow_f32_x_assumed_uge_0
1637 ; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) {
1638 ; CHECK-NEXT: [[X_UGE_ZERO:%.*]] = fcmp uge float [[X]], 0.000000e+00
1639 ; CHECK-NEXT: call void @llvm.assume(i1 [[X_UGE_ZERO]])
1640 ; CHECK-NEXT: [[POW:%.*]] = tail call float @_Z4powrff(float [[X]], float [[Y]])
1641 ; CHECK-NEXT: ret float [[POW]]
1643 %x.uge.zero = fcmp uge float %x, 0.0
1644 call void @llvm.assume(i1 %x.uge.zero)
1645 %pow = tail call float @_Z3powff(float %x, float %y)
1649 define float @test_pow_f32_x_assumed_ugt_0(float %x, float %y) {
1650 ; CHECK-LABEL: define float @test_pow_f32_x_assumed_ugt_0
1651 ; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) {
1652 ; CHECK-NEXT: [[X_UGT_ZERO:%.*]] = fcmp ugt float [[X]], 0.000000e+00
1653 ; CHECK-NEXT: call void @llvm.assume(i1 [[X_UGT_ZERO]])
1654 ; CHECK-NEXT: [[POW:%.*]] = tail call float @_Z4powrff(float [[X]], float [[Y]])
1655 ; CHECK-NEXT: ret float [[POW]]
1657 %x.ugt.zero = fcmp ugt float %x, 0.0
1658 call void @llvm.assume(i1 %x.ugt.zero)
1659 %pow = tail call float @_Z3powff(float %x, float %y)
1663 define float @test_pow_afn_f32__y_poison(float %x) {
1664 ; CHECK-LABEL: define float @test_pow_afn_f32__y_poison
1665 ; CHECK-SAME: (float [[X:%.*]]) {
1666 ; CHECK-NEXT: [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 poison)
1667 ; CHECK-NEXT: ret float [[POW]]
1669 %pow = tail call afn float @_Z3powff(float %x, float poison)
1673 define float @test_pow_afn_f32__y_3(float %x) {
1674 ; CHECK-LABEL: define float @test_pow_afn_f32__y_3
1675 ; CHECK-SAME: (float [[X:%.*]]) {
1676 ; CHECK-NEXT: [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 3)
1677 ; CHECK-NEXT: ret float [[POW]]
1679 %pow = tail call afn float @_Z3powff(float %x, float 3.0)
1683 define float @test_pow_afn_f32_nnan_ninf__y_3(float %x) {
1684 ; CHECK-LABEL: define float @test_pow_afn_f32_nnan_ninf__y_3
1685 ; CHECK-SAME: (float [[X:%.*]]) {
1686 ; CHECK-NEXT: [[__POWX2:%.*]] = fmul nnan ninf afn float [[X]], [[X]]
1687 ; CHECK-NEXT: [[__POWPROD:%.*]] = fmul nnan ninf afn float [[X]], [[__POWX2]]
1688 ; CHECK-NEXT: ret float [[__POWPROD]]
1690 %pow = tail call afn nnan ninf float @_Z3powff(float %x, float 3.0)
1694 define float @test_pow_afn_f32__y_4(float %x) {
1695 ; CHECK-LABEL: define float @test_pow_afn_f32__y_4
1696 ; CHECK-SAME: (float [[X:%.*]]) {
1697 ; CHECK-NEXT: [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 4)
1698 ; CHECK-NEXT: ret float [[POW]]
1700 %pow = tail call afn float @_Z3powff(float %x, float 4.0)
1704 define float @test_pow_afn_f32_nnan_ninf__y_4(float %x) {
1705 ; CHECK-LABEL: define float @test_pow_afn_f32_nnan_ninf__y_4
1706 ; CHECK-SAME: (float [[X:%.*]]) {
1707 ; CHECK-NEXT: [[__POWX2:%.*]] = fmul nnan ninf afn float [[X]], [[X]]
1708 ; CHECK-NEXT: [[__POWX21:%.*]] = fmul nnan ninf afn float [[__POWX2]], [[__POWX2]]
1709 ; CHECK-NEXT: ret float [[__POWX21]]
1711 %pow = tail call afn nnan ninf float @_Z3powff(float %x, float 4.0)
1715 define float @test_pow_afn_f32_nnan_ninf__y_4_5(float %x) {
1716 ; CHECK-LABEL: define float @test_pow_afn_f32_nnan_ninf__y_4_5
1717 ; CHECK-SAME: (float [[X:%.*]]) {
1718 ; CHECK-NEXT: [[POW:%.*]] = tail call nnan ninf afn float @_Z3powff(float [[X]], float 4.500000e+00)
1719 ; CHECK-NEXT: ret float [[POW]]
1721 %pow = tail call afn nnan ninf float @_Z3powff(float %x, float 4.5)
1725 define float @test_pow_afn_f32__y_5(float %x) {
1726 ; CHECK-LABEL: define float @test_pow_afn_f32__y_5
1727 ; CHECK-SAME: (float [[X:%.*]]) {
1728 ; CHECK-NEXT: [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 5)
1729 ; CHECK-NEXT: ret float [[POW]]
1731 %pow = tail call afn float @_Z3powff(float %x, float 5.0)
1735 define float @test_pow_afn_f32_nnan_ninf__y_5(float %x) {
1736 ; CHECK-LABEL: define float @test_pow_afn_f32_nnan_ninf__y_5
1737 ; CHECK-SAME: (float [[X:%.*]]) {
1738 ; CHECK-NEXT: [[__POWX2:%.*]] = fmul nnan ninf afn float [[X]], [[X]]
1739 ; CHECK-NEXT: [[__POWX21:%.*]] = fmul nnan ninf afn float [[__POWX2]], [[__POWX2]]
1740 ; CHECK-NEXT: [[__POWPROD:%.*]] = fmul nnan ninf afn float [[X]], [[__POWX21]]
1741 ; CHECK-NEXT: ret float [[__POWPROD]]
1743 %pow = tail call afn nnan ninf float @_Z3powff(float %x, float 5.0)
1747 define float @test_pow_afn_f32__y_neg5(float %x) {
1748 ; CHECK-LABEL: define float @test_pow_afn_f32__y_neg5
1749 ; CHECK-SAME: (float [[X:%.*]]) {
1750 ; CHECK-NEXT: [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 -5)
1751 ; CHECK-NEXT: ret float [[POW]]
1753 %pow = tail call afn float @_Z3powff(float %x, float -5.0)
1757 define float @test_pow_afn_f32_nnan_ninf__y_neg5(float %x) {
1758 ; CHECK-LABEL: define float @test_pow_afn_f32_nnan_ninf__y_neg5
1759 ; CHECK-SAME: (float [[X:%.*]]) {
1760 ; CHECK-NEXT: [[__POWX2:%.*]] = fmul nnan ninf afn float [[X]], [[X]]
1761 ; CHECK-NEXT: [[__POWX21:%.*]] = fmul nnan ninf afn float [[__POWX2]], [[__POWX2]]
1762 ; CHECK-NEXT: [[__POWPROD:%.*]] = fmul nnan ninf afn float [[X]], [[__POWX21]]
1763 ; CHECK-NEXT: [[__1POWPROD:%.*]] = fdiv nnan ninf afn float 1.000000e+00, [[__POWPROD]]
1764 ; CHECK-NEXT: ret float [[__1POWPROD]]
1766 %pow = tail call afn nnan ninf float @_Z3powff(float %x, float -5.0)
1770 define float @test_pow_afn_f32_nnan_ninf__y_10(float %x) {
1771 ; CHECK-LABEL: define float @test_pow_afn_f32_nnan_ninf__y_10
1772 ; CHECK-SAME: (float [[X:%.*]]) {
1773 ; CHECK-NEXT: [[__POWX2:%.*]] = fmul nnan ninf afn float [[X]], [[X]]
1774 ; CHECK-NEXT: [[__POWX21:%.*]] = fmul nnan ninf afn float [[__POWX2]], [[__POWX2]]
1775 ; CHECK-NEXT: [[__POWX22:%.*]] = fmul nnan ninf afn float [[__POWX21]], [[__POWX21]]
1776 ; CHECK-NEXT: [[__POWPROD:%.*]] = fmul nnan ninf afn float [[__POWX2]], [[__POWX22]]
1777 ; CHECK-NEXT: ret float [[__POWPROD]]
1779 %pow = tail call afn nnan ninf float @_Z3powff(float %x, float 10.0)
1783 define <2 x float> @test_pow_afn_v2f32_nnan_ninf__y_poison(<2 x float> %x) {
1784 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_nnan_ninf__y_poison
1785 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1786 ; CHECK-NEXT: ret <2 x float> poison
1788 %pow = tail call afn nnan ninf <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> poison)
1789 ret <2 x float> %pow
1792 define <2 x float> @test_pow_afn_v2f32_nnan_ninf__y_3(<2 x float> %x) {
1793 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_nnan_ninf__y_3
1794 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1795 ; CHECK-NEXT: [[__POWX2:%.*]] = fmul nnan ninf afn <2 x float> [[X]], [[X]]
1796 ; CHECK-NEXT: [[__POWPROD:%.*]] = fmul nnan ninf afn <2 x float> [[X]], [[__POWX2]]
1797 ; CHECK-NEXT: ret <2 x float> [[__POWPROD]]
1799 %pow = tail call afn nnan ninf <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 3.0, float 3.0>)
1800 ret <2 x float> %pow
1803 define <2 x float> @test_pow_afn_v2f32_nnan_ninf__y_4(<2 x float> %x) {
1804 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_nnan_ninf__y_4
1805 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1806 ; CHECK-NEXT: [[__POWX2:%.*]] = fmul nnan ninf afn <2 x float> [[X]], [[X]]
1807 ; CHECK-NEXT: [[__POWX21:%.*]] = fmul nnan ninf afn <2 x float> [[__POWX2]], [[__POWX2]]
1808 ; CHECK-NEXT: ret <2 x float> [[__POWX21]]
1810 %pow = tail call afn nnan ninf <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 4.0, float 4.0>)
1811 ret <2 x float> %pow
1814 define <2 x float> @test_pow_afn_v2f32_nnan_ninf__y_4_5(<2 x float> %x) {
1815 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_nnan_ninf__y_4_5
1816 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1817 ; CHECK-NEXT: [[POW:%.*]] = tail call nnan ninf afn <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> splat (float 4.500000e+00))
1818 ; CHECK-NEXT: ret <2 x float> [[POW]]
1820 %pow = tail call afn nnan ninf <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 4.5, float 4.5>)
1821 ret <2 x float> %pow
1824 define <2 x float> @test_pow_afn_v2f32_nnan_ninf__y_4_5_undef(<2 x float> %x) {
1825 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_nnan_ninf__y_4_5_undef
1826 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1827 ; CHECK-NEXT: [[POW:%.*]] = tail call nnan ninf afn <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> <float 4.500000e+00, float poison>)
1828 ; CHECK-NEXT: ret <2 x float> [[POW]]
1830 %pow = tail call afn nnan ninf <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 4.5, float poison>)
1831 ret <2 x float> %pow
1834 define <2 x float> @test_pow_afn_v2f32_nnan_ninf__y_5(<2 x float> %x) {
1835 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_nnan_ninf__y_5
1836 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1837 ; CHECK-NEXT: [[__POWX2:%.*]] = fmul nnan ninf afn <2 x float> [[X]], [[X]]
1838 ; CHECK-NEXT: [[__POWX21:%.*]] = fmul nnan ninf afn <2 x float> [[__POWX2]], [[__POWX2]]
1839 ; CHECK-NEXT: [[__POWPROD:%.*]] = fmul nnan ninf afn <2 x float> [[X]], [[__POWX21]]
1840 ; CHECK-NEXT: ret <2 x float> [[__POWPROD]]
1842 %pow = tail call afn nnan ninf <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 5.0, float 5.0>)
1843 ret <2 x float> %pow
1846 define float @test_pow_afn_f32_nnan_ninf__y_5_known_positive(float nofpclass(ninf nsub nnorm) %x) {
1847 ; CHECK-LABEL: define float @test_pow_afn_f32_nnan_ninf__y_5_known_positive
1848 ; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]]) {
1849 ; CHECK-NEXT: [[__POWX2:%.*]] = fmul nnan ninf afn float [[X]], [[X]]
1850 ; CHECK-NEXT: [[__POWX21:%.*]] = fmul nnan ninf afn float [[__POWX2]], [[__POWX2]]
1851 ; CHECK-NEXT: [[__POWPROD:%.*]] = fmul nnan ninf afn float [[X]], [[__POWX21]]
1852 ; CHECK-NEXT: ret float [[__POWPROD]]
1854 %pow = tail call afn nnan ninf float @_Z3powff(float %x, float 5.0)
1858 ; we know we can ignore missing ninf on the input from the flag on the call
1859 define float @test_pow_afn_f32_nnan_ninf__y_5_known_positive_with_ninf_flag(float nofpclass(nsub nnorm) %x) {
1860 ; CHECK-LABEL: define float @test_pow_afn_f32_nnan_ninf__y_5_known_positive_with_ninf_flag
1861 ; CHECK-SAME: (float nofpclass(nsub nnorm) [[X:%.*]]) {
1862 ; CHECK-NEXT: [[__POWX2:%.*]] = fmul nnan ninf afn float [[X]], [[X]]
1863 ; CHECK-NEXT: [[__POWX21:%.*]] = fmul nnan ninf afn float [[__POWX2]], [[__POWX2]]
1864 ; CHECK-NEXT: [[__POWPROD:%.*]] = fmul nnan ninf afn float [[X]], [[__POWX21]]
1865 ; CHECK-NEXT: ret float [[__POWPROD]]
1867 %pow = tail call afn nnan ninf float @_Z3powff(float %x, float 5.0)
1871 define double @test_pow_afn_f64__y_3(double %x) {
1872 ; CHECK-LABEL: define double @test_pow_afn_f64__y_3
1873 ; CHECK-SAME: (double [[X:%.*]]) {
1874 ; CHECK-NEXT: [[POW:%.*]] = tail call afn double @_Z4powndi(double [[X]], i32 3)
1875 ; CHECK-NEXT: ret double [[POW]]
1877 %pow = tail call afn double @_Z3powdd(double %x, double 3.0)
1881 define double @test_pow_afn_f64_nnan_ninf__y_3(double %x) {
1882 ; CHECK-LABEL: define double @test_pow_afn_f64_nnan_ninf__y_3
1883 ; CHECK-SAME: (double [[X:%.*]]) {
1884 ; CHECK-NEXT: [[__POWX2:%.*]] = fmul nnan ninf afn double [[X]], [[X]]
1885 ; CHECK-NEXT: [[__POWPROD:%.*]] = fmul nnan ninf afn double [[X]], [[__POWX2]]
1886 ; CHECK-NEXT: ret double [[__POWPROD]]
1888 %pow = tail call afn nnan ninf double @_Z3powdd(double %x, double 3.0)
1892 define double @test_pow_afn_f64__y_4(double %x) {
1893 ; CHECK-LABEL: define double @test_pow_afn_f64__y_4
1894 ; CHECK-SAME: (double [[X:%.*]]) {
1895 ; CHECK-NEXT: [[POW:%.*]] = tail call afn double @_Z4powndi(double [[X]], i32 4)
1896 ; CHECK-NEXT: ret double [[POW]]
1898 %pow = tail call afn double @_Z3powdd(double %x, double 4.0)
1902 define double @test_pow_afn_f64_nnan_ninf__y_4(double %x) {
1903 ; CHECK-LABEL: define double @test_pow_afn_f64_nnan_ninf__y_4
1904 ; CHECK-SAME: (double [[X:%.*]]) {
1905 ; CHECK-NEXT: [[__POWX2:%.*]] = fmul nnan ninf afn double [[X]], [[X]]
1906 ; CHECK-NEXT: [[__POWX21:%.*]] = fmul nnan ninf afn double [[__POWX2]], [[__POWX2]]
1907 ; CHECK-NEXT: ret double [[__POWX21]]
1909 %pow = tail call afn nnan ninf double @_Z3powdd(double %x, double 4.0)
1913 define double @test_pow_afn_f64_nnan_ninf__y_4_5(double %x) {
1914 ; CHECK-LABEL: define double @test_pow_afn_f64_nnan_ninf__y_4_5
1915 ; CHECK-SAME: (double [[X:%.*]]) {
1916 ; CHECK-NEXT: [[POW:%.*]] = tail call nnan ninf afn double @_Z3powdd(double [[X]], double 4.500000e+00)
1917 ; CHECK-NEXT: ret double [[POW]]
1919 %pow = tail call afn nnan ninf double @_Z3powdd(double %x, double 4.5)
1923 define double @test_pow_afn_f64__y_5(double %x) {
1924 ; CHECK-LABEL: define double @test_pow_afn_f64__y_5
1925 ; CHECK-SAME: (double [[X:%.*]]) {
1926 ; CHECK-NEXT: [[POW:%.*]] = tail call afn double @_Z4powndi(double [[X]], i32 5)
1927 ; CHECK-NEXT: ret double [[POW]]
1929 %pow = tail call afn double @_Z3powdd(double %x, double 5.0)
1933 define double @test_pow_afn_f64_nnan_ninf__y_5(double %x) {
1934 ; CHECK-LABEL: define double @test_pow_afn_f64_nnan_ninf__y_5
1935 ; CHECK-SAME: (double [[X:%.*]]) {
1936 ; CHECK-NEXT: [[__POWX2:%.*]] = fmul nnan ninf afn double [[X]], [[X]]
1937 ; CHECK-NEXT: [[__POWX21:%.*]] = fmul nnan ninf afn double [[__POWX2]], [[__POWX2]]
1938 ; CHECK-NEXT: [[__POWPROD:%.*]] = fmul nnan ninf afn double [[X]], [[__POWX21]]
1939 ; CHECK-NEXT: ret double [[__POWPROD]]
1941 %pow = tail call afn nnan ninf double @_Z3powdd(double %x, double 5.0)
1945 define double @test_pow_afn_f64__y_neg5(double %x) {
1946 ; CHECK-LABEL: define double @test_pow_afn_f64__y_neg5
1947 ; CHECK-SAME: (double [[X:%.*]]) {
1948 ; CHECK-NEXT: [[POW:%.*]] = tail call afn double @_Z4powndi(double [[X]], i32 -5)
1949 ; CHECK-NEXT: ret double [[POW]]
1951 %pow = tail call afn double @_Z3powdd(double %x, double -5.0)
1955 define double @test_pow_afn_f64_nnan_ninf__y_neg5(double %x) {
1956 ; CHECK-LABEL: define double @test_pow_afn_f64_nnan_ninf__y_neg5
1957 ; CHECK-SAME: (double [[X:%.*]]) {
1958 ; CHECK-NEXT: [[__POWX2:%.*]] = fmul nnan ninf afn double [[X]], [[X]]
1959 ; CHECK-NEXT: [[__POWX21:%.*]] = fmul nnan ninf afn double [[__POWX2]], [[__POWX2]]
1960 ; CHECK-NEXT: [[__POWPROD:%.*]] = fmul nnan ninf afn double [[X]], [[__POWX21]]
1961 ; CHECK-NEXT: [[__1POWPROD:%.*]] = fdiv nnan ninf afn double 1.000000e+00, [[__POWPROD]]
1962 ; CHECK-NEXT: ret double [[__1POWPROD]]
1964 %pow = tail call afn nnan ninf double @_Z3powdd(double %x, double -5.0)
1968 define double @test_pow_afn_f64_nnan_ninf__y_10(double %x) {
1969 ; CHECK-LABEL: define double @test_pow_afn_f64_nnan_ninf__y_10
1970 ; CHECK-SAME: (double [[X:%.*]]) {
1971 ; CHECK-NEXT: [[__POWX2:%.*]] = fmul nnan ninf afn double [[X]], [[X]]
1972 ; CHECK-NEXT: [[__POWX21:%.*]] = fmul nnan ninf afn double [[__POWX2]], [[__POWX2]]
1973 ; CHECK-NEXT: [[__POWX22:%.*]] = fmul nnan ninf afn double [[__POWX21]], [[__POWX21]]
1974 ; CHECK-NEXT: [[__POWPROD:%.*]] = fmul nnan ninf afn double [[__POWX2]], [[__POWX22]]
1975 ; CHECK-NEXT: ret double [[__POWPROD]]
1977 %pow = tail call afn nnan ninf double @_Z3powdd(double %x, double 10.0)
1981 define <2 x double> @test_pow_afn_v2f64_nnan_ninf__y_3(<2 x double> %x) {
1982 ; CHECK-LABEL: define <2 x double> @test_pow_afn_v2f64_nnan_ninf__y_3
1983 ; CHECK-SAME: (<2 x double> [[X:%.*]]) {
1984 ; CHECK-NEXT: [[__POWX2:%.*]] = fmul nnan ninf afn <2 x double> [[X]], [[X]]
1985 ; CHECK-NEXT: [[__POWPROD:%.*]] = fmul nnan ninf afn <2 x double> [[X]], [[__POWX2]]
1986 ; CHECK-NEXT: ret <2 x double> [[__POWPROD]]
1988 %pow = tail call afn nnan ninf <2 x double> @_Z3powDv2_dS_(<2 x double> %x, <2 x double> <double 3.0, double 3.0>)
1989 ret <2 x double> %pow
1992 define <2 x double> @test_pow_afn_v2f64_nnan_ninf__y_4(<2 x double> %x) {
1993 ; CHECK-LABEL: define <2 x double> @test_pow_afn_v2f64_nnan_ninf__y_4
1994 ; CHECK-SAME: (<2 x double> [[X:%.*]]) {
1995 ; CHECK-NEXT: [[__POWX2:%.*]] = fmul nnan ninf afn <2 x double> [[X]], [[X]]
1996 ; CHECK-NEXT: [[__POWX21:%.*]] = fmul nnan ninf afn <2 x double> [[__POWX2]], [[__POWX2]]
1997 ; CHECK-NEXT: ret <2 x double> [[__POWX21]]
1999 %pow = tail call afn nnan ninf <2 x double> @_Z3powDv2_dS_(<2 x double> %x, <2 x double> <double 4.0, double 4.0>)
2000 ret <2 x double> %pow
2003 define <2 x double> @test_pow_afn_v2f64_nnan_ninf__y_4_5(<2 x double> %x) {
2004 ; CHECK-LABEL: define <2 x double> @test_pow_afn_v2f64_nnan_ninf__y_4_5
2005 ; CHECK-SAME: (<2 x double> [[X:%.*]]) {
2006 ; CHECK-NEXT: [[POW:%.*]] = tail call nnan ninf afn <2 x double> @_Z3powDv2_dS_(<2 x double> [[X]], <2 x double> splat (double 4.500000e+00))
2007 ; CHECK-NEXT: ret <2 x double> [[POW]]
2009 %pow = tail call afn nnan ninf <2 x double> @_Z3powDv2_dS_(<2 x double> %x, <2 x double> <double 4.5, double 4.5>)
2010 ret <2 x double> %pow
2013 define <2 x double> @test_pow_afn_v2f64_nnan_ninf__y_5(<2 x double> %x) {
2014 ; CHECK-LABEL: define <2 x double> @test_pow_afn_v2f64_nnan_ninf__y_5
2015 ; CHECK-SAME: (<2 x double> [[X:%.*]]) {
2016 ; CHECK-NEXT: [[__POWX2:%.*]] = fmul nnan ninf afn <2 x double> [[X]], [[X]]
2017 ; CHECK-NEXT: [[__POWX21:%.*]] = fmul nnan ninf afn <2 x double> [[__POWX2]], [[__POWX2]]
2018 ; CHECK-NEXT: [[__POWPROD:%.*]] = fmul nnan ninf afn <2 x double> [[X]], [[__POWX21]]
2019 ; CHECK-NEXT: ret <2 x double> [[__POWPROD]]
2021 %pow = tail call afn nnan ninf <2 x double> @_Z3powDv2_dS_(<2 x double> %x, <2 x double> <double 5.0, double 5.0>)
2022 ret <2 x double> %pow
2025 define half @test_pow_afn_f16__y_3(half %x) {
2026 ; CHECK-LABEL: define half @test_pow_afn_f16__y_3
2027 ; CHECK-SAME: (half [[X:%.*]]) {
2028 ; CHECK-NEXT: [[POW:%.*]] = tail call afn half @_Z4pownDhi(half [[X]], i32 3)
2029 ; CHECK-NEXT: ret half [[POW]]
2031 %pow = tail call afn half @_Z3powDhDh(half %x, half 3.0)
2035 define half @test_pow_afn_f16_nnan_ninf__y_3(half %x) {
2036 ; CHECK-LABEL: define half @test_pow_afn_f16_nnan_ninf__y_3
2037 ; CHECK-SAME: (half [[X:%.*]]) {
2038 ; CHECK-NEXT: [[__POWX2:%.*]] = fmul nnan ninf afn half [[X]], [[X]]
2039 ; CHECK-NEXT: [[__POWPROD:%.*]] = fmul nnan ninf afn half [[X]], [[__POWX2]]
2040 ; CHECK-NEXT: ret half [[__POWPROD]]
2042 %pow = tail call afn nnan ninf half @_Z3powDhDh(half %x, half 3.0)
2046 define half @test_pow_afn_f16__y_4(half %x) {
2047 ; CHECK-LABEL: define half @test_pow_afn_f16__y_4
2048 ; CHECK-SAME: (half [[X:%.*]]) {
2049 ; CHECK-NEXT: [[POW:%.*]] = tail call afn half @_Z4pownDhi(half [[X]], i32 4)
2050 ; CHECK-NEXT: ret half [[POW]]
2052 %pow = tail call afn half @_Z3powDhDh(half %x, half 4.0)
2056 define half @test_pow_afn_f16_nnan_ninf__y_4(half %x) {
2057 ; CHECK-LABEL: define half @test_pow_afn_f16_nnan_ninf__y_4
2058 ; CHECK-SAME: (half [[X:%.*]]) {
2059 ; CHECK-NEXT: [[__POWX2:%.*]] = fmul nnan ninf afn half [[X]], [[X]]
2060 ; CHECK-NEXT: [[__POWX21:%.*]] = fmul nnan ninf afn half [[__POWX2]], [[__POWX2]]
2061 ; CHECK-NEXT: ret half [[__POWX21]]
2063 %pow = tail call afn nnan ninf half @_Z3powDhDh(half %x, half 4.0)
2067 define half @test_pow_afn_f16_nnan_ninf__y_4_5(half %x) {
2068 ; CHECK-LABEL: define half @test_pow_afn_f16_nnan_ninf__y_4_5
2069 ; CHECK-SAME: (half [[X:%.*]]) {
2070 ; CHECK-NEXT: [[POW:%.*]] = tail call nnan ninf afn half @_Z3powDhDh(half [[X]], half 0xH4480)
2071 ; CHECK-NEXT: ret half [[POW]]
2073 %pow = tail call afn nnan ninf half @_Z3powDhDh(half %x, half 4.5)
2077 define half @test_pow_afn_f16__y_5(half %x) {
2078 ; CHECK-LABEL: define half @test_pow_afn_f16__y_5
2079 ; CHECK-SAME: (half [[X:%.*]]) {
2080 ; CHECK-NEXT: [[POW:%.*]] = tail call afn half @_Z4pownDhi(half [[X]], i32 5)
2081 ; CHECK-NEXT: ret half [[POW]]
2083 %pow = tail call afn half @_Z3powDhDh(half %x, half 5.0)
2087 define half @test_pow_afn_f16_nnan_ninf__y_5(half %x) {
2088 ; CHECK-LABEL: define half @test_pow_afn_f16_nnan_ninf__y_5
2089 ; CHECK-SAME: (half [[X:%.*]]) {
2090 ; CHECK-NEXT: [[__POWX2:%.*]] = fmul nnan ninf afn half [[X]], [[X]]
2091 ; CHECK-NEXT: [[__POWX21:%.*]] = fmul nnan ninf afn half [[__POWX2]], [[__POWX2]]
2092 ; CHECK-NEXT: [[__POWPROD:%.*]] = fmul nnan ninf afn half [[X]], [[__POWX21]]
2093 ; CHECK-NEXT: ret half [[__POWPROD]]
2095 %pow = tail call afn nnan ninf half @_Z3powDhDh(half %x, half 5.0)
2099 define half @test_pow_afn_f16__y_neg5(half %x) {
2100 ; CHECK-LABEL: define half @test_pow_afn_f16__y_neg5
2101 ; CHECK-SAME: (half [[X:%.*]]) {
2102 ; CHECK-NEXT: [[POW:%.*]] = tail call afn half @_Z4pownDhi(half [[X]], i32 -5)
2103 ; CHECK-NEXT: ret half [[POW]]
2105 %pow = tail call afn half @_Z3powDhDh(half %x, half -5.0)
2109 define half @test_pow_afn_f16_nnan_ninf__y_neg5(half %x) {
2110 ; CHECK-LABEL: define half @test_pow_afn_f16_nnan_ninf__y_neg5
2111 ; CHECK-SAME: (half [[X:%.*]]) {
2112 ; CHECK-NEXT: [[__POWX2:%.*]] = fmul nnan ninf afn half [[X]], [[X]]
2113 ; CHECK-NEXT: [[__POWX21:%.*]] = fmul nnan ninf afn half [[__POWX2]], [[__POWX2]]
2114 ; CHECK-NEXT: [[__POWPROD:%.*]] = fmul nnan ninf afn half [[X]], [[__POWX21]]
2115 ; CHECK-NEXT: [[__1POWPROD:%.*]] = fdiv nnan ninf afn half 0xH3C00, [[__POWPROD]]
2116 ; CHECK-NEXT: ret half [[__1POWPROD]]
2118 %pow = tail call afn nnan ninf half @_Z3powDhDh(half %x, half -5.0)
2122 define half @test_pow_afn_f16_nnan_ninf__y_10(half %x) {
2123 ; CHECK-LABEL: define half @test_pow_afn_f16_nnan_ninf__y_10
2124 ; CHECK-SAME: (half [[X:%.*]]) {
2125 ; CHECK-NEXT: [[__POWX2:%.*]] = fmul nnan ninf afn half [[X]], [[X]]
2126 ; CHECK-NEXT: [[__POWX21:%.*]] = fmul nnan ninf afn half [[__POWX2]], [[__POWX2]]
2127 ; CHECK-NEXT: [[__POWX22:%.*]] = fmul nnan ninf afn half [[__POWX21]], [[__POWX21]]
2128 ; CHECK-NEXT: [[__POWPROD:%.*]] = fmul nnan ninf afn half [[__POWX2]], [[__POWX22]]
2129 ; CHECK-NEXT: ret half [[__POWPROD]]
2131 %pow = tail call afn nnan ninf half @_Z3powDhDh(half %x, half 10.0)
2135 define <2 x half> @test_pow_afn_v2f16_nnan_ninf__y_3(<2 x half> %x) {
2136 ; CHECK-LABEL: define <2 x half> @test_pow_afn_v2f16_nnan_ninf__y_3
2137 ; CHECK-SAME: (<2 x half> [[X:%.*]]) {
2138 ; CHECK-NEXT: [[__POWX2:%.*]] = fmul nnan ninf afn <2 x half> [[X]], [[X]]
2139 ; CHECK-NEXT: [[__POWPROD:%.*]] = fmul nnan ninf afn <2 x half> [[X]], [[__POWX2]]
2140 ; CHECK-NEXT: ret <2 x half> [[__POWPROD]]
2142 %pow = tail call afn nnan ninf <2 x half> @_Z3powDv2_DhS_(<2 x half> %x, <2 x half> <half 3.0, half 3.0>)
2146 define <2 x half> @test_pow_afn_v2f16_nnan_ninf__y_4(<2 x half> %x) {
2147 ; CHECK-LABEL: define <2 x half> @test_pow_afn_v2f16_nnan_ninf__y_4
2148 ; CHECK-SAME: (<2 x half> [[X:%.*]]) {
2149 ; CHECK-NEXT: [[__POWX2:%.*]] = fmul nnan ninf afn <2 x half> [[X]], [[X]]
2150 ; CHECK-NEXT: [[__POWX21:%.*]] = fmul nnan ninf afn <2 x half> [[__POWX2]], [[__POWX2]]
2151 ; CHECK-NEXT: ret <2 x half> [[__POWX21]]
2153 %pow = tail call afn nnan ninf <2 x half> @_Z3powDv2_DhS_(<2 x half> %x, <2 x half> <half 4.0, half 4.0>)
2157 define <2 x half> @test_pow_afn_v2f16_nnan_ninf__y_4_5(<2 x half> %x) {
2158 ; CHECK-LABEL: define <2 x half> @test_pow_afn_v2f16_nnan_ninf__y_4_5
2159 ; CHECK-SAME: (<2 x half> [[X:%.*]]) {
2160 ; CHECK-NEXT: [[POW:%.*]] = tail call nnan ninf afn <2 x half> @_Z3powDv2_DhS_(<2 x half> [[X]], <2 x half> splat (half 0xH4480))
2161 ; CHECK-NEXT: ret <2 x half> [[POW]]
2163 %pow = tail call afn nnan ninf <2 x half> @_Z3powDv2_DhS_(<2 x half> %x, <2 x half> <half 4.5, half 4.5>)
2167 define <2 x half> @test_pow_afn_v2f16_nnan_ninf__y_5(<2 x half> %x) {
2168 ; CHECK-LABEL: define <2 x half> @test_pow_afn_v2f16_nnan_ninf__y_5
2169 ; CHECK-SAME: (<2 x half> [[X:%.*]]) {
2170 ; CHECK-NEXT: [[__POWX2:%.*]] = fmul nnan ninf afn <2 x half> [[X]], [[X]]
2171 ; CHECK-NEXT: [[__POWX21:%.*]] = fmul nnan ninf afn <2 x half> [[__POWX2]], [[__POWX2]]
2172 ; CHECK-NEXT: [[__POWPROD:%.*]] = fmul nnan ninf afn <2 x half> [[X]], [[__POWX21]]
2173 ; CHECK-NEXT: ret <2 x half> [[__POWPROD]]
2175 %pow = tail call afn nnan ninf <2 x half> @_Z3powDv2_DhS_(<2 x half> %x, <2 x half> <half 5.0, half 5.0>)
2179 define float @test_pow_f32_known_integral_sitofp(float %x, i32 %y) {
2180 ; CHECK-LABEL: define float @test_pow_f32_known_integral_sitofp
2181 ; CHECK-SAME: (float [[X:%.*]], i32 [[Y:%.*]]) {
2182 ; CHECK-NEXT: [[Y_CAST:%.*]] = sitofp i32 [[Y]] to float
2183 ; CHECK-NEXT: [[TMP1:%.*]] = fptosi float [[Y_CAST]] to i32
2184 ; CHECK-NEXT: [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2185 ; CHECK-NEXT: ret float [[POW]]
2187 %y.cast = sitofp i32 %y to float
2188 %pow = tail call float @_Z3powff(float %x, float %y.cast)
2192 define float @test_pow_afn_f32_known_integral_sitofp(float %x, i32 %y) {
2193 ; CHECK-LABEL: define float @test_pow_afn_f32_known_integral_sitofp
2194 ; CHECK-SAME: (float [[X:%.*]], i32 [[Y:%.*]]) {
2195 ; CHECK-NEXT: [[Y_CAST:%.*]] = sitofp i32 [[Y]] to float
2196 ; CHECK-NEXT: [[TMP1:%.*]] = fptosi float [[Y_CAST]] to i32
2197 ; CHECK-NEXT: [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2198 ; CHECK-NEXT: ret float [[POW]]
2200 %y.cast = sitofp i32 %y to float
2201 %pow = tail call afn float @_Z3powff(float %x, float %y.cast)
2205 define float @test_pow_afn_nnan_ninf_f32_known_integral_sitofp(float %x, i32 %y) {
2206 ; CHECK-LABEL: define float @test_pow_afn_nnan_ninf_f32_known_integral_sitofp
2207 ; CHECK-SAME: (float [[X:%.*]], i32 [[Y:%.*]]) {
2208 ; CHECK-NEXT: [[Y_CAST:%.*]] = sitofp i32 [[Y]] to float
2209 ; CHECK-NEXT: [[TMP1:%.*]] = fptosi float [[Y_CAST]] to i32
2210 ; CHECK-NEXT: [[__FABS:%.*]] = call nnan ninf afn float @llvm.fabs.f32(float [[X]])
2211 ; CHECK-NEXT: [[__LOG2:%.*]] = call nnan ninf afn float @llvm.log2.f32(float [[__FABS]])
2212 ; CHECK-NEXT: [[POWNI2F:%.*]] = sitofp i32 [[TMP1]] to float
2213 ; CHECK-NEXT: [[__YLOGX:%.*]] = fmul nnan ninf afn float [[__LOG2]], [[POWNI2F]]
2214 ; CHECK-NEXT: [[__EXP2:%.*]] = call nnan ninf afn float @llvm.exp2.f32(float [[__YLOGX]])
2215 ; CHECK-NEXT: [[__YEVEN:%.*]] = shl i32 [[TMP1]], 31
2216 ; CHECK-NEXT: [[TMP2:%.*]] = bitcast float [[X]] to i32
2217 ; CHECK-NEXT: [[__POW_SIGN:%.*]] = and i32 [[__YEVEN]], [[TMP2]]
2218 ; CHECK-NEXT: [[TMP3:%.*]] = bitcast float [[__EXP2]] to i32
2219 ; CHECK-NEXT: [[TMP4:%.*]] = or disjoint i32 [[__POW_SIGN]], [[TMP3]]
2220 ; CHECK-NEXT: [[TMP5:%.*]] = bitcast i32 [[TMP4]] to float
2221 ; CHECK-NEXT: ret float [[TMP5]]
2223 %y.cast = sitofp i32 %y to float
2224 %pow = tail call afn nnan ninf float @_Z3powff(float %x, float %y.cast)
2228 define float @test_pow_afn_nnan_f32_known_integral_sitofp(float %x, i32 %y) {
2229 ; CHECK-LABEL: define float @test_pow_afn_nnan_f32_known_integral_sitofp
2230 ; CHECK-SAME: (float [[X:%.*]], i32 [[Y:%.*]]) {
2231 ; CHECK-NEXT: [[Y_CAST:%.*]] = sitofp i32 [[Y]] to float
2232 ; CHECK-NEXT: [[TMP1:%.*]] = fptosi float [[Y_CAST]] to i32
2233 ; CHECK-NEXT: [[POW:%.*]] = tail call nnan afn float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2234 ; CHECK-NEXT: ret float [[POW]]
2236 %y.cast = sitofp i32 %y to float
2237 %pow = tail call afn nnan float @_Z3powff(float %x, float %y.cast)
2241 define float @test_pow_afn_ninf_f32_known_integral_sitofp(float %x, i32 %y) {
2242 ; CHECK-LABEL: define float @test_pow_afn_ninf_f32_known_integral_sitofp
2243 ; CHECK-SAME: (float [[X:%.*]], i32 [[Y:%.*]]) {
2244 ; CHECK-NEXT: [[Y_CAST:%.*]] = sitofp i32 [[Y]] to float
2245 ; CHECK-NEXT: [[TMP1:%.*]] = fptosi float [[Y_CAST]] to i32
2246 ; CHECK-NEXT: [[POW:%.*]] = tail call ninf afn float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2247 ; CHECK-NEXT: ret float [[POW]]
2249 %y.cast = sitofp i32 %y to float
2250 %pow = tail call afn ninf float @_Z3powff(float %x, float %y.cast)
2254 define float @test_pow_afn_f32_known_integral_sitofp_finite_argument(float %x, i32 %y) {
2255 ; CHECK-LABEL: define float @test_pow_afn_f32_known_integral_sitofp_finite_argument
2256 ; CHECK-SAME: (float [[X:%.*]], i32 [[Y:%.*]]) {
2257 ; CHECK-NEXT: [[Y_CAST:%.*]] = sitofp i32 [[Y]] to float
2258 ; CHECK-NEXT: [[TMP1:%.*]] = fptosi float [[Y_CAST]] to i32
2259 ; CHECK-NEXT: [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2260 ; CHECK-NEXT: ret float [[POW]]
2262 %y.cast = sitofp i32 %y to float
2263 %pow = tail call float @_Z3powff(float %x, float nofpclass(inf nan) %y.cast)
2267 define float @test_pow_f32_known_integral_uitofp(float %x, i32 %y) {
2268 ; CHECK-LABEL: define float @test_pow_f32_known_integral_uitofp
2269 ; CHECK-SAME: (float [[X:%.*]], i32 [[Y:%.*]]) {
2270 ; CHECK-NEXT: [[Y_CAST:%.*]] = uitofp i32 [[Y]] to float
2271 ; CHECK-NEXT: [[TMP1:%.*]] = fptosi float [[Y_CAST]] to i32
2272 ; CHECK-NEXT: [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2273 ; CHECK-NEXT: ret float [[POW]]
2275 %y.cast = uitofp i32 %y to float
2276 %pow = tail call float @_Z3powff(float %x, float %y.cast)
2280 define float @test_pow_afn_f32_known_integral_uitofp(float %x, i32 %y) {
2281 ; CHECK-LABEL: define float @test_pow_afn_f32_known_integral_uitofp
2282 ; CHECK-SAME: (float [[X:%.*]], i32 [[Y:%.*]]) {
2283 ; CHECK-NEXT: [[Y_CAST:%.*]] = uitofp i32 [[Y]] to float
2284 ; CHECK-NEXT: [[TMP1:%.*]] = fptosi float [[Y_CAST]] to i32
2285 ; CHECK-NEXT: [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2286 ; CHECK-NEXT: ret float [[POW]]
2288 %y.cast = uitofp i32 %y to float
2289 %pow = tail call afn float @_Z3powff(float %x, float %y.cast)
2293 define float @test_pow_afn_nnan_ninf_f32_known_integral_uitofp(float %x, i32 %y) {
2294 ; CHECK-LABEL: define float @test_pow_afn_nnan_ninf_f32_known_integral_uitofp
2295 ; CHECK-SAME: (float [[X:%.*]], i32 [[Y:%.*]]) {
2296 ; CHECK-NEXT: [[Y_CAST:%.*]] = uitofp i32 [[Y]] to float
2297 ; CHECK-NEXT: [[TMP1:%.*]] = fptosi float [[Y_CAST]] to i32
2298 ; CHECK-NEXT: [[__FABS:%.*]] = call nnan ninf afn float @llvm.fabs.f32(float [[X]])
2299 ; CHECK-NEXT: [[__LOG2:%.*]] = call nnan ninf afn float @llvm.log2.f32(float [[__FABS]])
2300 ; CHECK-NEXT: [[POWNI2F:%.*]] = sitofp i32 [[TMP1]] to float
2301 ; CHECK-NEXT: [[__YLOGX:%.*]] = fmul nnan ninf afn float [[__LOG2]], [[POWNI2F]]
2302 ; CHECK-NEXT: [[__EXP2:%.*]] = call nnan ninf afn float @llvm.exp2.f32(float [[__YLOGX]])
2303 ; CHECK-NEXT: [[__YEVEN:%.*]] = shl i32 [[TMP1]], 31
2304 ; CHECK-NEXT: [[TMP2:%.*]] = bitcast float [[X]] to i32
2305 ; CHECK-NEXT: [[__POW_SIGN:%.*]] = and i32 [[__YEVEN]], [[TMP2]]
2306 ; CHECK-NEXT: [[TMP3:%.*]] = bitcast float [[__EXP2]] to i32
2307 ; CHECK-NEXT: [[TMP4:%.*]] = or disjoint i32 [[__POW_SIGN]], [[TMP3]]
2308 ; CHECK-NEXT: [[TMP5:%.*]] = bitcast i32 [[TMP4]] to float
2309 ; CHECK-NEXT: ret float [[TMP5]]
2311 %y.cast = uitofp i32 %y to float
2312 %pow = tail call afn nnan ninf float @_Z3powff(float %x, float %y.cast)
2316 ; cast from i256 may produce infinity so can't assume integer without ninf
2317 define float @test_pow_afn_nnan_f32_known_integral_uitofp_i256(float %x, i256 %y) {
2318 ; CHECK-LABEL: define float @test_pow_afn_nnan_f32_known_integral_uitofp_i256
2319 ; CHECK-SAME: (float [[X:%.*]], i256 [[Y:%.*]]) {
2320 ; CHECK-NEXT: [[Y_CAST:%.*]] = uitofp i256 [[Y]] to float
2321 ; CHECK-NEXT: [[POW:%.*]] = tail call nnan afn float @_Z3powff(float [[X]], float [[Y_CAST]])
2322 ; CHECK-NEXT: ret float [[POW]]
2324 %y.cast = uitofp i256 %y to float
2325 %pow = tail call afn nnan float @_Z3powff(float %x, float %y.cast)
2329 ; cast from i256 may produce infinity so can't assume integer without ninf
2330 define float @test_pow_afn_nnan_f32_known_integral_sitofp_i256(float %x, i256 %y) {
2331 ; CHECK-LABEL: define float @test_pow_afn_nnan_f32_known_integral_sitofp_i256
2332 ; CHECK-SAME: (float [[X:%.*]], i256 [[Y:%.*]]) {
2333 ; CHECK-NEXT: [[Y_CAST:%.*]] = sitofp i256 [[Y]] to float
2334 ; CHECK-NEXT: [[POW:%.*]] = tail call nnan afn float @_Z3powff(float [[X]], float [[Y_CAST]])
2335 ; CHECK-NEXT: ret float [[POW]]
2337 %y.cast = sitofp i256 %y to float
2338 %pow = tail call afn nnan float @_Z3powff(float %x, float %y.cast)
2342 define float @test_pow_afn_nnan_ninf_f32_known_integral_uitofp_i256(float %x, i256 %y) {
2343 ; CHECK-LABEL: define float @test_pow_afn_nnan_ninf_f32_known_integral_uitofp_i256
2344 ; CHECK-SAME: (float [[X:%.*]], i256 [[Y:%.*]]) {
2345 ; CHECK-NEXT: [[Y_CAST:%.*]] = uitofp i256 [[Y]] to float
2346 ; CHECK-NEXT: [[TMP1:%.*]] = fptosi float [[Y_CAST]] to i32
2347 ; CHECK-NEXT: [[__FABS:%.*]] = call nnan ninf afn float @llvm.fabs.f32(float [[X]])
2348 ; CHECK-NEXT: [[__LOG2:%.*]] = call nnan ninf afn float @llvm.log2.f32(float [[__FABS]])
2349 ; CHECK-NEXT: [[POWNI2F:%.*]] = sitofp i32 [[TMP1]] to float
2350 ; CHECK-NEXT: [[__YLOGX:%.*]] = fmul nnan ninf afn float [[__LOG2]], [[POWNI2F]]
2351 ; CHECK-NEXT: [[__EXP2:%.*]] = call nnan ninf afn float @llvm.exp2.f32(float [[__YLOGX]])
2352 ; CHECK-NEXT: [[__YEVEN:%.*]] = shl i32 [[TMP1]], 31
2353 ; CHECK-NEXT: [[TMP2:%.*]] = bitcast float [[X]] to i32
2354 ; CHECK-NEXT: [[__POW_SIGN:%.*]] = and i32 [[__YEVEN]], [[TMP2]]
2355 ; CHECK-NEXT: [[TMP3:%.*]] = bitcast float [[__EXP2]] to i32
2356 ; CHECK-NEXT: [[TMP4:%.*]] = or disjoint i32 [[__POW_SIGN]], [[TMP3]]
2357 ; CHECK-NEXT: [[TMP5:%.*]] = bitcast i32 [[TMP4]] to float
2358 ; CHECK-NEXT: ret float [[TMP5]]
2360 %y.cast = uitofp i256 %y to float
2361 %pow = tail call afn nnan ninf float @_Z3powff(float %x, float %y.cast)
2365 define float @test_pow_afn_nnan_ninf_f32_known_integral_sitofp_i256(float %x, i256 %y) {
2366 ; CHECK-LABEL: define float @test_pow_afn_nnan_ninf_f32_known_integral_sitofp_i256
2367 ; CHECK-SAME: (float [[X:%.*]], i256 [[Y:%.*]]) {
2368 ; CHECK-NEXT: [[Y_CAST:%.*]] = sitofp i256 [[Y]] to float
2369 ; CHECK-NEXT: [[TMP1:%.*]] = fptosi float [[Y_CAST]] to i32
2370 ; CHECK-NEXT: [[__FABS:%.*]] = call nnan ninf afn float @llvm.fabs.f32(float [[X]])
2371 ; CHECK-NEXT: [[__LOG2:%.*]] = call nnan ninf afn float @llvm.log2.f32(float [[__FABS]])
2372 ; CHECK-NEXT: [[POWNI2F:%.*]] = sitofp i32 [[TMP1]] to float
2373 ; CHECK-NEXT: [[__YLOGX:%.*]] = fmul nnan ninf afn float [[__LOG2]], [[POWNI2F]]
2374 ; CHECK-NEXT: [[__EXP2:%.*]] = call nnan ninf afn float @llvm.exp2.f32(float [[__YLOGX]])
2375 ; CHECK-NEXT: [[__YEVEN:%.*]] = shl i32 [[TMP1]], 31
2376 ; CHECK-NEXT: [[TMP2:%.*]] = bitcast float [[X]] to i32
2377 ; CHECK-NEXT: [[__POW_SIGN:%.*]] = and i32 [[__YEVEN]], [[TMP2]]
2378 ; CHECK-NEXT: [[TMP3:%.*]] = bitcast float [[__EXP2]] to i32
2379 ; CHECK-NEXT: [[TMP4:%.*]] = or disjoint i32 [[__POW_SIGN]], [[TMP3]]
2380 ; CHECK-NEXT: [[TMP5:%.*]] = bitcast i32 [[TMP4]] to float
2381 ; CHECK-NEXT: ret float [[TMP5]]
2383 %y.cast = sitofp i256 %y to float
2384 %pow = tail call afn nnan ninf float @_Z3powff(float %x, float %y.cast)
2388 define <2 x float> @test_pow_afn_nnan_ninf_v2f32_known_integral_sitofp(<2 x float> %x, <2 x i32> %y) {
2389 ; CHECK-LABEL: define <2 x float> @test_pow_afn_nnan_ninf_v2f32_known_integral_sitofp
2390 ; CHECK-SAME: (<2 x float> [[X:%.*]], <2 x i32> [[Y:%.*]]) {
2391 ; CHECK-NEXT: [[Y_CAST:%.*]] = sitofp <2 x i32> [[Y]] to <2 x float>
2392 ; CHECK-NEXT: [[TMP1:%.*]] = fptosi <2 x float> [[Y_CAST]] to <2 x i32>
2393 ; CHECK-NEXT: [[__FABS:%.*]] = call nnan ninf afn <2 x float> @llvm.fabs.v2f32(<2 x float> [[X]])
2394 ; CHECK-NEXT: [[__LOG2:%.*]] = call nnan ninf afn <2 x float> @llvm.log2.v2f32(<2 x float> [[__FABS]])
2395 ; CHECK-NEXT: [[POWNI2F:%.*]] = sitofp <2 x i32> [[TMP1]] to <2 x float>
2396 ; CHECK-NEXT: [[__YLOGX:%.*]] = fmul nnan ninf afn <2 x float> [[__LOG2]], [[POWNI2F]]
2397 ; CHECK-NEXT: [[__EXP2:%.*]] = call nnan ninf afn <2 x float> @llvm.exp2.v2f32(<2 x float> [[__YLOGX]])
2398 ; CHECK-NEXT: [[__YEVEN:%.*]] = shl <2 x i32> [[TMP1]], splat (i32 31)
2399 ; CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x float> [[X]] to <2 x i32>
2400 ; CHECK-NEXT: [[__POW_SIGN:%.*]] = and <2 x i32> [[__YEVEN]], [[TMP2]]
2401 ; CHECK-NEXT: [[TMP3:%.*]] = bitcast <2 x float> [[__EXP2]] to <2 x i32>
2402 ; CHECK-NEXT: [[TMP4:%.*]] = or disjoint <2 x i32> [[__POW_SIGN]], [[TMP3]]
2403 ; CHECK-NEXT: [[TMP5:%.*]] = bitcast <2 x i32> [[TMP4]] to <2 x float>
2404 ; CHECK-NEXT: ret <2 x float> [[TMP5]]
2406 %y.cast = sitofp <2 x i32> %y to <2 x float>
2407 %pow = tail call afn nnan ninf <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> %y.cast)
2408 ret <2 x float> %pow
2411 define <2 x float> @test_pow_v2f32_known_integral_uitofp(<2 x float> %x, <2 x i32> %y) {
2412 ; CHECK-LABEL: define <2 x float> @test_pow_v2f32_known_integral_uitofp
2413 ; CHECK-SAME: (<2 x float> [[X:%.*]], <2 x i32> [[Y:%.*]]) {
2414 ; CHECK-NEXT: [[Y_CAST:%.*]] = uitofp <2 x i32> [[Y]] to <2 x float>
2415 ; CHECK-NEXT: [[TMP1:%.*]] = fptosi <2 x float> [[Y_CAST]] to <2 x i32>
2416 ; CHECK-NEXT: [[POW:%.*]] = tail call <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> [[TMP1]])
2417 ; CHECK-NEXT: ret <2 x float> [[POW]]
2419 %y.cast = uitofp <2 x i32> %y to <2 x float>
2420 %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> %y.cast)
2421 ret <2 x float> %pow
2424 define <2 x float> @test_pow_afn_v2f32_known_integral_uitofp(<2 x float> %x, <2 x i32> %y) {
2425 ; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_known_integral_uitofp
2426 ; CHECK-SAME: (<2 x float> [[X:%.*]], <2 x i32> [[Y:%.*]]) {
2427 ; CHECK-NEXT: [[Y_CAST:%.*]] = uitofp <2 x i32> [[Y]] to <2 x float>
2428 ; CHECK-NEXT: [[TMP1:%.*]] = fptosi <2 x float> [[Y_CAST]] to <2 x i32>
2429 ; CHECK-NEXT: [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> [[TMP1]])
2430 ; CHECK-NEXT: ret <2 x float> [[POW]]
2432 %y.cast = uitofp <2 x i32> %y to <2 x float>
2433 %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> %y.cast)
2434 ret <2 x float> %pow
2437 define <2 x float> @test_pow_afn_nnan_ninf_v2f32_known_integral_uitofp(<2 x float> %x, <2 x i32> %y) {
2438 ; CHECK-LABEL: define <2 x float> @test_pow_afn_nnan_ninf_v2f32_known_integral_uitofp
2439 ; CHECK-SAME: (<2 x float> [[X:%.*]], <2 x i32> [[Y:%.*]]) {
2440 ; CHECK-NEXT: [[Y_CAST:%.*]] = uitofp <2 x i32> [[Y]] to <2 x float>
2441 ; CHECK-NEXT: [[TMP1:%.*]] = fptosi <2 x float> [[Y_CAST]] to <2 x i32>
2442 ; CHECK-NEXT: [[__FABS:%.*]] = call nnan ninf afn <2 x float> @llvm.fabs.v2f32(<2 x float> [[X]])
2443 ; CHECK-NEXT: [[__LOG2:%.*]] = call nnan ninf afn <2 x float> @llvm.log2.v2f32(<2 x float> [[__FABS]])
2444 ; CHECK-NEXT: [[POWNI2F:%.*]] = sitofp <2 x i32> [[TMP1]] to <2 x float>
2445 ; CHECK-NEXT: [[__YLOGX:%.*]] = fmul nnan ninf afn <2 x float> [[__LOG2]], [[POWNI2F]]
2446 ; CHECK-NEXT: [[__EXP2:%.*]] = call nnan ninf afn <2 x float> @llvm.exp2.v2f32(<2 x float> [[__YLOGX]])
2447 ; CHECK-NEXT: [[__YEVEN:%.*]] = shl <2 x i32> [[TMP1]], splat (i32 31)
2448 ; CHECK-NEXT: [[TMP2:%.*]] = bitcast <2 x float> [[X]] to <2 x i32>
2449 ; CHECK-NEXT: [[__POW_SIGN:%.*]] = and <2 x i32> [[__YEVEN]], [[TMP2]]
2450 ; CHECK-NEXT: [[TMP3:%.*]] = bitcast <2 x float> [[__EXP2]] to <2 x i32>
2451 ; CHECK-NEXT: [[TMP4:%.*]] = or disjoint <2 x i32> [[__POW_SIGN]], [[TMP3]]
2452 ; CHECK-NEXT: [[TMP5:%.*]] = bitcast <2 x i32> [[TMP4]] to <2 x float>
2453 ; CHECK-NEXT: ret <2 x float> [[TMP5]]
2455 %y.cast = uitofp <2 x i32> %y to <2 x float>
2456 %pow = tail call afn nnan ninf <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> %y.cast)
2457 ret <2 x float> %pow
2460 ; Could fold to powr or pown
2461 define float @test_pow_f32_known_positive_x__known_integral_sitofp(float nofpclass(ninf nsub nnorm) %x, i32 %y) {
2462 ; CHECK-LABEL: define float @test_pow_f32_known_positive_x__known_integral_sitofp
2463 ; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]], i32 [[Y:%.*]]) {
2464 ; CHECK-NEXT: [[Y_CAST:%.*]] = sitofp i32 [[Y]] to float
2465 ; CHECK-NEXT: [[POW:%.*]] = tail call float @_Z4powrff(float [[X]], float [[Y_CAST]])
2466 ; CHECK-NEXT: ret float [[POW]]
2468 %y.cast = sitofp i32 %y to float
2469 %pow = tail call float @_Z3powff(float %x, float %y.cast)
2473 define float @test_pow_afn_f32_known_positive_x__known_integral_sitofp(float nofpclass(ninf nsub nnorm) %x, i32 %y) {
2474 ; CHECK-LABEL: define float @test_pow_afn_f32_known_positive_x__known_integral_sitofp
2475 ; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]], i32 [[Y:%.*]]) {
2476 ; CHECK-NEXT: [[Y_CAST:%.*]] = sitofp i32 [[Y]] to float
2477 ; CHECK-NEXT: [[POW:%.*]] = tail call afn float @_Z4powrff(float [[X]], float [[Y_CAST]])
2478 ; CHECK-NEXT: ret float [[POW]]
2480 %y.cast = sitofp i32 %y to float
2481 %pow = tail call afn float @_Z3powff(float %x, float %y.cast)
2485 define float @test_pow_afn_nnan_ninf_f32__known_positive_x__known_integral_sitofp(float nofpclass(ninf nsub nnorm) %x, i32 %y) {
2486 ; CHECK-LABEL: define float @test_pow_afn_nnan_ninf_f32__known_positive_x__known_integral_sitofp
2487 ; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]], i32 [[Y:%.*]]) {
2488 ; CHECK-NEXT: [[Y_CAST:%.*]] = sitofp i32 [[Y]] to float
2489 ; CHECK-NEXT: [[__LOG2:%.*]] = call nnan ninf afn float @llvm.log2.f32(float [[X]])
2490 ; CHECK-NEXT: [[__YLOGX:%.*]] = fmul nnan ninf afn float [[__LOG2]], [[Y_CAST]]
2491 ; CHECK-NEXT: [[__EXP2:%.*]] = call nnan ninf afn float @llvm.exp2.f32(float [[__YLOGX]])
2492 ; CHECK-NEXT: ret float [[__EXP2]]
2494 %y.cast = sitofp i32 %y to float
2495 %pow = tail call afn nnan ninf float @_Z3powff(float %x, float %y.cast)
2499 define float @test_pow_f32__y_known_integral_trunc_maybe_inf(float %x, float nofpclass(nan) %y.arg) {
2500 ; CHECK-LABEL: define float @test_pow_f32__y_known_integral_trunc_maybe_inf
2501 ; CHECK-SAME: (float [[X:%.*]], float nofpclass(nan) [[Y_ARG:%.*]]) {
2502 ; CHECK-NEXT: [[Y:%.*]] = call float @llvm.trunc.f32(float [[Y_ARG]])
2503 ; CHECK-NEXT: [[POW:%.*]] = tail call float @_Z3powff(float [[X]], float [[Y]])
2504 ; CHECK-NEXT: ret float [[POW]]
2506 %y = call float @llvm.trunc.f32(float %y.arg)
2507 %pow = tail call float @_Z3powff(float %x, float %y)
2511 define float @test_pow_f32__y_known_integral_trunc_maybe_nan(float %x, float nofpclass(inf) %y.arg) {
2512 ; CHECK-LABEL: define float @test_pow_f32__y_known_integral_trunc_maybe_nan
2513 ; CHECK-SAME: (float [[X:%.*]], float nofpclass(inf) [[Y_ARG:%.*]]) {
2514 ; CHECK-NEXT: [[Y:%.*]] = call float @llvm.trunc.f32(float [[Y_ARG]])
2515 ; CHECK-NEXT: [[POW:%.*]] = tail call float @_Z3powff(float [[X]], float [[Y]])
2516 ; CHECK-NEXT: ret float [[POW]]
2518 %y = call float @llvm.trunc.f32(float %y.arg)
2519 %pow = tail call float @_Z3powff(float %x, float %y)
2523 ; Cannot fold to pown, may still be inf
2524 define float @test_pow_f32__y_known_integral_trunc_nnan_use(float %x, float %y.arg) {
2525 ; CHECK-LABEL: define float @test_pow_f32__y_known_integral_trunc_nnan_use
2526 ; CHECK-SAME: (float [[X:%.*]], float [[Y_ARG:%.*]]) {
2527 ; CHECK-NEXT: [[Y:%.*]] = call float @llvm.trunc.f32(float [[Y_ARG]])
2528 ; CHECK-NEXT: [[POW:%.*]] = tail call nnan float @_Z3powff(float [[X]], float [[Y]])
2529 ; CHECK-NEXT: ret float [[POW]]
2531 %y = call float @llvm.trunc.f32(float %y.arg)
2532 %pow = tail call nnan float @_Z3powff(float %x, float %y)
2536 ; Cannot fold to pown, may still be nan
2537 define float @test_pow_f32__y_known_integral_trunc_ninf_use(float %x, float %y.arg) {
2538 ; CHECK-LABEL: define float @test_pow_f32__y_known_integral_trunc_ninf_use
2539 ; CHECK-SAME: (float [[X:%.*]], float [[Y_ARG:%.*]]) {
2540 ; CHECK-NEXT: [[Y:%.*]] = call float @llvm.trunc.f32(float [[Y_ARG]])
2541 ; CHECK-NEXT: [[POW:%.*]] = tail call ninf float @_Z3powff(float [[X]], float [[Y]])
2542 ; CHECK-NEXT: ret float [[POW]]
2544 %y = call float @llvm.trunc.f32(float %y.arg)
2545 %pow = tail call ninf float @_Z3powff(float %x, float %y)
2549 define float @test_pow_afn_f32_nnan_ninf__y_known_integral_trunc(float %x, float %y.arg) {
2550 ; CHECK-LABEL: define float @test_pow_afn_f32_nnan_ninf__y_known_integral_trunc
2551 ; CHECK-SAME: (float [[X:%.*]], float [[Y_ARG:%.*]]) {
2552 ; CHECK-NEXT: [[Y:%.*]] = call float @llvm.trunc.f32(float [[Y_ARG]])
2553 ; CHECK-NEXT: [[TMP1:%.*]] = fptosi float [[Y]] to i32
2554 ; CHECK-NEXT: [[__FABS:%.*]] = call nnan ninf afn float @llvm.fabs.f32(float [[X]])
2555 ; CHECK-NEXT: [[__LOG2:%.*]] = call nnan ninf afn float @llvm.log2.f32(float [[__FABS]])
2556 ; CHECK-NEXT: [[POWNI2F:%.*]] = sitofp i32 [[TMP1]] to float
2557 ; CHECK-NEXT: [[__YLOGX:%.*]] = fmul nnan ninf afn float [[__LOG2]], [[POWNI2F]]
2558 ; CHECK-NEXT: [[__EXP2:%.*]] = call nnan ninf afn float @llvm.exp2.f32(float [[__YLOGX]])
2559 ; CHECK-NEXT: [[__YEVEN:%.*]] = shl i32 [[TMP1]], 31
2560 ; CHECK-NEXT: [[TMP2:%.*]] = bitcast float [[X]] to i32
2561 ; CHECK-NEXT: [[__POW_SIGN:%.*]] = and i32 [[__YEVEN]], [[TMP2]]
2562 ; CHECK-NEXT: [[TMP3:%.*]] = bitcast float [[__EXP2]] to i32
2563 ; CHECK-NEXT: [[TMP4:%.*]] = or disjoint i32 [[__POW_SIGN]], [[TMP3]]
2564 ; CHECK-NEXT: [[TMP5:%.*]] = bitcast i32 [[TMP4]] to float
2565 ; CHECK-NEXT: ret float [[TMP5]]
2567 %y = call float @llvm.trunc.f32(float %y.arg)
2568 %pow = tail call afn nnan ninf float @_Z3powff(float %x, float %y)
2572 define float @test_pow_afn_f32__y_known_integral_trunc(float %x, float nofpclass(inf nan) %y.arg) {
2573 ; CHECK-LABEL: define float @test_pow_afn_f32__y_known_integral_trunc
2574 ; CHECK-SAME: (float [[X:%.*]], float nofpclass(nan inf) [[Y_ARG:%.*]]) {
2575 ; CHECK-NEXT: [[Y:%.*]] = call float @llvm.trunc.f32(float [[Y_ARG]])
2576 ; CHECK-NEXT: [[TMP1:%.*]] = fptosi float [[Y]] to i32
2577 ; CHECK-NEXT: [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2578 ; CHECK-NEXT: ret float [[POW]]
2580 %y = call float @llvm.trunc.f32(float %y.arg)
2581 %pow = tail call afn float @_Z3powff(float %x, float %y)
2585 define float @test_pow_f32__y_known_integral_floor(float %x, float nofpclass(inf nan) %y.arg) {
2586 ; CHECK-LABEL: define float @test_pow_f32__y_known_integral_floor
2587 ; CHECK-SAME: (float [[X:%.*]], float nofpclass(nan inf) [[Y_ARG:%.*]]) {
2588 ; CHECK-NEXT: [[Y:%.*]] = call float @llvm.floor.f32(float [[Y_ARG]])
2589 ; CHECK-NEXT: [[TMP1:%.*]] = fptosi float [[Y]] to i32
2590 ; CHECK-NEXT: [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2591 ; CHECK-NEXT: ret float [[POW]]
2593 %y = call float @llvm.floor.f32(float %y.arg)
2594 %pow = tail call float @_Z3powff(float %x, float %y)
2598 define float @test_pow_f32__y_known_integral_ceil(float %x, float nofpclass(inf nan) %y.arg) {
2599 ; CHECK-LABEL: define float @test_pow_f32__y_known_integral_ceil
2600 ; CHECK-SAME: (float [[X:%.*]], float nofpclass(nan inf) [[Y_ARG:%.*]]) {
2601 ; CHECK-NEXT: [[Y:%.*]] = call float @llvm.floor.f32(float [[Y_ARG]])
2602 ; CHECK-NEXT: [[TMP1:%.*]] = fptosi float [[Y]] to i32
2603 ; CHECK-NEXT: [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2604 ; CHECK-NEXT: ret float [[POW]]
2606 %y = call float @llvm.floor.f32(float %y.arg)
2607 %pow = tail call float @_Z3powff(float %x, float %y)
2611 define float @test_pow_f32__y_known_integral_trunc(float %x, float nofpclass(inf nan) %y.arg) {
2612 ; CHECK-LABEL: define float @test_pow_f32__y_known_integral_trunc
2613 ; CHECK-SAME: (float [[X:%.*]], float nofpclass(nan inf) [[Y_ARG:%.*]]) {
2614 ; CHECK-NEXT: [[Y:%.*]] = call float @llvm.trunc.f32(float [[Y_ARG]])
2615 ; CHECK-NEXT: [[TMP1:%.*]] = fptosi float [[Y]] to i32
2616 ; CHECK-NEXT: [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2617 ; CHECK-NEXT: ret float [[POW]]
2619 %y = call float @llvm.trunc.f32(float %y.arg)
2620 %pow = tail call float @_Z3powff(float %x, float %y)
2624 define float @test_pow_f32__y_known_integral_rint(float %x, float nofpclass(inf nan) %y.arg) {
2625 ; CHECK-LABEL: define float @test_pow_f32__y_known_integral_rint
2626 ; CHECK-SAME: (float [[X:%.*]], float nofpclass(nan inf) [[Y_ARG:%.*]]) {
2627 ; CHECK-NEXT: [[Y:%.*]] = call float @llvm.rint.f32(float [[Y_ARG]])
2628 ; CHECK-NEXT: [[TMP1:%.*]] = fptosi float [[Y]] to i32
2629 ; CHECK-NEXT: [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2630 ; CHECK-NEXT: ret float [[POW]]
2632 %y = call float @llvm.rint.f32(float %y.arg)
2633 %pow = tail call float @_Z3powff(float %x, float %y)
2637 define float @test_pow_f32__y_known_integral_nearbyint(float %x, float nofpclass(inf nan) %y.arg) {
2638 ; CHECK-LABEL: define float @test_pow_f32__y_known_integral_nearbyint
2639 ; CHECK-SAME: (float [[X:%.*]], float nofpclass(nan inf) [[Y_ARG:%.*]]) {
2640 ; CHECK-NEXT: [[Y:%.*]] = call float @llvm.nearbyint.f32(float [[Y_ARG]])
2641 ; CHECK-NEXT: [[TMP1:%.*]] = fptosi float [[Y]] to i32
2642 ; CHECK-NEXT: [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2643 ; CHECK-NEXT: ret float [[POW]]
2645 %y = call float @llvm.nearbyint.f32(float %y.arg)
2646 %pow = tail call float @_Z3powff(float %x, float %y)
2650 define float @test_pow_f32__y_known_integral_round(float %x, float nofpclass(inf nan) %y.arg) {
2651 ; CHECK-LABEL: define float @test_pow_f32__y_known_integral_round
2652 ; CHECK-SAME: (float [[X:%.*]], float nofpclass(nan inf) [[Y_ARG:%.*]]) {
2653 ; CHECK-NEXT: [[Y:%.*]] = call float @llvm.round.f32(float [[Y_ARG]])
2654 ; CHECK-NEXT: [[TMP1:%.*]] = fptosi float [[Y]] to i32
2655 ; CHECK-NEXT: [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2656 ; CHECK-NEXT: ret float [[POW]]
2658 %y = call float @llvm.round.f32(float %y.arg)
2659 %pow = tail call float @_Z3powff(float %x, float %y)
2663 define float @test_pow_f32__y_known_integral_roundeven(float %x, float nofpclass(inf nan) %y.arg) {
2664 ; CHECK-LABEL: define float @test_pow_f32__y_known_integral_roundeven
2665 ; CHECK-SAME: (float [[X:%.*]], float nofpclass(nan inf) [[Y_ARG:%.*]]) {
2666 ; CHECK-NEXT: [[Y:%.*]] = call float @llvm.roundeven.f32(float [[Y_ARG]])
2667 ; CHECK-NEXT: [[TMP1:%.*]] = fptosi float [[Y]] to i32
2668 ; CHECK-NEXT: [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2669 ; CHECK-NEXT: ret float [[POW]]
2671 %y = call float @llvm.roundeven.f32(float %y.arg)
2672 %pow = tail call float @_Z3powff(float %x, float %y)
2676 define float @test_pow_f32_known_integral_undef(float %x) {
2677 ; CHECK-LABEL: define float @test_pow_f32_known_integral_undef
2678 ; CHECK-SAME: (float [[X:%.*]]) {
2679 ; CHECK-NEXT: [[POW:%.*]] = tail call float @_Z3powff(float [[X]], float undef)
2680 ; CHECK-NEXT: ret float [[POW]]
2682 %pow = tail call float @_Z3powff(float %x, float undef)
2686 define float @test_pow_f32_known_integral_poison(float %x) {
2687 ; CHECK-LABEL: define float @test_pow_f32_known_integral_poison
2688 ; CHECK-SAME: (float [[X:%.*]]) {
2689 ; CHECK-NEXT: [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 poison)
2690 ; CHECK-NEXT: ret float [[POW]]
2692 %pow = tail call float @_Z3powff(float %x, float poison)
2696 define <2 x float> @test_pow_v2f32_known_integral_constant_vector_undef_elt(<2 x float> %x) {
2697 ; CHECK-LABEL: define <2 x float> @test_pow_v2f32_known_integral_constant_vector_undef_elt
2698 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
2699 ; CHECK-NEXT: [[POW:%.*]] = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> <float 4.000000e+00, float undef>)
2700 ; CHECK-NEXT: ret <2 x float> [[POW]]
2702 %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 4.0, float undef>)
2703 ret <2 x float> %pow
2706 define <2 x float> @test_pow_v2f32_known_integral_constant_vector_poison_elt(<2 x float> %x) {
2707 ; CHECK-LABEL: define <2 x float> @test_pow_v2f32_known_integral_constant_vector_poison_elt
2708 ; CHECK-SAME: (<2 x float> [[X:%.*]]) {
2709 ; CHECK-NEXT: [[POW:%.*]] = tail call <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> <i32 4, i32 poison>)
2710 ; CHECK-NEXT: ret <2 x float> [[POW]]
2712 %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 4.0, float poison>)
2713 ret <2 x float> %pow
2716 attributes #0 = { minsize }
2717 attributes #1 = { noinline }
2718 attributes #2 = { strictfp }
2719 attributes #3 = { nobuiltin }