diff options
author | Tim Northover <tnorthover@apple.com> | 2013-10-24 10:37:09 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2013-10-24 10:37:09 +0000 |
commit | 94ecbd2e6c05316c25349eec88a99f40c83995ce (patch) | |
tree | 9f168acbd1099fe52eaeccd048b0f5951d3da3c0 /llvm | |
parent | b596fb2be2e436ac24162c284fdbe3fe6f69be3d (diff) | |
download | bcm5719-llvm-94ecbd2e6c05316c25349eec88a99f40c83995ce.tar.gz bcm5719-llvm-94ecbd2e6c05316c25349eec88a99f40c83995ce.zip |
ARM: Use non-VFP softcalls on embedded Darwinish targets
The compiler-rt functions __adddf3vfp and so on exist purely to allow Thumb1
code to make use of VFP instructions by switching back to ARM mode, they make
no sense for M-class processors which don't even have an ARM mode.
Given that justification, in practice this is a platform ABI decision so the
actual check is based on that rather than CPU features.
rdar://problem/15302004
llvm-svn: 193327
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/Target/ARM/ARMISelLowering.cpp | 2 | ||||
-rw-r--r-- | llvm/test/CodeGen/ARM/darwin-eabi.ll | 22 |
2 files changed, 23 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp index 6214b472f90..43e3b3797d1 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -175,7 +175,7 @@ ARMTargetLowering::ARMTargetLowering(TargetMachine &TM) setBooleanVectorContents(ZeroOrNegativeOneBooleanContent); - if (Subtarget->isTargetDarwin()) { + if (Subtarget->isTargetIOS()) { // Uses VFP for Thumb libfuncs if available. if (Subtarget->isThumb() && Subtarget->hasVFP2()) { // Single-precision floating-point arithmetic. diff --git a/llvm/test/CodeGen/ARM/darwin-eabi.ll b/llvm/test/CodeGen/ARM/darwin-eabi.ll new file mode 100644 index 00000000000..e0c20373ba2 --- /dev/null +++ b/llvm/test/CodeGen/ARM/darwin-eabi.ll @@ -0,0 +1,22 @@ +; RUN: llc -mtriple=thumbv7m-apple-darwin-eabi -mcpu=cortex-m3 < %s | FileCheck %s --check-prefix=CHECK-M3 +; RUN: llc -mtriple=thumbv7em-apple-darwin-eabi -mcpu=cortex-m4 < %s | FileCheck %s --check-prefix=CHECK-M4 + +define float @float_op(float %lhs, float %rhs) { + %sum = fadd float %lhs, %rhs + ret float %sum +; CHECK-M3-LABEL: float_op: +; CHECK-M3: blx ___addsf3 + +; CHECK-M4-LABEL: float_op: +; CHECK-M4: vadd.f32 +} + +define double @double_op(double %lhs, double %rhs) { + %sum = fadd double %lhs, %rhs + ret double %sum +; CHECK-M3-LABEL: double_op: +; CHECK-M3: blx ___adddf3 + +; CHECK-M4-LABEL: double_op: +; CHECK-M4: blx ___adddf3 +} |