Skip to content

Commit 1359c8f

Browse files
committed
[ARM] Add various f32/f64 intrinsic tests
1 parent 3a9ac7c commit 1359c8f

File tree

1 file changed

+168
-0
lines changed

1 file changed

+168
-0
lines changed

llvm/test/CodeGen/ARM/fp-intrinsics.ll

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,80 @@ define float @tan_f32(float %x) #0 {
146146
ret float %val
147147
}
148148

149+
; CHECK-LABEL: acos_f32:
150+
; CHECK: bl acosf
151+
define float @acos_f32(float %x, float %y) #0 {
152+
%val = call float @llvm.experimental.constrained.acos.f32(float %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
153+
ret float %val
154+
}
155+
156+
; CHECK-LABEL: asin_f32:
157+
; CHECK: bl asinf
158+
define float @asin_f32(float %x, float %y) #0 {
159+
%val = call float @llvm.experimental.constrained.asin.f32(float %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
160+
ret float %val
161+
}
162+
163+
; CHECK-LABEL: atan_f32:
164+
; CHECK: bl atanf
165+
define float @atan_f32(float %x, float %y) #0 {
166+
%val = call float @llvm.experimental.constrained.atan.f32(float %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
167+
ret float %val
168+
}
169+
170+
; CHECK-LABEL: cosh_f32:
171+
; CHECK: bl coshf
172+
define float @cosh_f32(float %x, float %y) #0 {
173+
%val = call float @llvm.experimental.constrained.cosh.f32(float %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
174+
ret float %val
175+
}
176+
177+
; CHECK-LABEL: sinh_f32:
178+
; CHECK: bl sinhf
179+
define float @sinh_f32(float %x, float %y) #0 {
180+
%val = call float @llvm.experimental.constrained.sinh.f32(float %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
181+
ret float %val
182+
}
183+
184+
; CHECK-LABEL: tanh_f32:
185+
; CHECK: bl tanhf
186+
define float @tanh_f32(float %x, float %y) #0 {
187+
%val = call float @llvm.experimental.constrained.tanh.f32(float %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
188+
ret float %val
189+
}
190+
191+
; CHECK-LABEL: fmuladd_f32:
192+
; CHECK-SP: vfma.f32
193+
; CHECK-NOSP: bl __aeabi_fmul
194+
; CHECK-NOSP: bl __aeabi_fadd
195+
define float @fmuladd_f32(float %x, float %y, float %z) #0 {
196+
%val = call float @llvm.experimental.constrained.fmuladd.f32(float %x, float %y, float %z, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
197+
ret float %val
198+
}
199+
200+
; CHECK-LABEL: ldexp_f32:
201+
; CHECK: bl ldexpf
202+
define float @ldexp_f32(float %x, i32 %y) #0 {
203+
%val = call float @llvm.experimental.constrained.ldexp.f32.i32(float %x, i32 %y, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
204+
ret float %val
205+
}
206+
207+
; CHECK-LABEL: roundeven_f32:
208+
; CHECK-SP-V8: vrintn.f32
209+
; CHECK-NOSP: bl roundevenf
210+
define float @roundeven_f32(float %x) #0 {
211+
%val = call float @llvm.experimental.constrained.roundeven.f32(float %x, metadata !"fpexcept.strict") #0
212+
ret float %val
213+
}
214+
215+
; CHECK-LABEL: uitofp_f32_i32:
216+
; CHECK-NOSP: bl __aeabi_ui2f
217+
; FIXME-CHECK-SP: vcvt.f32.f64
218+
define float @uitofp_f32_i32(i32 %x) #0 {
219+
%val = call float @llvm.experimental.constrained.uitofp.f32.i32(i32 %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
220+
ret float %val
221+
}
222+
149223
; CHECK-LABEL: atan2_f32:
150224
; CHECK: bl atan2f
151225
define float @atan2_f32(float %x, float %y) #0 {
@@ -617,6 +691,80 @@ define double @tan_f64(double %x) #0 {
617691
ret double %val
618692
}
619693

