summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorBradley Smith <bradley.smith@arm.com>2013-11-01 11:21:16 +0000
committerBradley Smith <bradley.smith@arm.com>2013-11-01 11:21:16 +0000
commitc848beba5e9c43f8b508174d840c03d343495828 (patch)
tree5130b3d17a747a8029226d5cddf058c6d7efa52a /llvm/lib
parent4d94930bcbdcdeb264ac5479ae292c1d91e6d719 (diff)
downloadbcm5719-llvm-c848beba5e9c43f8b508174d840c03d343495828.tar.gz
bcm5719-llvm-c848beba5e9c43f8b508174d840c03d343495828.zip
[ARM] Fix Tag_ABI_HardFP_use build attribute
Fix Tag_ABI_HardFP_use build attribute to handle single precision FP, replace deprecated Tag_ABI_HardFP_use value of 3 with 0 and also add some tests for Tag_ABI_VFP_args. llvm-svn: 193856
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/ARM/ARMAsmPrinter.cpp12
-rw-r--r--llvm/lib/Target/ARM/ARMBuildAttrs.h6
2 files changed, 13 insertions, 5 deletions
diff --git a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
index 8653a7c73b6..c0f6d1fad34 100644
--- a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
+++ b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
@@ -692,11 +692,15 @@ void ARMAsmPrinter::emitAttributes() {
ATS.emitAttribute(ARMBuildAttrs::ABI_align8_needed, 1);
ATS.emitAttribute(ARMBuildAttrs::ABI_align8_preserved, 1);
+ // ABI_HardFP_use attribute to indicate single precision FP.
+ if (Subtarget->isFPOnlySP())
+ ATS.emitAttribute(ARMBuildAttrs::ABI_HardFP_use,
+ ARMBuildAttrs::HardFPSinglePrecision);
+
// Hard float. Use both S and D registers and conform to AAPCS-VFP.
- if (Subtarget->isAAPCS_ABI() && TM.Options.FloatABIType == FloatABI::Hard) {
- ATS.emitAttribute(ARMBuildAttrs::ABI_HardFP_use, 3);
- ATS.emitAttribute(ARMBuildAttrs::ABI_VFP_args, 1);
- }
+ if (Subtarget->isAAPCS_ABI() && TM.Options.FloatABIType == FloatABI::Hard)
+ ATS.emitAttribute(ARMBuildAttrs::ABI_VFP_args, ARMBuildAttrs::HardFPAAPCS);
+
// FIXME: Should we signal R9 usage?
if (Subtarget->hasDivide()) {
diff --git a/llvm/lib/Target/ARM/ARMBuildAttrs.h b/llvm/lib/Target/ARM/ARMBuildAttrs.h
index 93edc55d51f..f63689bb31e 100644
--- a/llvm/lib/Target/ARM/ARMBuildAttrs.h
+++ b/llvm/lib/Target/ARM/ARMBuildAttrs.h
@@ -137,8 +137,12 @@ namespace ARMBuildAttrs {
AllowIEE754 = 3, // this code to use all the IEEE 754-defined FP encodings
// Tag_ABI_HardFP_use, (=27), uleb128
+ HardFPImplied = 0, // FP use should be implied by Tag_FP_arch
HardFPSinglePrecision = 1, // Single-precision only
- HardFPImplied = 3, // FP use should be implied by Tag_FP_arch
+
+ // Tag_ABI_VFP_args, (=28), uleb128
+ BaseAAPCS = 0,
+ HardFPAAPCS = 1,
// Tag_DIV_use, (=44), uleb128
AllowDIVIfExists = 0, // Allow hardware divide if available in arch, or no info exists.
OpenPOWER on IntegriCloud