[llvm-commits] [llvm] r131751 - in /llvm/trunk: lib/Target/ARM/ARMAsmPrinter.cpp test/MC/ARM/xscale-attributes.ll
Rafael Espindola
rafael.espindola at gmail.com
Fri May 20 13:10:34 PDT 2011
Author: rafael
Date: Fri May 20 15:10:34 2011
New Revision: 131751
URL: http://llvm.org/viewvc/llvm-project?rev=131751&view=rev
Log:
adds some attributes to attribute section when cpu is "xscale"
(this is what used in Android NDK, when architecture is ARMv5)
patch by Koan-Sin Tan
Added:
llvm/trunk/test/MC/ARM/xscale-attributes.ll
Modified:
llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp?rev=131751&r1=131750&r2=131751&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp Fri May 20 15:10:34 2011
@@ -588,6 +588,12 @@
//
/// ADD additional Else-cases here!
+ } else if (CPUString == "xscale") {
+ AttrEmitter->EmitAttribute(ARMBuildAttrs::CPU_arch, ARMBuildAttrs::v5TEJ);
+ AttrEmitter->EmitAttribute(ARMBuildAttrs::ARM_ISA_use,
+ ARMBuildAttrs::Allowed);
+ AttrEmitter->EmitAttribute(ARMBuildAttrs::THUMB_ISA_use,
+ ARMBuildAttrs::Allowed);
} else if (CPUString == "generic") {
// FIXME: Why these defaults?
AttrEmitter->EmitAttribute(ARMBuildAttrs::CPU_arch, ARMBuildAttrs::v4T);
Added: llvm/trunk/test/MC/ARM/xscale-attributes.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/xscale-attributes.ll?rev=131751&view=auto
==============================================================================
--- llvm/trunk/test/MC/ARM/xscale-attributes.ll (added)
+++ llvm/trunk/test/MC/ARM/xscale-attributes.ll Fri May 20 15:10:34 2011
@@ -0,0 +1,31 @@
+; RUN: llc %s -mtriple=thumbv5-linux-gnueabi -mcpu=xscale -o - | \
+; RUN: FileCheck -check-prefix=ASM %s
+
+; RUN: llc %s -mtriple=thumbv5-linux-gnueabi -filetype=obj \
+; RUN: -mcpu=xscale -o - | elf-dump --dump-section-data | \
+; RUN: FileCheck -check-prefix=OBJ %s
+
+; FIXME: The OBJ test should be a .s to .o test and the ASM test should
+; be moved to test/CodeGen/ARM.
+
+define void @foo() nounwind {
+entry:
+ ret void
+}
+
+; ASM: .eabi_attribute 6, 5
+; ASM-NEXT: .eabi_attribute 8, 1
+; ASM-NEXT: .eabi_attribute 9, 1
+
+; OBJ: Section 0x00000004
+; OBJ-NEXT: 'sh_name', 0x0000000c
+; OBJ-NEXT: 'sh_type', 0x70000003
+; OBJ-NEXT: 'sh_flags', 0x00000000
+; OBJ-NEXT: 'sh_addr', 0x00000000
+; OBJ-NEXT: 'sh_offset', 0x00000038
+; OBJ-NEXT: 'sh_size', 0x00000020
+; OBJ-NEXT: 'sh_link', 0x00000000
+; OBJ-NEXT: 'sh_info', 0x00000000
+; OBJ-NEXT: 'sh_addralign', 0x00000001
+; OBJ-NEXT: 'sh_entsize', 0x00000000
+; OBJ-NEXT: '_section_data', '411f0000 00616561 62690001 15000000 06050801 09011401 15011703 18011901'
More information about the llvm-commits
mailing list