From: Richard Osborne Date: Tue, 1 Nov 2011 10:51:48 +0000 (+0000) Subject: Combine various XCore tests for floating point intrinsic support into a single test. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=441ed4ac23d0ceaa4ff3c4d302412368dab1d748;p=oota-llvm.git Combine various XCore tests for floating point intrinsic support into a single test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143458 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGen/XCore/cos.ll b/test/CodeGen/XCore/cos.ll deleted file mode 100644 index 8bc5e81dba4..00000000000 --- a/test/CodeGen/XCore/cos.ll +++ /dev/null @@ -1,18 +0,0 @@ -; RUN: llc < %s -march=xcore | FileCheck %s -declare double @llvm.cos.f64(double) - -define double @test(double %F) { -; CHECK: test: -; CHECK: bl cos - %result = call double @llvm.cos.f64(double %F) - ret double %result -} - -declare float @llvm.cos.f32(float) - -; CHECK: testf: -; CHECK: bl cosf -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 deleted file mode 100644 index f30f72ed9bf..00000000000 --- a/test/CodeGen/XCore/exp.ll +++ /dev/null @@ -1,18 +0,0 @@ -; RUN: llc < %s -march=xcore | FileCheck %s -declare double @llvm.exp.f64(double) - -define double @test(double %F) { -; CHECK: test: -; CHECK: bl exp - %result = call double @llvm.exp.f64(double %F) - ret double %result -} - -declare float @llvm.exp.f32(float) - -define float @testf(float %F) { -; CHECK: testf: -; CHECK: bl expf - %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 deleted file mode 100644 index e9ff0a55748..00000000000 --- a/test/CodeGen/XCore/exp2.ll +++ /dev/null @@ -1,18 +0,0 @@ -; RUN: llc < %s -march=xcore | FileCheck %s -declare double @llvm.exp2.f64(double) - -define double @test(double %F) { -; CHECK: test: -; CHECK: bl exp2 - %result = call double @llvm.exp2.f64(double %F) - ret double %result -} - -declare float @llvm.exp2.f32(float) - -define float @testf(float %F) { -; CHECK: testf: -; CHECK: bl exp2f - %result = call float @llvm.exp2.f32(float %F) - ret float %result -} diff --git a/test/CodeGen/XCore/float-intrinsics.ll b/test/CodeGen/XCore/float-intrinsics.ll new file mode 100644 index 00000000000..69a40f3c79b --- /dev/null +++ b/test/CodeGen/XCore/float-intrinsics.ll @@ -0,0 +1,171 @@ +; RUN: llc < %s -march=xcore | FileCheck %s +declare double @llvm.cos.f64(double) +declare double @llvm.exp.f64(double) +declare double @llvm.exp2.f64(double) +declare double @llvm.log.f64(double) +declare double @llvm.log10.f64(double) +declare double @llvm.log2.f64(double) +declare double @llvm.pow.f64(double, double) +declare double @llvm.powi.f64(double, i32) +declare double @llvm.sin.f64(double) +declare double @llvm.sqrt.f64(double) + +define double @cos(double %F) { +; CHECK: cos: +; CHECK: bl cos + %result = call double @llvm.cos.f64(double %F) + ret double %result +} + +declare float @llvm.cos.f32(float) + +; CHECK: cosf: +; CHECK: bl cosf +define float @cosf(float %F) { + %result = call float @llvm.cos.f32(float %F) + ret float %result +} + +define double @exp(double %F) { +; CHECK: exp: +; CHECK: bl exp + %result = call double @llvm.exp.f64(double %F) + ret double %result +} + +declare float @llvm.exp.f32(float) + +define float @expf(float %F) { +; CHECK: expf: +; CHECK: bl expf + %result = call float @llvm.exp.f32(float %F) + ret float %result +} + +define double @exp2(double %F) { +; CHECK: exp2: +; CHECK: bl exp2 + %result = call double @llvm.exp2.f64(double %F) + ret double %result +} + +declare float @llvm.exp2.f32(float) + +define float @exp2f(float %F) { +; CHECK: exp2f: +; CHECK: bl exp2f + %result = call float @llvm.exp2.f32(float %F) + ret float %result +} + +define double @log(double %F) { +; CHECK: log: +; CHECK: bl log + %result = call double @llvm.log.f64(double %F) + ret double %result +} + +declare float @llvm.log.f32(float) + +define float @logf(float %F) { +; CHECK: logf: +; CHECK: bl logf + %result = call float @llvm.log.f32(float %F) + ret float %result +} + +define double @log10(double %F) { +; CHECK: log10: +; CHECK: bl log10 + %result = call double @llvm.log10.f64(double %F) + ret double %result +} + +declare float @llvm.log10.f32(float) + +define float @log10f(float %F) { +; CHECK: log10f: +; CHECK: bl log10f + %result = call float @llvm.log10.f32(float %F) + ret float %result +} + +define double @log2(double %F) { +; CHECK: log2: +; CHECK: bl log2 + %result = call double @llvm.log2.f64(double %F) + ret double %result +} + +declare float @llvm.log2.f32(float) + +define float @log2f(float %F) { +; CHECK: log2f: +; CHECK: bl log2f + %result = call float @llvm.log2.f32(float %F) + ret float %result +} + +define double @pow(double %F, double %power) { +; CHECK: pow: +; CHECK: bl pow + %result = call double @llvm.pow.f64(double %F, double %power) + ret double %result +} + +declare float @llvm.pow.f32(float, float) + +define float @powf(float %F, float %power) { +; CHECK: powf: +; CHECK: bl powf + %result = call float @llvm.pow.f32(float %F, float %power) + ret float %result +} + +define double @powi(double %F, i32 %power) { +; CHECK: powi: +; CHECK: bl __powidf2 + %result = call double @llvm.powi.f64(double %F, i32 %power) + ret double %result +} + +declare float @llvm.powi.f32(float, i32) + +define float @powif(float %F, i32 %power) { +; CHECK: powif: +; CHECK: bl __powisf2 + %result = call float @llvm.powi.f32(float %F, i32 %power) + ret float %result +} + +define double @sin(double %F) { +; CHECK: sin: +; CHECK: bl sin + %result = call double @llvm.sin.f64(double %F) + ret double %result +} + +declare float @llvm.sin.f32(float) + +define float @sinf(float %F) { +; CHECK: sinf: +; CHECK: bl sinf + %result = call float @llvm.sin.f32(float %F) + ret float %result +} + +define double @sqrt(double %F) { +; CHECK: sqrt: +; CHECK: bl sqrt + %result = call double @llvm.sqrt.f64(double %F) + ret double %result +} + +declare float @llvm.sqrt.f32(float) + +define float @sqrtf(float %F) { +; CHECK: sqrtf: +; CHECK: bl sqrtf + %result = call float @llvm.sqrt.f32(float %F) + ret float %result +} diff --git a/test/CodeGen/XCore/log.ll b/test/CodeGen/XCore/log.ll deleted file mode 100644 index e954ab28b28..00000000000 --- a/test/CodeGen/XCore/log.ll +++ /dev/null @@ -1,18 +0,0 @@ -; RUN: llc < %s -march=xcore | FileCheck %s -declare double @llvm.log.f64(double) - -define double @test(double %F) { -; CHECK: test: -; CHECK: bl log - %result = call double @llvm.log.f64(double %F) - ret double %result -} - -declare float @llvm.log.f32(float) - -define float @testf(float %F) { -; CHECK: testf: -; CHECK: bl logf - %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 deleted file mode 100644 index 88b29b19664..00000000000 --- a/test/CodeGen/XCore/log10.ll +++ /dev/null @@ -1,18 +0,0 @@ -; RUN: llc < %s -march=xcore | FileCheck %s -declare double @llvm.log10.f64(double) - -define double @test(double %F) { -; CHECK: test: -; CHECK: bl log10 - %result = call double @llvm.log10.f64(double %F) - ret double %result -} - -declare float @llvm.log10.f32(float) - -define float @testf(float %F) { -; CHECK: testf: -; CHECK: bl log10f - %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 deleted file mode 100644 index 51993897667..00000000000 --- a/test/CodeGen/XCore/log2.ll +++ /dev/null @@ -1,18 +0,0 @@ -; RUN: llc < %s -march=xcore | FileCheck %s -declare double @llvm.log2.f64(double) - -define double @test(double %F) { -; CHECK: test: -; CHECK: bl log2 - %result = call double @llvm.log2.f64(double %F) - ret double %result -} - -declare float @llvm.log2.f32(float) - -define float @testf(float %F) { -; CHECK: testf: -; CHECK: bl log2f - %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 deleted file mode 100644 index 36c7ae82ba5..00000000000 --- a/test/CodeGen/XCore/pow.ll +++ /dev/null @@ -1,18 +0,0 @@ -; RUN: llc < %s -march=xcore | FileCheck %s -declare double @llvm.pow.f64(double, double) - -define double @test(double %F, double %power) { -; CHECK: test: -; CHECK: bl pow - %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) { -; CHECK: testf: -; CHECK: bl powf - %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 deleted file mode 100644 index 3c4f097389f..00000000000 --- a/test/CodeGen/XCore/powi.ll +++ /dev/null @@ -1,18 +0,0 @@ -; RUN: llc < %s -march=xcore | FileCheck %s -declare double @llvm.powi.f64(double, i32) - -define double @test(double %F, i32 %power) { -; CHECK: test: -; CHECK: bl __powidf2 - %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) { -; CHECK: testf: -; CHECK: bl __powisf2 - %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 deleted file mode 100644 index 09ca852198b..00000000000 --- a/test/CodeGen/XCore/sin.ll +++ /dev/null @@ -1,18 +0,0 @@ -; RUN: llc < %s -march=xcore | FileCheck %s -declare double @llvm.sin.f64(double) - -define double @test(double %F) { -; CHECK: test: -; CHECK: bl sin - %result = call double @llvm.sin.f64(double %F) - ret double %result -} - -declare float @llvm.sin.f32(float) - -define float @testf(float %F) { -; CHECK: testf: -; CHECK: bl sinf - %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 deleted file mode 100644 index d65a90bb432..00000000000 --- a/test/CodeGen/XCore/sqrt.ll +++ /dev/null @@ -1,18 +0,0 @@ -; RUN: llc < %s -march=xcore | FileCheck %s -declare double @llvm.sqrt.f64(double) - -define double @test(double %F) { -; CHECK: test: -; CHECK: bl sqrt - %result = call double @llvm.sqrt.f64(double %F) - ret double %result -} - -declare float @llvm.sqrt.f32(float) - -define float @testf(float %F) { -; CHECK: testf: -; CHECK: bl sqrtf - %result = call float @llvm.sqrt.f32(float %F) - ret float %result -}