summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2013-12-18 09:27:33 +0000
committerTim Northover <tnorthover@apple.com>2013-12-18 09:27:33 +0000
commit44594ad7e232fe9521dbe7f098a36deb35ea5f23 (patch)
tree45662ac6b08087be5a1899e78a6361f5f70915e8 /llvm/lib/Target/ARM
parentcb164ab273cc7b751a47302e0246b890ad1b351f (diff)
downloadbcm5719-llvm-44594ad7e232fe9521dbe7f098a36deb35ea5f23.tar.gz
bcm5719-llvm-44594ad7e232fe9521dbe7f098a36deb35ea5f23.zip
ARM: set default float ABI based on triple.
Clang sets the float-abi target option manually, but no longer annotates each function with its ABI. This can lead to confusing mistmatch between "clang -emit-llvm | llc" and normal clang invocations. Besides which, gnueabihf actually *is* hard-float. Defaulting to soft was just perverse. llvm-svn: 197554
Diffstat (limited to 'llvm/lib/Target/ARM')
-rw-r--r--llvm/lib/Target/ARM/ARMSubtarget.h5
-rw-r--r--llvm/lib/Target/ARM/ARMTargetMachine.cpp3
2 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMSubtarget.h b/llvm/lib/Target/ARM/ARMSubtarget.h
index 42bc155d3be..4893973e1c2 100644
--- a/llvm/lib/Target/ARM/ARMSubtarget.h
+++ b/llvm/lib/Target/ARM/ARMSubtarget.h
@@ -321,6 +321,11 @@ public:
TargetTriple.getEnvironment() == Triple::EABIHF;
}
+ bool isTargetHardFloat() const {
+ return TargetTriple.getEnvironment() == Triple::GNUEABIHF ||
+ TargetTriple.getEnvironment() == Triple::EABIHF;
+ }
+
bool isAPCS_ABI() const { return TargetABI == ARM_ABI_APCS; }
bool isAAPCS_ABI() const { return TargetABI == ARM_ABI_AAPCS; }
diff --git a/llvm/lib/Target/ARM/ARMTargetMachine.cpp b/llvm/lib/Target/ARM/ARMTargetMachine.cpp
index b46ec1da0e8..1d60e5de559 100644
--- a/llvm/lib/Target/ARM/ARMTargetMachine.cpp
+++ b/llvm/lib/Target/ARM/ARMTargetMachine.cpp
@@ -53,7 +53,8 @@ ARMBaseTargetMachine::ARMBaseTargetMachine(const Target &T, StringRef TT,
InstrItins(Subtarget.getInstrItineraryData()) {
// Default to soft float ABI
if (Options.FloatABIType == FloatABI::Default)
- this->Options.FloatABIType = FloatABI::Soft;
+ this->Options.FloatABIType =
+ Subtarget.isTargetHardFloat() ? FloatABI::Hard : FloatABI::Soft;
}
void ARMBaseTargetMachine::addAnalysisPasses(PassManagerBase &PM) {
OpenPOWER on IntegriCloud