diff options
| author | Anton Korobeynikov <asl@math.spbu.ru> | 2009-05-23 19:51:20 +0000 |
|---|---|---|
| committer | Anton Korobeynikov <asl@math.spbu.ru> | 2009-05-23 19:51:20 +0000 |
| commit | fa6f1eea3681f7261c27860ac4beb534ef0fd230 (patch) | |
| tree | 69e3a47d81cba0e4c4f520d61aaadb7419bf6ac2 /llvm/lib/Target/ARM/AsmPrinter | |
| parent | 08bf4c0f5a5981848343c9290c6ff79e9c0306ac (diff) | |
| download | bcm5719-llvm-fa6f1eea3681f7261c27860ac4beb534ef0fd230.tar.gz bcm5719-llvm-fa6f1eea3681f7261c27860ac4beb534ef0fd230.zip | |
Emit ARM Build Attributes
llvm-svn: 72336
Diffstat (limited to 'llvm/lib/Target/ARM/AsmPrinter')
| -rw-r--r-- | llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp index 12e4032b846..e02bab26995 100644 --- a/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp +++ b/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp @@ -14,6 +14,7 @@ #define DEBUG_TYPE "asm-printer" #include "ARM.h" +#include "ARMBuildAttrs.h" #include "ARMTargetMachine.h" #include "ARMAddressingModes.h" #include "ARMConstantPoolValue.h" @@ -816,6 +817,32 @@ bool ARMAsmPrinter::doInitialization(Module &M) { if (Subtarget->isTargetDarwin()) Mang->setUseQuotes(true); + // Emit ARM Build Attributes + if (Subtarget->isTargetELF()) { + // CPU Type + O << "\t.cpu " << Subtarget->getCPUString() << '\n'; + + // FIXME: Emit FPU type + if (Subtarget->hasVFP2()) + O << "\t.eabi_attribute " << ARMBuildAttrs::VFP_arch << ", 2\n"; + + // Signal various FP modes. + if (!UnsafeFPMath) + O << "\t.eabi_attribute " << ARMBuildAttrs::ABI_FP_denormal << ", 1\n" + << "\t.eabi_attribute " << ARMBuildAttrs::ABI_FP_exceptions << ", 1\n"; + + if (FiniteOnlyFPMath()) + O << "\t.eabi_attribute " << ARMBuildAttrs::ABI_FP_number_model << ", 1\n"; + else + O << "\t.eabi_attribute " << ARMBuildAttrs::ABI_FP_number_model << ", 3\n"; + + // 8-bytes alignment stuff. + O << "\t.eabi_attribute " << ARMBuildAttrs::ABI_align8_needed << ", 1\n" + << "\t.eabi_attribute " << ARMBuildAttrs::ABI_align8_preserved << ", 1\n"; + + // FIXME: Should we signal R9 usage? + } + return Result; } |

