[PATCH] [ARM] Fix FP ABI attributes with no VFP
Amara Emerson
amara.emerson at arm.com
Fri Oct 11 08:35:09 PDT 2013
Hi richard.barton.arm,
Undo part of a change in r192111 which erroneously omitted the Tag_ABI_FP_* attributes when vfp was not present.
Previous behaviour is restored and tests are updated to reflect this.
http://llvm-reviews.chandlerc.com/D1900
Files:
lib/Target/ARM/ARMAsmPrinter.cpp
test/CodeGen/ARM/2010-09-29-mc-asm-header-test.ll
test/CodeGen/ARM/2010-10-19-mc-elf-objheader.ll
test/MC/ARM/xscale-attributes.ll
Index: lib/Target/ARM/ARMAsmPrinter.cpp
===================================================================
--- lib/Target/ARM/ARMAsmPrinter.cpp
+++ lib/Target/ARM/ARMAsmPrinter.cpp
@@ -876,22 +876,20 @@
}
// Signal various FP modes.
- if (Subtarget->hasVFP2()) {
- if (!TM.Options.UnsafeFPMath) {
- AttrEmitter->EmitAttribute(ARMBuildAttrs::ABI_FP_denormal,
- ARMBuildAttrs::Allowed);
- AttrEmitter->EmitAttribute(ARMBuildAttrs::ABI_FP_exceptions,
- ARMBuildAttrs::Allowed);
- }
-
- if (TM.Options.NoInfsFPMath && TM.Options.NoNaNsFPMath)
- AttrEmitter->EmitAttribute(ARMBuildAttrs::ABI_FP_number_model,
- ARMBuildAttrs::Allowed);
- else
- AttrEmitter->EmitAttribute(ARMBuildAttrs::ABI_FP_number_model,
- ARMBuildAttrs::AllowIEE754);
+ if (!TM.Options.UnsafeFPMath) {
+ AttrEmitter->EmitAttribute(ARMBuildAttrs::ABI_FP_denormal,
+ ARMBuildAttrs::Allowed);
+ AttrEmitter->EmitAttribute(ARMBuildAttrs::ABI_FP_exceptions,
+ ARMBuildAttrs::Allowed);
}
+ if (TM.Options.NoInfsFPMath && TM.Options.NoNaNsFPMath)
+ AttrEmitter->EmitAttribute(ARMBuildAttrs::ABI_FP_number_model,
+ ARMBuildAttrs::Allowed);
+ else
+ AttrEmitter->EmitAttribute(ARMBuildAttrs::ABI_FP_number_model,
+ ARMBuildAttrs::AllowIEE754);
+
// FIXME: add more flags to ARMBuildAttrs.h
// 8-bytes alignment stuff.
AttrEmitter->EmitAttribute(ARMBuildAttrs::ABI_align8_needed, 1);
Index: test/CodeGen/ARM/2010-09-29-mc-asm-header-test.ll
===================================================================
--- test/CodeGen/ARM/2010-09-29-mc-asm-header-test.ll
+++ test/CodeGen/ARM/2010-09-29-mc-asm-header-test.ll
@@ -9,7 +9,6 @@
; RUN: llc < %s -mtriple=armv8-linux-gnueabi -mattr=+neon | FileCheck %s --check-prefix=V8-NEON
; RUN: llc < %s -mtriple=armv8-linux-gnueabi -mattr=+fp-armv8 -mattr=+neon | FileCheck %s --check-prefix=V8-FPARMv8-NEON
; RUN: llc < %s -mtriple=armv8-linux-gnueabi -mattr=+fp-armv8,+neon,+crypto | FileCheck %s --check-prefix=V8-FPARMv8-NEON-CRYPTO
-; RUN: llc < %s -mtriple=armv7-linux-gnueabi -mattr=-neon,-vfp2 | FileCheck %s --check-prefix=NOFP
; RUN: llc < %s -mtriple=armv7-linux-gnueabi -mcpu=cortex-a9 | FileCheck %s --check-prefix=CORTEX-A9
; RUN: llc < %s -mtriple=thumbv6m-linux-gnueabi -mcpu=cortex-m0 | FileCheck %s --check-prefix=CORTEX-M0
; RUN: llc < %s -mtriple=thumbv7m-linux-gnueabi -mcpu=cortex-m4 | FileCheck %s --check-prefix=CORTEX-M4
@@ -86,10 +85,6 @@
; V8-FPARMv8-NEON-CRYPTO: .eabi_attribute 10, 7
; V8-FPARMv8-NEON-CRYPTO: .eabi_attribute 12, 3
-; NOFP-NOT: .eabi_attribute 20
-; NOFP-NOT: .eabi_attribute 21
-; NOFP-NOT: .eabi_attribute 23
-
; CORTEX-A9: .cpu cortex-a9
; CORTEX-A9: .eabi_attribute 6, 10
; CORTEX-A9: .eabi_attribute 7, 65
Index: test/CodeGen/ARM/2010-10-19-mc-elf-objheader.ll
===================================================================
--- test/CodeGen/ARM/2010-10-19-mc-elf-objheader.ll
+++ test/CodeGen/ARM/2010-10-19-mc-elf-objheader.ll
@@ -15,14 +15,14 @@
; BASIC-NEXT: ]
; BASIC-NEXT: Address: 0x0
; BASIC-NEXT: Offset: 0x3C
-; BASIC-NEXT: Size: 24
+; BASIC-NEXT: Size: 30
; BASIC-NEXT: Link: 0
; BASIC-NEXT: Info: 0
; BASIC-NEXT: AddressAlignment: 1
; BASIC-NEXT: EntrySize: 0
; BASIC-NEXT: SectionData (
-; BASIC-NEXT: 0000: 41170000 00616561 62690001 0D000000
-; BASIC-NEXT: 0010: 06010801 18011901
+; BASIC-NEXT: 0000: 411D0000 00616561 62690001 13000000
+; BASIC-NEXT: 0010: 06010801 14011501 17031801 1901
; BASIC-NEXT: )
; CORTEXA8: Name: .ARM.attributes
Index: test/MC/ARM/xscale-attributes.ll
===================================================================
--- test/MC/ARM/xscale-attributes.ll
+++ test/MC/ARM/xscale-attributes.ll
@@ -26,14 +26,14 @@
; OBJ-NEXT: ]
; OBJ-NEXT: Address: 0x0
; OBJ-NEXT: Offset: 0x38
-; OBJ-NEXT: Size: 34
+; OBJ-NEXT: Size: 40
; OBJ-NEXT: Link: 0
; OBJ-NEXT: Info: 0
; OBJ-NEXT: AddressAlignment: 1
; OBJ-NEXT: EntrySize: 0
; OBJ-NEXT: SectionData (
-; OBJ-NEXT: 0000: 41210000 00616561 62690001 17000000
-; OBJ-NEXT: 0010: 05585343 414C4500 06050801 09011801
-; OBJ-NEXT: 0020: 1901
+; OBJ-NEXT: 0000: 41270000 00616561 62690001 1D000000
+; OBJ-NEXT: 0010: 05585343 414C4500 06050801 09011401
+; OBJ-NEXT: 0020: 15011703 18011901
; OBJ-NEXT: )
; OBJ-NEXT: }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1900.1.patch
Type: text/x-patch
Size: 4671 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131011/dd27b433/attachment.bin>
More information about the llvm-commits
mailing list