[PATCH] [ARM] Implement eabi_attribute, cpu, and fpu directives.
Logan Chien
tzuhsiang.chien at gmail.com
Tue Oct 22 08:46:55 PDT 2013
================
Comment at: lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp:166
@@ +165,3 @@
+ Value >>= 7;
+ Size += sizeof(int8_t); // Is this really necessary?
+ } while (Value);
----------------
Renato Golin wrote:
> I don't think so.
This function is copied from AttrEmitter (including the comment). I think we can leave this function unchanged for now. I am planning to move getULEB128Size() from MCAsmInfo to llvm/Support/LEB128.h, and remove this function in the future.
================
Comment at: lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp:474
@@ +473,3 @@
+void ARMTargetELFStreamer::emitFPU(StringRef FPU) {
+ if (FPU == "vfp" || FPU == "vfpv2") {
+ setAttributeItem(ARMBuildAttrs::VFP_arch,
----------------
Renato Golin wrote:
> It'd be really good to get rid of string parsing at this level...
OK. Will be updated in next revision of this patch.
================
Comment at: lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp:125
@@ +124,3 @@
+void ARMTargetAsmStreamer::emitTextAttribute(unsigned Attribute,
+ StringRef String) {
+ switch (Attribute) {
----------------
Renato Golin wrote:
> A better name for this would be CPU
For now, this function is only for CPU. I am fine to rename this function. However, I am not sure whether it is a good idea or not. According to the specification, there might be other text attributes, such as Tag_CPU_raw_name, Tag_CPU_name, Tag_compatibility, Tag_also_compatible_with, and Tag_conformance. I can do the work if you feel that emitCPU() is better.
================
Comment at: lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp:472
@@ +471,3 @@
+ setAttributeItem(Attribute, Value);
+}
+void ARMTargetELFStreamer::emitFPU(StringRef FPU) {
----------------
Renato Golin wrote:
> These two functions look redundant. Is it just in ARM's case?
Sorry. I don't understand what do you mean by redundant. These are virtual functions used by the AsmPrinter and AsmParser. May you further describe your question? Thanks.
http://llvm-reviews.chandlerc.com/D1987
More information about the llvm-commits
mailing list