summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorReed Kotler <rkotler@mips.com>2013-09-01 04:12:59 +0000
committerReed Kotler <rkotler@mips.com>2013-09-01 04:12:59 +0000
commit5fdadcef7a5e4133e916011a519cd42c9ef9be3b (patch)
treefd1f91fa09a23742880ef7d54c8765670ca04216 /llvm
parentbda73fff49672a88b62873ca08e8e4c15917d080 (diff)
downloadbcm5719-llvm-5fdadcef7a5e4133e916011a519cd42c9ef9be3b.tar.gz
bcm5719-llvm-5fdadcef7a5e4133e916011a519cd42c9ef9be3b.zip
Make sure we don't generate stubs for any of these functions because they
don't exist in libc. This is really not the right way to solve this problem; but it's not clear to me at this time exactly what is the right way. If we create stubs here, they will cause link errors because these functions do not exist in libc. llvm-svn: 189727
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Target/Mips/Mips16HardFloat.cpp23
-rw-r--r--llvm/test/CodeGen/Mips/powif64_16.ll28
2 files changed, 34 insertions, 17 deletions
diff --git a/llvm/lib/Target/Mips/Mips16HardFloat.cpp b/llvm/lib/Target/Mips/Mips16HardFloat.cpp
index a66abb2b59b..a73d1628dbd 100644
--- a/llvm/lib/Target/Mips/Mips16HardFloat.cpp
+++ b/llvm/lib/Target/Mips/Mips16HardFloat.cpp
@@ -322,10 +322,29 @@ static void assureFPCallStub(Function &F, Module *M,
}
//
-// Functions that are inline intrinsics don't need helpers.
+// Functions that are llvm intrinsics and don't need helpers.
//
static const char *IntrinsicInline[] =
- {"fabs", "llvm.powi.f64"};
+ {"fabs",
+ "llvm.ceil.f32", "llvm.ceil.f64",
+ "llvm.copysign.f32", "llvm.copysign.f64",
+ "llvm.cos.f32", "llvm.cos.f64",
+ "llvm.exp.f32", "llvm.exp.f64",
+ "llvm.exp2.f32", "llvm.exp2.f64",
+ "llvm.fabs.f32", "llvm.fabs.f64",
+ "llvm.floor.f32", "llvm.floor.f64",
+ "llvm.fma.f32", "llvm.fma.f64",
+ "llvm.log.f32", "llvm.log.f64",
+ "llvm.log10.f32", "llvm.log10.f64",
+ "llvm.nearbyint.f32", "llvm.nearbyint.f64",
+ "llvm.pow.f32", "llvm.pow.f64",
+ "llvm.powi.f32", "llvm.powi.f64",
+ "llvm.rint.f32", "llvm.rint.f64",
+ "llvm.round.f32", "llvm.round.f64",
+ "llvm.sin.f32", "llvm.sin.f64",
+ "llvm.sqrt.f32", "llvm.sqrt.f64",
+ "llvm.trunc.f32", "llvm.trunc.f64",
+ };
static bool isIntrinsicInline(Function *F) {
return std::binary_search(
diff --git a/llvm/test/CodeGen/Mips/powif64_16.ll b/llvm/test/CodeGen/Mips/powif64_16.ll
index 8431f316d65..35a7ca9201e 100644
--- a/llvm/test/CodeGen/Mips/powif64_16.ll
+++ b/llvm/test/CodeGen/Mips/powif64_16.ll
@@ -1,23 +1,21 @@
; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mcpu=mips16 -mips16-hard-float -soft-float -relocation-model=static < %s | FileCheck %s
-@x = global double 4.500000e+00, align 8
-@i = global i32 4, align 4
-@y = common global double 0.000000e+00, align 8
+declare float @llvm.powi.f32(float %Val, i32 %power)
+declare double @llvm.powi.f64(double %Val, i32 %power)
-; Function Attrs: nounwind optsize
-define i32 @main() #0 {
-entry:
- %0 = load double* @x, align 8, !tbaa !0
- %1 = load i32* @i, align 4, !tbaa !3
- %2 = tail call double @llvm.powi.f64(double %0, i32 %1)
+define float @foo_pow_f32(float %y, i32 %p) {
+ %1 = tail call float @llvm.powi.f32(float %y, i32 %p)
+; CHECK-NOT: .ent __call_stub_fp_llvm.powi.f32
+; CHECK-NOT: {{.*}} jal llvm.powi.f32
+ ret float %1
+}
+
+define double @foo_pow_f64(double %y, i32 %p) {
+ %1 = tail call double @llvm.powi.f64(double %y, i32 %p)
; CHECK-NOT: .ent __call_stub_fp_llvm.powi.f64
; CHECK-NOT: {{.*}} jal llvm.powi.f64
- store double %2, double* @y, align 8, !tbaa !0
- ret i32 0
-}
-
-; Function Attrs: nounwind readonly
-declare double @llvm.powi.f64(double, i32) #1
+ ret double %1
+}
attributes #0 = { nounwind optsize "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="true" }
attributes #1 = { nounwind readonly }
OpenPOWER on IntegriCloud