694+
; CHECK-LABEL: acos_f64:
695+
; CHECK: bl acos
696+
define double @acos_f64(double %x, double %y) #0 {
697+
%val = call double @llvm.experimental.constrained.acos.f64(double %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
698+
ret double %val
699+
}
700+
701+
; CHECK-LABEL: asin_f64:
702+
; CHECK: bl asin
703+
define double @asin_f64(double %x, double %y) #0 {
704+
%val = call double @llvm.experimental.constrained.asin.f64(double %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
705+
ret double %val
706+
}
707+
708+
; CHECK-LABEL: atan_f64:
709+
; CHECK: bl atan
710+
define double @atan_f64(double %x, double %y) #0 {
711+
%val = call double @llvm.experimental.constrained.atan.f64(double %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
712+
ret double %val
713+
}
714+
715+
; CHECK-LABEL: cosh_f64:
716+
; CHECK: bl cosh
717+
define double @cosh_f64(double %x, double %y) #0 {
718+
%val = call double @llvm.experimental.constrained.cosh.f64(double %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
719+
ret double %val
720+
}
721+
722+
; CHECK-LABEL: sinh_f64:
723+
; CHECK: bl sinh
724+
define double @sinh_f64(double %x, double %y) #0 {
725+
%val = call double @llvm.experimental.constrained.sinh.f64(double %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
726+
ret double %val
727+
}
728+
729+
; CHECK-LABEL: tanh_f64:
730+
; CHECK: bl tanh
731+
define double @tanh_f64(double %x, double %y) #0 {
732+
%val = call double @llvm.experimental.constrained.tanh.f64(double %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
733+
ret double %val
734+
}
735+
736+
; CHECK-LABEL: fmuladd_f64:
737+
; CHECK-DP: vfma.f64
738+
; CHECK-NODP: bl __aeabi_dmul
739+
; CHECK-NODP: bl __aeabi_dadd
740+
define double @fmuladd_f64(double %x, double %y, double %z) #0 {
741+
%val = call double @llvm.experimental.constrained.fmuladd.f64(double %x, double %y, double %z, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
742+
ret double %val
743+
}
744+
745+
; CHECK-LABEL: ldexp_f64:
746+
; CHECK: bl ldexp
747+
define double @ldexp_f64(double %x, i32 %y) #0 {
748+
%val = call double @llvm.experimental.constrained.ldexp.f64.i32(double %x, i32 %y, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
749+
ret double %val
750+
}
751+
752+
; CHECK-LABEL: roundeven_f64:
753+
; CHECK-DP-V8: vrintn.f64
754+
; CHECK-NODP: bl roundeven
755+
define double @roundeven_f64(double %x) #0 {
756+
%val = call double @llvm.experimental.constrained.roundeven.f64(double %x, metadata !"fpexcept.strict") #0
757+
ret double %val
758+
}
759+
760+
; CHECK-LABEL: uitofp_f64_i32:
761+
; CHECK-NOSP: bl __aeabi_ui2d
762+
; FIXME-CHECK-SP: vsub.f64
763+
define double @uitofp_f64_i32(i32 %x) #0 {
764+
%val = call double @llvm.experimental.constrained.uitofp.f64.i32(i32 %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
765+
ret double %val
766+
}
767+
620768
; CHECK-LABEL: atan2_f64:
621769
; CHECK: bl atan2
622770
define double @atan2_f64(double %x, double %y) #0 {
@@ -1052,6 +1200,16 @@ declare float @llvm.experimental.constrained.powi.f32(float, i32, metadata, meta
10521200
declare float @llvm.experimental.constrained.sin.f32(float, metadata, metadata)
10531201
declare float @llvm.experimental.constrained.cos.f32(float, metadata, metadata)
10541202
declare float @llvm.experimental.constrained.tan.f32(float, metadata, metadata)
1203+
declare float @llvm.experimental.constrained.acos.f32(float, metadata, metadata)
1204+
declare float @llvm.experimental.constrained.asin.f32(float, metadata, metadata)
1205+
declare float @llvm.experimental.constrained.atan.f32(float, metadata, metadata)
1206+
declare float @llvm.experimental.constrained.cosh.f32(float, metadata, metadata)
1207+
declare float @llvm.experimental.constrained.sinh.f32(float, metadata, metadata)
1208+
declare float @llvm.experimental.constrained.tanh.f32(float, metadata, metadata)
1209+
declare float @llvm.experimental.constrained.fmuladd.f32(float, float, float, metadata, metadata)
1210+
declare float @llvm.experimental.constrained.ldexp.f32.i32(float, i32, metadata, metadata)
1211+
declare float @llvm.experimental.constrained.roundeven.f32(float, metadata)
1212+
declare float @llvm.experimental.constrained.uitofp.f32.i32(i32, metadata, metadata)
10551213
declare float @llvm.experimental.constrained.atan2.f32(float, float, metadata, metadata)
10561214
declare float @llvm.experimental.constrained.pow.f32(float, float, metadata, metadata)
10571215
declare float @llvm.experimental.constrained.log.f32(float, metadata, metadata)
@@ -1087,6 +1245,16 @@ declare double @llvm.experimental.constrained.powi.f64(double, i32, metadata, me
10871245
declare double @llvm.experimental.constrained.sin.f64(double, metadata, metadata)
10881246
declare double @llvm.experimental.constrained.cos.f64(double, metadata, metadata)
10891247
declare double @llvm.experimental.constrained.tan.f64(double, metadata, metadata)
1248+
declare double @llvm.experimental.constrained.acos.f64(double, metadata, metadata)
1249+
declare double @llvm.experimental.constrained.asin.f64(double, metadata, metadata)
1250+
declare double @llvm.experimental.constrained.atan.f64(double, metadata, metadata)
1251+
declare double @llvm.experimental.constrained.cosh.f64(double, metadata, metadata)
1252+
declare double @llvm.experimental.constrained.sinh.f64(double, metadata, metadata)
1253+
declare double @llvm.experimental.constrained.tanh.f64(double, metadata, metadata)
1254+
declare double @llvm.experimental.constrained.fmuladd.f64(double, double, double, metadata, metadata)
1255+
declare double @llvm.experimental.constrained.ldexp.f64.i32(double, i32, metadata, metadata)
1256+
declare double @llvm.experimental.constrained.roundeven.f64(double, metadata)
1257+
declare double @llvm.experimental.constrained.uitofp.f64.i32(i32, metadata, metadata)
10901258
declare double @llvm.experimental.constrained.atan2.f64(double, double, metadata, metadata)
10911259
declare double @llvm.experimental.constrained.pow.f64(double, double, metadata, metadata)
10921260
declare double @llvm.experimental.constrained.log.f64(double, metadata, metadata)

0 commit comments

Comments
 (0)