llvm.org GIT mirror llvm / 214fd3d
Recommit modified r167540. Improve ARM build attribute emission for architectures types. This also changes the default architecture emitted for a generic CPU to "v7". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167574 91177308-0d34-0410-b5e6-96231b3b80d8 Amara Emerson 7 years ago
2 changed file(s) with 21 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
748748 AttrEmitter->EmitAttribute(ARMBuildAttrs::THUMB_ISA_use,
749749 ARMBuildAttrs::Allowed);
750750 } else if (CPUString == "generic") {
751 // FIXME: Why these defaults?
752 AttrEmitter->EmitAttribute(ARMBuildAttrs::CPU_arch, ARMBuildAttrs::v4T);
751 // For a generic CPU, we assume a standard v7a architecture in Subtarget.
752 AttrEmitter->EmitAttribute(ARMBuildAttrs::CPU_arch, ARMBuildAttrs::v7);
753 AttrEmitter->EmitAttribute(ARMBuildAttrs::CPU_arch_profile,
754 ARMBuildAttrs::ApplicationProfile);
753755 AttrEmitter->EmitAttribute(ARMBuildAttrs::ARM_ISA_use,
754756 ARMBuildAttrs::Allowed);
755757 AttrEmitter->EmitAttribute(ARMBuildAttrs::THUMB_ISA_use,
756 ARMBuildAttrs::Allowed);
757 }
758 ARMBuildAttrs::AllowThumb32);
759 } else if (Subtarget->hasV7Ops()) {
760 AttrEmitter->EmitAttribute(ARMBuildAttrs::CPU_arch, ARMBuildAttrs::v7);
761 AttrEmitter->EmitAttribute(ARMBuildAttrs::THUMB_ISA_use,
762 ARMBuildAttrs::AllowThumb32);
763 } else if (Subtarget->hasV6T2Ops())
764 AttrEmitter->EmitAttribute(ARMBuildAttrs::CPU_arch, ARMBuildAttrs::v6T2);
765 else if (Subtarget->hasV6Ops())
766 AttrEmitter->EmitAttribute(ARMBuildAttrs::CPU_arch, ARMBuildAttrs::v6);
767 else if (Subtarget->hasV5TEOps())
768 AttrEmitter->EmitAttribute(ARMBuildAttrs::CPU_arch, ARMBuildAttrs::v5TE);
769 else if (Subtarget->hasV5TOps())
770 AttrEmitter->EmitAttribute(ARMBuildAttrs::CPU_arch, ARMBuildAttrs::v5T);
771 else if (Subtarget->hasV4TOps())
772 AttrEmitter->EmitAttribute(ARMBuildAttrs::CPU_arch, ARMBuildAttrs::v4T);
758773
759774 if (Subtarget->hasNEON() && emitFPU) {
760775 /* NEON is not exactly a VFP architecture, but GAS emit one of
1212 ; BASIC-NEXT: 0x00000000
1313 ; BASIC-NEXT: 0x00000000
1414 ; BASIC-NEXT: 0x0000003c
15 ; BASIC-NEXT: 0x00000020
15 ; BASIC-NEXT: 0x00000022
1616 ; BASIC-NEXT: 0x00000000
1717 ; BASIC-NEXT: 0x00000000
1818 ; BASIC-NEXT: 0x00000001
1919 ; BASIC-NEXT: 0x00000000
20 ; BASIC-NEXT: '411f0000 00616561 62690001 15000000 06020801 09011401 15011703 18011901'
20 ; BASIC-NEXT: '41210000 00616561 62690001 17000000 060a0741 08010902 14011501 17031801 1901'
2121
2222 ; CORTEXA8: .ARM.attributes
2323 ; CORTEXA8-NEXT: 0x70000003