1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=aarch64-- -aarch64-enable-sink-fold=true | 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
72 ; CHECK-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
73 ; CHECK-NEXT: mov s0, v0.s[1]
74 ; CHECK-NEXT: fmov s1, #0.25000000
75 ; CHECK-NEXT: str x30, [sp, #32] // 8-byte Folded Spill
77 ; CHECK-NEXT: fmov s1, #0.25000000
78 ; CHECK-NEXT: // kill: def $s0 killed $s0 def $q0
79 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
80 ; CHECK-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
81 ; CHECK-NEXT: // kill: def $s0 killed $s0 killed $q0
83 ; CHECK-NEXT: ldr q1, [sp] // 16-byte Folded Reload
84 ; CHECK-NEXT: // kill: def $s0 killed $s0 def $q0
85 ; CHECK-NEXT: mov v0.s[1], v1.s[0]
86 ; CHECK-NEXT: fmov s1, #0.25000000
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 s0, v0.s[2]
91 ; CHECK-NEXT: ldr q1, [sp] // 16-byte Folded Reload
92 ; CHECK-NEXT: // kill: def $s0 killed $s0 def $q0
93 ; CHECK-NEXT: mov v1.s[2], v0.s[0]
94 ; CHECK-NEXT: ldr q0, [sp, #16] // 16-byte Folded Reload
95 ; CHECK-NEXT: mov s0, v0.s[3]
96 ; CHECK-NEXT: str q1, [sp] // 16-byte Folded Spill
97 ; CHECK-NEXT: fmov s1, #0.25000000
99 ; CHECK-NEXT: ldr q1, [sp] // 16-byte Folded Reload
100 ; CHECK-NEXT: // kill: def $s0 killed $s0 def $q0
101 ; CHECK-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload
102 ; CHECK-NEXT: mov v1.s[3], v0.s[0]
103 ; CHECK-NEXT: mov v0.16b, v1.16b
104 ; CHECK-NEXT: add sp, sp, #48
106 %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>)
110 define <2 x double> @pow_v2f64_one_fourth_not_enough_fmf(<2 x double> %x) nounwind {
111 ; CHECK-LABEL: pow_v2f64_one_fourth_not_enough_fmf:
113 ; CHECK-NEXT: sub sp, sp, #48
114 ; CHECK-NEXT: str q0, [sp] // 16-byte Folded Spill
115 ; CHECK-NEXT: mov d0, v0.d[1]
116 ; CHECK-NEXT: fmov d1, #0.25000000
117 ; CHECK-NEXT: str x30, [sp, #32] // 8-byte Folded Spill
119 ; CHECK-NEXT: fmov d1, #0.25000000
120 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
121 ; CHECK-NEXT: str q0, [sp, #16] // 16-byte Folded Spill
122 ; CHECK-NEXT: ldr q0, [sp] // 16-byte Folded Reload
123 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
125 ; CHECK-NEXT: ldr q1, [sp, #16] // 16-byte Folded Reload
126 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
127 ; CHECK-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload
128 ; CHECK-NEXT: mov v0.d[1], v1.d[0]
129 ; CHECK-NEXT: add sp, sp, #48
131 %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>)