1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=aarch64-- | FileCheck %s
4 declare float @llvm.pow.f32(float, float)
5 declare <4 x float> @llvm.pow.v4f32(<4 x float>, <4 x float>)
7 declare double @llvm.pow.f64(double, double)
8 declare <2 x double> @llvm.pow.v2f64(<2 x double>, <2 x double>)
10 define float @pow_f32_one_fourth_fmf(float %x) nounwind {
11 ; CHECK-LABEL: pow_f32_one_fourth_fmf:
13 ; CHECK-NEXT: fsqrt s0, s0
14 ; CHECK-NEXT: fsqrt s0, s0
16 %r = call nsz ninf afn float @llvm.pow.f32(float %x, float 2.5e-01)
20 define double @pow_f64_one_fourth_fmf(double %x) nounwind {
21 ; CHECK-LABEL: pow_f64_one_fourth_fmf:
23 ; CHECK-NEXT: fsqrt d0, d0
24 ; CHECK-NEXT: fsqrt d0, d0
26 %r = call nsz ninf afn double @llvm.pow.f64(double %x, double 2.5e-01)
30 define <4 x float> @pow_v4f32_one_fourth_fmf(<4 x float> %x) nounwind {
31 ; CHECK-LABEL: pow_v4f32_one_fourth_fmf:
33 ; CHECK-NEXT: fsqrt v0.4s, v0.4s
34 ; CHECK-NEXT: fsqrt v0.4s, v0.4s
36 %r = call fast <4 x float> @llvm.pow.v4f32(<4 x float> %x, <4 x float> <float 2.5e-1, float 2.5e-1, float 2.5e-01, float 2.5e-01>)
40 define <2 x double> @pow_v2f64_one_fourth_fmf(<2 x double> %x) nounwind {
41 ; CHECK-LABEL: pow_v2f64_one_fourth_fmf:
43 ; CHECK-NEXT: fsqrt v0.2d, v0.2d
44 ; CHECK-NEXT: fsqrt v0.2d, v0.2d
46 %r = call fast <2 x double> @llvm.pow.v2f64(<2 x double> %x, <2 x double> <double 2.5e-1, double 2.5e-1>)
50 define float @pow_f32_one_fourth_not_enough_fmf(float %x) nounwind {
51 ; CHECK-LABEL: pow_f32_one_fourth_not_enough_fmf:
53 ; CHECK-NEXT: fmov s1, #0.25000000
55 %r = call afn ninf float @llvm.pow.f32(float %x, float 2.5e-01)
59 define double @pow_f64_one_fourth_not_enough_fmf(double %x) nounwind {
60 ; CHECK-LABEL: pow_f64_one_fourth_not_enough_fmf:
62 ; CHECK-NEXT: fmov d1, #0.25000000
64 %r = call nsz ninf double @llvm.pow.f64(double %x, double 2.5e-01)
68 define <4 x float> @pow_v4f32_one_fourth_not_enough_fmf(<4 x float> %x) nounwind {
69 ; CHECK-LABEL: pow_v4f32_one_fourth_not_enough_fmf:
71 ; CHECK-NEXT: sub sp, sp, #48 // =48
72 ; CHECK-NEXT: str d8, [sp, #32] // 8-byte Folded Spill
73 ; CHECK-NEXT: fmov s8, #0.25000000
74 ; CHECK-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
75 ; CHECK-NEXT: mov s0, v0.s[1]
76 ; CHECK-NEXT: mov v1.16b, v8.16b
77 ; CHECK-NEXT: str x30, [sp, #40] // 8-byte Folded Spill
79 ; CHECK-NEXT: str d0, [sp] // 16-byte Folded Spill
80 ; CHECK-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
81 ; CHECK-NEXT: mov v1.16b, v8.16b
82 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
84 ; CHECK-NEXT: ldr q1, [sp] // 16-byte Folded Reload
85 ; CHECK-NEXT: // kill: def $s0 killed $s0 def $q0
86 ; CHECK-NEXT: mov v0.s[1], v1.s[0]
87 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
88 ; CHECK-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
89 ; CHECK-NEXT: mov v1.16b, v8.16b
90 ; CHECK-NEXT: mov s0, v0.s[2]
92 ; CHECK-NEXT: ldr q1, [sp] // 16-byte Folded Reload
93 ; CHECK-NEXT: // kill: def $s0 killed $s0 def $q0
94 ; CHECK-NEXT: mov v1.s[2], v0.s[0]
95 ; CHECK-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
96 ; CHECK-NEXT: str q1, [sp] // 16-byte Folded Spill
97 ; CHECK-NEXT: mov v1.16b, v8.16b
98 ; CHECK-NEXT: mov s0, v0.s[3]
100 ; CHECK-NEXT: ldr q1, [sp] // 16-byte Folded Reload
101 ; CHECK-NEXT: ldr x30, [sp, #40] // 8-byte Folded Reload
102 ; CHECK-NEXT: ldr d8, [sp, #32] // 8-byte Folded Reload
103 ; CHECK-NEXT: // kill: def $s0 killed $s0 def $q0
104 ; CHECK-NEXT: mov v1.s[3], v0.s[0]
105 ; CHECK-NEXT: mov v0.16b, v1.16b
106 ; CHECK-NEXT: add sp, sp, #48 // =48
108 %r = call afn nsz <4 x float> @llvm.pow.v4f32(<4 x float> %x, <4 x float> <float 2.5e-1, float 2.5e-1, float 2.5e-01, float 2.5e-01>)
112 define <2 x double> @pow_v2f64_one_fourth_not_enough_fmf(<2 x double> %x) nounwind {
113 ; CHECK-LABEL: pow_v2f64_one_fourth_not_enough_fmf:
115 ; CHECK-NEXT: sub sp, sp, #48 // =48
116 ; CHECK-NEXT: str d8, [sp, #32] // 8-byte Folded Spill
117 ; CHECK-NEXT: fmov d8, #0.25000000
118 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
119 ; CHECK-NEXT: mov d0, v0.d[1]
120 ; CHECK-NEXT: mov v1.16b, v8.16b
121 ; CHECK-NEXT: str x30, [sp, #40] // 8-byte Folded Spill
123 ; CHECK-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
124 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
125 ; CHECK-NEXT: mov v1.16b, v8.16b
126 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
128 ; CHECK-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
129 ; CHECK-NEXT: ldr x30, [sp, #40] // 8-byte Folded Reload
130 ; CHECK-NEXT: ldr d8, [sp, #32] // 8-byte Folded Reload
131 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
132 ; CHECK-NEXT: mov v0.d[1], v1.d[0]
133 ; CHECK-NEXT: add sp, sp, #48 // =48
135 %r = call nsz nnan reassoc <2 x double> @llvm.pow.v2f64(<2 x double> %x, <2 x double> <double 2.5e-1, double 2.5e-1>)