summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/ARM
diff options
context:
space:
mode:
authorDavid Green <david.green@arm.com>2019-10-23 17:08:21 +0100
committerDavid Green <david.green@arm.com>2019-10-28 11:08:55 +0000
commitba2c62553109e324a203aa46c2217cf5f28ab694 (patch)
tree5e9f34fd64d6740c5b4d0a2c180a5f4a0ec94125 /llvm/test/CodeGen/ARM
parenta483302fbefb6c48fe5c14c6403be06336a77e7f (diff)
downloadbcm5719-llvm-ba2c62553109e324a203aa46c2217cf5f28ab694.tar.gz
bcm5719-llvm-ba2c62553109e324a203aa46c2217cf5f28ab694.zip
[Codegen][ARM] Add float softening for cbrt
We would previously have no soft-float softening for cbrt, so could hit a crash failing to select. This fills in what appears to be missing. Differential Revision: https://reviews.llvm.org/D69345
Diffstat (limited to 'llvm/test/CodeGen/ARM')
-rw-r--r--llvm/test/CodeGen/ARM/fp16-promote.ll15
-rw-r--r--llvm/test/CodeGen/ARM/pow.ll16
2 files changed, 31 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/fp16-promote.ll b/llvm/test/CodeGen/ARM/fp16-promote.ll
index 183653036f3..5c409350206 100644
--- a/llvm/test/CodeGen/ARM/fp16-promote.ll
+++ b/llvm/test/CodeGen/ARM/fp16-promote.ll
@@ -497,6 +497,21 @@ define void @test_pow(half* %p, half* %q) #0 {
ret void
}
+; CHECK-FP16-LABEL: test_cbrt:
+; CHECK-FP16: vcvtb.f32.f16
+; CHECK-FP16: bl powf
+; CHECK-FP16: vcvtb.f16.f32
+; CHECK-LIBCALL-LABEL: test_cbrt:
+; CHECK-LIBCALL: bl __aeabi_h2f
+; CHECK-LIBCALL: bl powf
+; CHECK-LIBCALL: bl __aeabi_f2h
+define void @test_cbrt(half* %p) #0 {
+ %a = load half, half* %p, align 2
+ %r = call half @llvm.pow.f16(half %a, half 0x3FD5540000000000)
+ store half %r, half* %p
+ ret void
+}
+
; CHECK-FP16-LABEL: test_exp:
; CHECK-FP16: vcvtb.f32.f16
; CHECK-FP16: bl expf
diff --git a/llvm/test/CodeGen/ARM/pow.ll b/llvm/test/CodeGen/ARM/pow.ll
index 2b3df92aab5..8abc37de3d4 100644
--- a/llvm/test/CodeGen/ARM/pow.ll
+++ b/llvm/test/CodeGen/ARM/pow.ll
@@ -26,6 +26,22 @@ define double @pow_f64_one_fourth_fmf(double %x) nounwind {
ret double %r
}
+define float @pow_f32_one_third_fmf(float %x) nounwind {
+; ANY-LABEL: pow_f32_one_third_fmf:
+; SOFTFLOAT: bl cbrtf
+; HARDFLOAT: b cbrtf
+ %r = call fast float @llvm.pow.f32(float %x, float 0x3FD5555560000000)
+ ret float %r
+}
+
+define double @pow_f64_one_third_fmf(double %x) nounwind {
+; ANY-LABEL: pow_f64_one_third_fmf:
+; SOFTFLOAT: bl cbrt
+; HARDFLOAT: b cbrt
+ %r = call fast double @llvm.pow.f64(double %x, double 0x3FD5555555555555)
+ ret double %r
+}
+
define <4 x float> @pow_v4f32_one_fourth_fmf(<4 x float> %x) nounwind {
; ANY-LABEL: pow_v4f32_one_fourth_fmf:
; SOFTFLOAT: bl powf
OpenPOWER on IntegriCloud