[PATCH] Use ".arch_extension" ARM directive to specify the additional CPU features
Sumanth Gundapaneni
sgundapa at codeaurora.org
Sat Jan 31 12:26:15 PST 2015
Hi rengolin, t.p.northover, apazos,
This patch is in response to r223147 where the avaiable features are computed based on ".cpu" directive. This will work clean for the standard variants like cortex-a9. For custom variants which rely on standard cpu names for aassembly, the additional features of a CPU should be propagated. This can be done via ".arch_extension" as long as the assembler supports it.
http://reviews.llvm.org/D7316
Files:
include/llvm/MC/MCStreamer.h
lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
lib/Target/ARM/MCTargetDesc/ARMTargetStreamer.cpp
Index: include/llvm/MC/MCStreamer.h
===================================================================
--- include/llvm/MC/MCStreamer.h
+++ include/llvm/MC/MCStreamer.h
@@ -139,6 +139,7 @@
StringRef StringValue = "");
virtual void emitFPU(unsigned FPU);
virtual void emitArch(unsigned Arch);
+ virtual void emitArchExtension(StringRef StringValue);
virtual void emitObjectArch(unsigned Arch);
virtual void finishAttributeSection();
virtual void emitInst(uint32_t Inst, char Suffix = '\0');
Index: lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
===================================================================
--- lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
+++ lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
@@ -134,6 +134,7 @@
void emitIntTextAttribute(unsigned Attribute, unsigned IntValue,
StringRef StrinValue) override;
void emitArch(unsigned Arch) override;
+ void emitArchExtension(StringRef StringValue) override;
void emitObjectArch(unsigned Arch) override;
void emitFPU(unsigned FPU) override;
void emitInst(uint32_t Inst, char Suffix = '\0') override;
@@ -249,6 +250,9 @@
void ARMTargetAsmStreamer::emitArch(unsigned Arch) {
OS << "\t.arch\t" << GetArchName(Arch) << "\n";
}
+void ARMTargetAsmStreamer::emitArchExtension(StringRef StringValue) {
+ OS << "\t.arch_extension\t" << StringValue << "\n";
+}
void ARMTargetAsmStreamer::emitObjectArch(unsigned Arch) {
OS << "\t.object_arch\t" << GetArchName(Arch) << '\n';
}
Index: lib/Target/ARM/MCTargetDesc/ARMTargetStreamer.cpp
===================================================================
--- lib/Target/ARM/MCTargetDesc/ARMTargetStreamer.cpp
+++ lib/Target/ARM/MCTargetDesc/ARMTargetStreamer.cpp
@@ -63,6 +63,7 @@
unsigned IntValue,
StringRef StringValue) {}
void ARMTargetStreamer::emitArch(unsigned Arch) {}
+void ARMTargetStreamer::emitArchExtension(StringRef StringValue) {}
void ARMTargetStreamer::emitObjectArch(unsigned Arch) {}
void ARMTargetStreamer::emitFPU(unsigned FPU) {}
void ARMTargetStreamer::finishAttributeSection() {}
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7316.19098.patch
Type: text/x-patch
Size: 2216 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150131/1b31fd77/attachment.bin>
More information about the llvm-commits
mailing list