diff options
author | Bradley Smith <bradley.smith@arm.com> | 2013-11-01 11:21:16 +0000 |
---|---|---|
committer | Bradley Smith <bradley.smith@arm.com> | 2013-11-01 11:21:16 +0000 |
commit | 479a2de32a994b1902869b88e56253936d943531 (patch) | |
tree | 30eddff9ce71c7507cf66838659e4b63abf86c5f /lib | |
parent | e14fb073574dcb74de05bdeedbfb3fcffbfa1bf6 (diff) | |
download | external_llvm-479a2de32a994b1902869b88e56253936d943531.zip external_llvm-479a2de32a994b1902869b88e56253936d943531.tar.gz external_llvm-479a2de32a994b1902869b88e56253936d943531.tar.bz2 |
[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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193856 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/ARM/ARMAsmPrinter.cpp | 12 | ||||
-rw-r--r-- | lib/Target/ARM/ARMBuildAttrs.h | 6 |
2 files changed, 13 insertions, 5 deletions
diff --git a/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp index 8653a7c..c0f6d1f 100644 --- a/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/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/lib/Target/ARM/ARMBuildAttrs.h b/lib/Target/ARM/ARMBuildAttrs.h index 93edc55..f63689b 100644 --- a/lib/Target/ARM/ARMBuildAttrs.h +++ b/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. |