[PATCH] [arm] Implement ARM .arch directive.

Logan Chien tzuhsiang.chien at gmail.com
Mon Nov 11 19:13:54 PST 2013

  Hi Richard,

  AFAIK, the MC streamer (ARMELFStreamer / ARMAsmStreamer) is lower than the AsmPrinter in the compilation stack.  The input for MC streamer won't go through the AsmPrinter.  One way to unify two code paths is to utilize the assembly directives whenever possible.  For example, GCC generates following code for "-march=armv5te".  The Tag_CPU_name, Tag_ARM_ISA_use, Tag_THUMB_ISA_use is hidden by the .arch directive.

      .arch armv5te
      .eabi_attribute 27, 3
      .fpu vfpv3-d16
      .eabi_attribute 20, 1
      .eabi_attribute 21, 1
      .eabi_attribute 23, 3
      .eabi_attribute 24, 1
      .eabi_attribute 25, 1
      .eabi_attribute 26, 2
      .eabi_attribute 30, 6
      .eabi_attribute 34, 0
      .eabi_attribute 18, 4

  However, it seems to be a non-trivial task.  We have to map ARMSubtarget to .arch directive, check the cases which are not directly supported by .arch directive, and revise the test cases.  IMO, we can postpone the change to AsmPrinter until the ARM MC assembler is ready.


Comment at: lib/Target/ARM/MCTargetDesc/ARMArchName.def:22
@@ +21,3 @@
+ARM_ARCH_NAME("armv2",	 ARMV2,	  "2",	     v4)
+ARM_ARCH_NAME("armv2a",  ARMV2A,  "2A",      v4)
Richard Barton wrote:
> Formatting bug space before v4
Nice catch.  It seems that I have mixed tabs and spaces.  I will update this in next revision.


More information about the llvm-commits mailing list