diff options
author | Duncan Sands <baldrick@free.fr> | 2008-11-17 20:52:38 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2008-11-17 20:52:38 +0000 |
commit | 7fed65a68d961eef21d4572beab64d047ece5a3e (patch) | |
tree | e41ca76a165b977c49e637baa022b7be07321829 /test/CodeGen/XCore | |
parent | e93483d855af7acf831d1d8c3c77ed117f0df4d3 (diff) | |
download | external_llvm-7fed65a68d961eef21d4572beab64d047ece5a3e.zip external_llvm-7fed65a68d961eef21d4572beab64d047ece5a3e.tar.gz external_llvm-7fed65a68d961eef21d4572beab64d047ece5a3e.tar.bz2 |
Add soft float support for a bunch more operations. Original
patch by Richard Osborne, tweaked and extended by your humble
servant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59464 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/XCore')
-rw-r--r-- | test/CodeGen/XCore/cos.ll | 16 | ||||
-rw-r--r-- | test/CodeGen/XCore/exp.ll | 16 | ||||
-rw-r--r-- | test/CodeGen/XCore/exp2.ll | 16 | ||||
-rw-r--r-- | test/CodeGen/XCore/fneg.ll | 8 | ||||
-rw-r--r-- | test/CodeGen/XCore/log.ll | 16 | ||||
-rw-r--r-- | test/CodeGen/XCore/log10.ll | 16 | ||||
-rw-r--r-- | test/CodeGen/XCore/log2.ll | 16 | ||||
-rw-r--r-- | test/CodeGen/XCore/pow.ll | 16 | ||||
-rw-r--r-- | test/CodeGen/XCore/powi.ll | 16 | ||||
-rw-r--r-- | test/CodeGen/XCore/sin.ll | 16 | ||||
-rw-r--r-- | test/CodeGen/XCore/sqrt.ll | 16 |
11 files changed, 168 insertions, 0 deletions
diff --git a/test/CodeGen/XCore/cos.ll b/test/CodeGen/XCore/cos.ll new file mode 100644 index 0000000..334f0d5 --- /dev/null +++ b/test/CodeGen/XCore/cos.ll @@ -0,0 +1,16 @@ +; RUN: llvm-as < %s | llc -march=xcore > %t1.s +; RUN: grep "bl cosf" %t1.s | count 1 +; RUN: grep "bl cos" %t1.s | count 2 +declare double @llvm.cos.f64(double) + +define double @test(double %F) { + %result = call double @llvm.cos.f64(double %F) + ret double %result +} + +declare float @llvm.cos.f32(float) + +define float @testf(float %F) { + %result = call float @llvm.cos.f32(float %F) + ret float %result +} diff --git a/test/CodeGen/XCore/exp.ll b/test/CodeGen/XCore/exp.ll new file mode 100644 index 0000000..8412e7a --- /dev/null +++ b/test/CodeGen/XCore/exp.ll @@ -0,0 +1,16 @@ +; RUN: llvm-as < %s | llc -march=xcore > %t1.s +; RUN: grep "bl expf" %t1.s | count 1 +; RUN: grep "bl exp" %t1.s | count 2 +declare double @llvm.exp.f64(double) + +define double @test(double %F) { + %result = call double @llvm.exp.f64(double %F) + ret double %result +} + +declare float @llvm.exp.f32(float) + +define float @testf(float %F) { + %result = call float @llvm.exp.f32(float %F) + ret float %result +} diff --git a/test/CodeGen/XCore/exp2.ll b/test/CodeGen/XCore/exp2.ll new file mode 100644 index 0000000..a53b767 --- /dev/null +++ b/test/CodeGen/XCore/exp2.ll @@ -0,0 +1,16 @@ +; RUN: llvm-as < %s | llc -march=xcore > %t1.s +; RUN: grep "bl exp2f" %t1.s | count 1 +; RUN: grep "bl exp2" %t1.s | count 2 +declare double @llvm.exp2.f64(double) + +define double @test(double %F) { + %result = call double @llvm.exp2.f64(double %F) + ret double %result +} + +declare float @llvm.exp2.f32(float) + +define float @testf(float %F) { + %result = call float @llvm.exp2.f32(float %F) + ret float %result +} diff --git a/test/CodeGen/XCore/fneg.ll b/test/CodeGen/XCore/fneg.ll new file mode 100644 index 0000000..ac30410 --- /dev/null +++ b/test/CodeGen/XCore/fneg.ll @@ -0,0 +1,8 @@ +; RUN: llvm-as < %s | llc -march=xcore > %t1.s +; RUN: grep "bl __subdf3" %t1.s | count 1 +define i1 @test(double %F) nounwind { +entry: + %0 = sub double -0.000000e+00, %F + %1 = fcmp olt double 0.000000e+00, %0 + ret i1 %1 +} diff --git a/test/CodeGen/XCore/log.ll b/test/CodeGen/XCore/log.ll new file mode 100644 index 0000000..88d9d7f --- /dev/null +++ b/test/CodeGen/XCore/log.ll @@ -0,0 +1,16 @@ +; RUN: llvm-as < %s | llc -march=xcore > %t1.s +; RUN: grep "bl logf" %t1.s | count 1 +; RUN: grep "bl log" %t1.s | count 2 +declare double @llvm.log.f64(double) + +define double @test(double %F) { + %result = call double @llvm.log.f64(double %F) + ret double %result +} + +declare float @llvm.log.f32(float) + +define float @testf(float %F) { + %result = call float @llvm.log.f32(float %F) + ret float %result +} diff --git a/test/CodeGen/XCore/log10.ll b/test/CodeGen/XCore/log10.ll new file mode 100644 index 0000000..f844d8f --- /dev/null +++ b/test/CodeGen/XCore/log10.ll @@ -0,0 +1,16 @@ +; RUN: llvm-as < %s | llc -march=xcore > %t1.s +; RUN: grep "bl log10f" %t1.s | count 1 +; RUN: grep "bl log10" %t1.s | count 2 +declare double @llvm.log10.f64(double) + +define double @test(double %F) { + %result = call double @llvm.log10.f64(double %F) + ret double %result +} + +declare float @llvm.log10.f32(float) + +define float @testf(float %F) { + %result = call float @llvm.log10.f32(float %F) + ret float %result +} diff --git a/test/CodeGen/XCore/log2.ll b/test/CodeGen/XCore/log2.ll new file mode 100644 index 0000000..b8a3dbd --- /dev/null +++ b/test/CodeGen/XCore/log2.ll @@ -0,0 +1,16 @@ +; RUN: llvm-as < %s | llc -march=xcore > %t1.s +; RUN: grep "bl log2f" %t1.s | count 1 +; RUN: grep "bl log2" %t1.s | count 2 +declare double @llvm.log2.f64(double) + +define double @test(double %F) { + %result = call double @llvm.log2.f64(double %F) + ret double %result +} + +declare float @llvm.log2.f32(float) + +define float @testf(float %F) { + %result = call float @llvm.log2.f32(float %F) + ret float %result +} diff --git a/test/CodeGen/XCore/pow.ll b/test/CodeGen/XCore/pow.ll new file mode 100644 index 0000000..a7b6318 --- /dev/null +++ b/test/CodeGen/XCore/pow.ll @@ -0,0 +1,16 @@ +; RUN: llvm-as < %s | llc -march=xcore > %t1.s +; RUN: grep "bl powf" %t1.s | count 1 +; RUN: grep "bl pow" %t1.s | count 2 +declare double @llvm.pow.f64(double, double) + +define double @test(double %F, double %power) { + %result = call double @llvm.pow.f64(double %F, double %power) + ret double %result +} + +declare float @llvm.pow.f32(float, float) + +define float @testf(float %F, float %power) { + %result = call float @llvm.pow.f32(float %F, float %power) + ret float %result +} diff --git a/test/CodeGen/XCore/powi.ll b/test/CodeGen/XCore/powi.ll new file mode 100644 index 0000000..30e6d7e --- /dev/null +++ b/test/CodeGen/XCore/powi.ll @@ -0,0 +1,16 @@ +; RUN: llvm-as < %s | llc -march=xcore > %t1.s +; RUN: grep "bl __powidf2" %t1.s | count 1 +; RUN: grep "bl __powisf2" %t1.s | count 1 +declare double @llvm.powi.f64(double, i32) + +define double @test(double %F, i32 %power) { + %result = call double @llvm.powi.f64(double %F, i32 %power) + ret double %result +} + +declare float @llvm.powi.f32(float, i32) + +define float @testf(float %F, i32 %power) { + %result = call float @llvm.powi.f32(float %F, i32 %power) + ret float %result +} diff --git a/test/CodeGen/XCore/sin.ll b/test/CodeGen/XCore/sin.ll new file mode 100644 index 0000000..41aab67 --- /dev/null +++ b/test/CodeGen/XCore/sin.ll @@ -0,0 +1,16 @@ +; RUN: llvm-as < %s | llc -march=xcore > %t1.s +; RUN: grep "bl sinf" %t1.s | count 1 +; RUN: grep "bl sin" %t1.s | count 2 +declare double @llvm.sin.f64(double) + +define double @test(double %F) { + %result = call double @llvm.sin.f64(double %F) + ret double %result +} + +declare float @llvm.sin.f32(float) + +define float @testf(float %F) { + %result = call float @llvm.sin.f32(float %F) + ret float %result +} diff --git a/test/CodeGen/XCore/sqrt.ll b/test/CodeGen/XCore/sqrt.ll new file mode 100644 index 0000000..221d1ac --- /dev/null +++ b/test/CodeGen/XCore/sqrt.ll @@ -0,0 +1,16 @@ +; RUN: llvm-as < %s | llc -march=xcore > %t1.s +; RUN: grep "bl sqrtf" %t1.s | count 1 +; RUN: grep "bl sqrt" %t1.s | count 2 +declare double @llvm.sqrt.f64(double) + +define double @test(double %F) { + %result = call double @llvm.sqrt.f64(double %F) + ret double %result +} + +declare float @llvm.sqrt.f32(float) + +define float @testf(float %F) { + %result = call float @llvm.sqrt.f32(float %F) + ret float %result +} |