1 ; RUN: llc < %s -mtriple=aarch64-unknown-linux-gnu -mattr=+neon | FileCheck %s
3 define float @frecp0(float %x) #0 {
4 %div = fdiv fast float 1.0, %x
13 define float @frecp1(float %x) #1 {
14 %div = fdiv fast float 1.0, %x
17 ; CHECK-LABEL: frecp1:
19 ; CHECK-NEXT: frecpe [[R:s[0-7]]]
20 ; CHECK-NEXT: frecps {{s[0-7](, s[0-7])?}}, [[R]]
21 ; CHECK: frecps {{s[0-7]}}, {{s[0-7]}}, {{s[0-7]}}
22 ; CHECK-NOT: frecps {{s[0-7]}}, {{s[0-7]}}, {{s[0-7]}}
25 define <2 x float> @f2recp0(<2 x float> %x) #0 {
26 %div = fdiv fast <2 x float> <float 1.0, float 1.0>, %x
29 ; CHECK-LABEL: f2recp0:
35 define <2 x float> @f2recp1(<2 x float> %x) #1 {
36 %div = fdiv fast <2 x float> <float 1.0, float 1.0>, %x
39 ; CHECK-LABEL: f2recp1:
41 ; CHECK-NEXT: frecpe [[R:v[0-7]\.2s]]
42 ; CHECK-NEXT: frecps {{v[0-7]\.2s(, v[0-7].2s)?}}, [[R]]
43 ; CHECK: frecps {{v[0-7]\.2s}}, {{v[0-7]\.2s}}, {{v[0-7]\.2s}}
44 ; CHECK-NOT: frecps {{v[0-7]\.2s}}, {{v[0-7]\.2s}}, {{v[0-7]\.2s}}
47 define <4 x float> @f4recp0(<4 x float> %x) #0 {
48 %div = fdiv fast <4 x float> <float 1.0, float 1.0, float 1.0, float 1.0>, %x
51 ; CHECK-LABEL: f4recp0:
57 define <4 x float> @f4recp1(<4 x float> %x) #1 {
58 %div = fdiv fast <4 x float> <float 1.0, float 1.0, float 1.0, float 1.0>, %x
61 ; CHECK-LABEL: f4recp1:
63 ; CHECK-NEXT: frecpe [[R:v[0-7]\.4s]]
64 ; CHECK-NEXT: frecps {{v[0-7]\.4s(, v[0-7].4s)?}}, [[R]]
65 ; CHECK: frecps {{v[0-7]\.4s}}, {{v[0-7]\.4s}}, {{v[0-7]\.4s}}
66 ; CHECK-NOT: frecps {{v[0-7]\.4s}}, {{v[0-7]\.4s}}, {{v[0-7]\.4s}}
69 define <8 x float> @f8recp0(<8 x float> %x) #0 {
70 %div = fdiv fast <8 x float> <float 1.0, float 1.0, float 1.0, float 1.0, float 1.0, float 1.0, float 1.0, float 1.0>, %x
73 ; CHECK-LABEL: f8recp0:
80 define <8 x float> @f8recp1(<8 x float> %x) #1 {
81 %div = fdiv fast <8 x float> <float 1.0, float 1.0, float 1.0, float 1.0, float 1.0, float 1.0, float 1.0, float 1.0>, %x
84 ; CHECK-LABEL: f8recp1:
86 ; CHECK-NEXT: frecpe [[R:v[0-7]\.4s]]
87 ; CHECK: frecps {{v[0-7]\.4s(, v[0-7].4s)?}}, [[R]]
88 ; CHECK: frecps {{v[0-7]\.4s(, v[0-7].4s)?}}, {{v[0-7]\.4s}}
89 ; CHECK: frecps {{v[0-7]\.4s}}, {{v[0-7]\.4s}}, {{v[0-7]\.4s}}
90 ; CHECK: frecps {{v[0-7]\.4s}}, {{v[0-7]\.4s}}, {{v[0-7]\.4s}}
91 ; CHECK-NOT: frecps {{v[0-7]\.4s}}, {{v[0-7]\.4s}}, {{v[0-7]\.4s}}
94 define double @drecp0(double %x) #0 {
95 %div = fdiv fast double 1.0, %x
98 ; CHECK-LABEL: drecp0:
104 define double @drecp1(double %x) #1 {
105 %div = fdiv fast double 1.0, %x
108 ; CHECK-LABEL: drecp1:
110 ; CHECK-NEXT: frecpe [[R:d[0-7]]]
111 ; CHECK-NEXT: frecps {{d[0-7](, d[0-7])?}}, [[R]]
112 ; CHECK: frecps {{d[0-7]}}, {{d[0-7]}}, {{d[0-7]}}
113 ; CHECK: frecps {{d[0-7]}}, {{d[0-7]}}, {{d[0-7]}}
114 ; CHECK-NOT: frecps {{d[0-7]}}, {{d[0-7]}}, {{d[0-7]}}
117 define <2 x double> @d2recp0(<2 x double> %x) #0 {
118 %div = fdiv fast <2 x double> <double 1.0, double 1.0>, %x
119 ret <2 x double> %div
121 ; CHECK-LABEL: d2recp0:
127 define <2 x double> @d2recp1(<2 x double> %x) #1 {
128 %div = fdiv fast <2 x double> <double 1.0, double 1.0>, %x
129 ret <2 x double> %div
131 ; CHECK-LABEL: d2recp1:
133 ; CHECK-NEXT: frecpe [[R:v[0-7]\.2d]]
134 ; CHECK-NEXT: frecps {{v[0-7]\.2d(, v[0-7].2d)?}}, [[R]]
135 ; CHECK: frecps {{v[0-7]\.2d}}, {{v[0-7]\.2d}}, {{v[0-7]\.2d}}
136 ; CHECK: frecps {{v[0-7]\.2d}}, {{v[0-7]\.2d}}, {{v[0-7]\.2d}}
137 ; CHECK-NOT: frecps {{v[0-7]\.2d}}, {{v[0-7]\.2d}}, {{v[0-7]\.2d}}
140 define <4 x double> @d4recp0(<4 x double> %x) #0 {
141 %div = fdiv fast <4 x double> <double 1.0, double 1.0, double 1.0, double 1.0>, %x
142 ret <4 x double> %div
144 ; CHECK-LABEL: d4recp0:
151 define <4 x double> @d4recp1(<4 x double> %x) #1 {
152 %div = fdiv fast <4 x double> <double 1.0, double 1.0, double 1.0, double 1.0>, %x
153 ret <4 x double> %div
155 ; CHECK-LABEL: d4recp1:
157 ; CHECK-NEXT: frecpe [[R:v[0-7]\.2d]]
158 ; CHECK: frecps {{v[0-7]\.2d(, v[0-7].2d)?}}, [[R]]
159 ; CHECK: frecps {{v[0-7]\.2d}}, {{v[0-7]\.2d}}, {{v[0-7]\.2d}}
160 ; CHECK: frecps {{v[0-7]\.2d}}, {{v[0-7]\.2d}}, {{v[0-7]\.2d}}
161 ; CHECK: frecps {{v[0-7]\.2d}}, {{v[0-7]\.2d}}, {{v[0-7]\.2d}}
162 ; CHECK: frecps {{v[0-7]\.2d}}, {{v[0-7]\.2d}}, {{v[0-7]\.2d}}
163 ; CHECK: frecps {{v[0-7]\.2d}}, {{v[0-7]\.2d}}, {{v[0-7]\.2d}}
164 ; CHECK-NOT: frecps {{v[0-7]\.2d}}, {{v[0-7]\.2d}}, {{v[0-7]\.2d}}
167 attributes #0 = { nounwind "unsafe-fp-math"="true" }
168 attributes #1 = { nounwind "unsafe-fp-math"="true" "reciprocal-estimates"="div,vec-div" }