2013-05-04 07:57:17 +08:00
|
|
|
//===-- ARMBuildAttrs.h - ARM Build Attributes ------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file contains enumerations and support routines for ARM build attributes
|
|
|
|
// as defined in ARM ABI addenda document (ABI release 2.08).
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef __TARGET_ARMBUILDATTRS_H__
|
|
|
|
#define __TARGET_ARMBUILDATTRS_H__
|
|
|
|
|
[arm] Implement eabi_attribute, cpu, and fpu directives.
This commit allows the ARM integrated assembler to parse
and assemble the code with .eabi_attribute, .cpu, and
.fpu directives.
To implement the feature, this commit moves the code from
AttrEmitter to ARMTargetStreamers, and several new test
cases related to cortex-m4, cortex-r5, and cortex-a15 are
added.
Besides, this commit also change the Subtarget->isFPOnlySP()
to Subtarget->hasD16() to match the usage of .fpu directive.
This commit changes the test cases:
* Several .eabi_attribute directives in
2010-09-29-mc-asm-header-test.ll are removed because the .fpu
directive already cover the functionality.
* In the Cortex-A15 test case, the value for
Tag_Advanced_SIMD_arch has be changed from 1 to 2,
which is more precise.
llvm-svn: 193524
2013-10-29 01:51:12 +08:00
|
|
|
namespace llvm {
|
2013-05-04 07:57:17 +08:00
|
|
|
namespace ARMBuildAttrs {
|
[arm] Implement eabi_attribute, cpu, and fpu directives.
This commit allows the ARM integrated assembler to parse
and assemble the code with .eabi_attribute, .cpu, and
.fpu directives.
To implement the feature, this commit moves the code from
AttrEmitter to ARMTargetStreamers, and several new test
cases related to cortex-m4, cortex-r5, and cortex-a15 are
added.
Besides, this commit also change the Subtarget->isFPOnlySP()
to Subtarget->hasD16() to match the usage of .fpu directive.
This commit changes the test cases:
* Several .eabi_attribute directives in
2010-09-29-mc-asm-header-test.ll are removed because the .fpu
directive already cover the functionality.
* In the Cortex-A15 test case, the value for
Tag_Advanced_SIMD_arch has be changed from 1 to 2,
which is more precise.
llvm-svn: 193524
2013-10-29 01:51:12 +08:00
|
|
|
|
2013-05-04 07:57:17 +08:00
|
|
|
enum SpecialAttr {
|
|
|
|
// This is for the .cpu asm attr. It translates into one or more
|
|
|
|
// AttrType (below) entries in the .ARM.attributes section in the ELF.
|
[arm] Implement eabi_attribute, cpu, and fpu directives.
This commit allows the ARM integrated assembler to parse
and assemble the code with .eabi_attribute, .cpu, and
.fpu directives.
To implement the feature, this commit moves the code from
AttrEmitter to ARMTargetStreamers, and several new test
cases related to cortex-m4, cortex-r5, and cortex-a15 are
added.
Besides, this commit also change the Subtarget->isFPOnlySP()
to Subtarget->hasD16() to match the usage of .fpu directive.
This commit changes the test cases:
* Several .eabi_attribute directives in
2010-09-29-mc-asm-header-test.ll are removed because the .fpu
directive already cover the functionality.
* In the Cortex-A15 test case, the value for
Tag_Advanced_SIMD_arch has be changed from 1 to 2,
which is more precise.
llvm-svn: 193524
2013-10-29 01:51:12 +08:00
|
|
|
SEL_CPU
|
2013-05-04 07:57:17 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
enum AttrType {
|
|
|
|
// Rest correspond to ELF/.ARM.attributes
|
|
|
|
File = 1,
|
|
|
|
Section = 2,
|
|
|
|
Symbol = 3,
|
|
|
|
CPU_raw_name = 4,
|
|
|
|
CPU_name = 5,
|
|
|
|
CPU_arch = 6,
|
|
|
|
CPU_arch_profile = 7,
|
|
|
|
ARM_ISA_use = 8,
|
|
|
|
THUMB_ISA_use = 9,
|
|
|
|
VFP_arch = 10,
|
|
|
|
WMMX_arch = 11,
|
|
|
|
Advanced_SIMD_arch = 12,
|
|
|
|
PCS_config = 13,
|
|
|
|
ABI_PCS_R9_use = 14,
|
|
|
|
ABI_PCS_RW_data = 15,
|
|
|
|
ABI_PCS_RO_data = 16,
|
|
|
|
ABI_PCS_GOT_use = 17,
|
|
|
|
ABI_PCS_wchar_t = 18,
|
|
|
|
ABI_FP_rounding = 19,
|
|
|
|
ABI_FP_denormal = 20,
|
|
|
|
ABI_FP_exceptions = 21,
|
|
|
|
ABI_FP_user_exceptions = 22,
|
|
|
|
ABI_FP_number_model = 23,
|
|
|
|
ABI_align8_needed = 24,
|
|
|
|
ABI_align8_preserved = 25,
|
|
|
|
ABI_enum_size = 26,
|
|
|
|
ABI_HardFP_use = 27,
|
|
|
|
ABI_VFP_args = 28,
|
|
|
|
ABI_WMMX_args = 29,
|
|
|
|
ABI_optimization_goals = 30,
|
|
|
|
ABI_FP_optimization_goals = 31,
|
|
|
|
compatibility = 32,
|
|
|
|
CPU_unaligned_access = 34,
|
|
|
|
VFP_HP_extension = 36,
|
|
|
|
ABI_FP_16bit_format = 38,
|
|
|
|
MPextension_use = 42, // was 70, 2.08 ABI
|
|
|
|
DIV_use = 44,
|
|
|
|
nodefaults = 64,
|
|
|
|
also_compatible_with = 65,
|
|
|
|
T2EE_use = 66,
|
|
|
|
conformance = 67,
|
|
|
|
Virtualization_use = 68,
|
|
|
|
MPextension_use_old = 70
|
|
|
|
};
|
|
|
|
|
|
|
|
// Magic numbers for .ARM.attributes
|
|
|
|
enum AttrMagic {
|
|
|
|
Format_Version = 0x41
|
|
|
|
};
|
|
|
|
|
|
|
|
// Legal Values for CPU_arch, (=6), uleb128
|
|
|
|
enum CPUArch {
|
|
|
|
Pre_v4 = 0,
|
|
|
|
v4 = 1, // e.g. SA110
|
|
|
|
v4T = 2, // e.g. ARM7TDMI
|
|
|
|
v5T = 3, // e.g. ARM9TDMI
|
|
|
|
v5TE = 4, // e.g. ARM946E_S
|
|
|
|
v5TEJ = 5, // e.g. ARM926EJ_S
|
|
|
|
v6 = 6, // e.g. ARM1136J_S
|
|
|
|
v6KZ = 7, // e.g. ARM1176JZ_S
|
|
|
|
v6T2 = 8, // e.g. ARM1156T2F_S
|
|
|
|
v6K = 9, // e.g. ARM1136J_S
|
|
|
|
v7 = 10, // e.g. Cortex A8, Cortex M3
|
|
|
|
v6_M = 11, // e.g. Cortex M1
|
|
|
|
v6S_M = 12, // v6_M with the System extensions
|
2013-06-27 00:58:26 +08:00
|
|
|
v7E_M = 13, // v7_M with DSP extensions
|
|
|
|
v8 = 14 // v8, AArch32
|
2013-05-04 07:57:17 +08:00
|
|
|
};
|
|
|
|
|
[arm] Implement eabi_attribute, cpu, and fpu directives.
This commit allows the ARM integrated assembler to parse
and assemble the code with .eabi_attribute, .cpu, and
.fpu directives.
To implement the feature, this commit moves the code from
AttrEmitter to ARMTargetStreamers, and several new test
cases related to cortex-m4, cortex-r5, and cortex-a15 are
added.
Besides, this commit also change the Subtarget->isFPOnlySP()
to Subtarget->hasD16() to match the usage of .fpu directive.
This commit changes the test cases:
* Several .eabi_attribute directives in
2010-09-29-mc-asm-header-test.ll are removed because the .fpu
directive already cover the functionality.
* In the Cortex-A15 test case, the value for
Tag_Advanced_SIMD_arch has be changed from 1 to 2,
which is more precise.
llvm-svn: 193524
2013-10-29 01:51:12 +08:00
|
|
|
enum CPUArchProfile { // (=7), uleb128
|
2013-05-04 07:57:17 +08:00
|
|
|
Not_Applicable = 0, // pre v7, or cross-profile code
|
|
|
|
ApplicationProfile = (0x41), // 'A' (e.g. for Cortex A8)
|
|
|
|
RealTimeProfile = (0x52), // 'R' (e.g. for Cortex R4)
|
|
|
|
MicroControllerProfile = (0x4D), // 'M' (e.g. for Cortex M3)
|
|
|
|
SystemProfile = (0x53) // 'S' Application or real-time profile
|
|
|
|
};
|
|
|
|
|
|
|
|
// The following have a lot of common use cases
|
[arm] Implement eabi_attribute, cpu, and fpu directives.
This commit allows the ARM integrated assembler to parse
and assemble the code with .eabi_attribute, .cpu, and
.fpu directives.
To implement the feature, this commit moves the code from
AttrEmitter to ARMTargetStreamers, and several new test
cases related to cortex-m4, cortex-r5, and cortex-a15 are
added.
Besides, this commit also change the Subtarget->isFPOnlySP()
to Subtarget->hasD16() to match the usage of .fpu directive.
This commit changes the test cases:
* Several .eabi_attribute directives in
2010-09-29-mc-asm-header-test.ll are removed because the .fpu
directive already cover the functionality.
* In the Cortex-A15 test case, the value for
Tag_Advanced_SIMD_arch has be changed from 1 to 2,
which is more precise.
llvm-svn: 193524
2013-10-29 01:51:12 +08:00
|
|
|
enum {
|
2013-05-04 07:57:17 +08:00
|
|
|
//ARMISAUse (=8), uleb128 and THUMBISAUse (=9), uleb128
|
|
|
|
Not_Allowed = 0,
|
|
|
|
Allowed = 1,
|
|
|
|
|
|
|
|
// FP_arch (=10), uleb128 (formerly Tag_VFP_arch = 10)
|
|
|
|
AllowFPv2 = 2, // v2 FP ISA permitted (implies use of the v1 FP ISA)
|
|
|
|
AllowFPv3A = 3, // v3 FP ISA permitted (implies use of the v2 FP ISA)
|
[arm] Implement eabi_attribute, cpu, and fpu directives.
This commit allows the ARM integrated assembler to parse
and assemble the code with .eabi_attribute, .cpu, and
.fpu directives.
To implement the feature, this commit moves the code from
AttrEmitter to ARMTargetStreamers, and several new test
cases related to cortex-m4, cortex-r5, and cortex-a15 are
added.
Besides, this commit also change the Subtarget->isFPOnlySP()
to Subtarget->hasD16() to match the usage of .fpu directive.
This commit changes the test cases:
* Several .eabi_attribute directives in
2010-09-29-mc-asm-header-test.ll are removed because the .fpu
directive already cover the functionality.
* In the Cortex-A15 test case, the value for
Tag_Advanced_SIMD_arch has be changed from 1 to 2,
which is more precise.
llvm-svn: 193524
2013-10-29 01:51:12 +08:00
|
|
|
AllowFPv3B = 4, // v3 FP ISA permitted, but only D0-D15, S0-S31
|
|
|
|
AllowFPv4A = 5, // v4 FP ISA permitted (implies use of v3 FP ISA)
|
2013-05-04 07:57:17 +08:00
|
|
|
AllowFPv4B = 6, // v4 FP ISA was permitted, but only D0-D15, S0-S31
|
2013-09-13 21:46:57 +08:00
|
|
|
AllowFPARMv8A = 7, // Use of the ARM v8-A FP ISA was permitted
|
|
|
|
AllowFPARMv8B = 8, // Use of the ARM v8-A FP ISA was permitted, but only D0-D15, S0-S31
|
2013-05-04 07:57:17 +08:00
|
|
|
|
|
|
|
// Tag_WMMX_arch, (=11), uleb128
|
|
|
|
AllowThumb32 = 2, // 32-bit Thumb (implies 16-bit instructions)
|
[arm] Implement eabi_attribute, cpu, and fpu directives.
This commit allows the ARM integrated assembler to parse
and assemble the code with .eabi_attribute, .cpu, and
.fpu directives.
To implement the feature, this commit moves the code from
AttrEmitter to ARMTargetStreamers, and several new test
cases related to cortex-m4, cortex-r5, and cortex-a15 are
added.
Besides, this commit also change the Subtarget->isFPOnlySP()
to Subtarget->hasD16() to match the usage of .fpu directive.
This commit changes the test cases:
* Several .eabi_attribute directives in
2010-09-29-mc-asm-header-test.ll are removed because the .fpu
directive already cover the functionality.
* In the Cortex-A15 test case, the value for
Tag_Advanced_SIMD_arch has be changed from 1 to 2,
which is more precise.
llvm-svn: 193524
2013-10-29 01:51:12 +08:00
|
|
|
|
2013-05-04 07:57:17 +08:00
|
|
|
// Tag_WMMX_arch, (=11), uleb128
|
|
|
|
AllowWMMXv1 = 2, // The user permitted this entity to use WMMX v2
|
|
|
|
|
[arm] Implement eabi_attribute, cpu, and fpu directives.
This commit allows the ARM integrated assembler to parse
and assemble the code with .eabi_attribute, .cpu, and
.fpu directives.
To implement the feature, this commit moves the code from
AttrEmitter to ARMTargetStreamers, and several new test
cases related to cortex-m4, cortex-r5, and cortex-a15 are
added.
Besides, this commit also change the Subtarget->isFPOnlySP()
to Subtarget->hasD16() to match the usage of .fpu directive.
This commit changes the test cases:
* Several .eabi_attribute directives in
2010-09-29-mc-asm-header-test.ll are removed because the .fpu
directive already cover the functionality.
* In the Cortex-A15 test case, the value for
Tag_Advanced_SIMD_arch has be changed from 1 to 2,
which is more precise.
llvm-svn: 193524
2013-10-29 01:51:12 +08:00
|
|
|
// Tag_Advanced_SIMD_arch, (=12), uleb128
|
|
|
|
AllowNeon = 1, // SIMDv1 was permitted
|
|
|
|
AllowNeon2 = 2, // SIMDv2 was permitted (Half-precision FP, MAC operations)
|
|
|
|
AllowNeonARMv8 = 3, // ARM v8-A SIMD was permitted
|
|
|
|
|
|
|
|
// Tag_ABI_FP_denormal, (=20), uleb128
|
2013-05-04 07:57:17 +08:00
|
|
|
PreserveFPSign = 2, // sign when flushed-to-zero is preserved
|
|
|
|
|
|
|
|
// Tag_ABI_FP_number_model, (=23), uleb128
|
|
|
|
AllowRTABI = 2, // numbers, infinities, and one quiet NaN (see [RTABI])
|
2013-10-08 00:55:23 +08:00
|
|
|
AllowIEE754 = 3, // this code to use all the IEEE 754-defined FP encodings
|
|
|
|
|
[arm] Implement eabi_attribute, cpu, and fpu directives.
This commit allows the ARM integrated assembler to parse
and assemble the code with .eabi_attribute, .cpu, and
.fpu directives.
To implement the feature, this commit moves the code from
AttrEmitter to ARMTargetStreamers, and several new test
cases related to cortex-m4, cortex-r5, and cortex-a15 are
added.
Besides, this commit also change the Subtarget->isFPOnlySP()
to Subtarget->hasD16() to match the usage of .fpu directive.
This commit changes the test cases:
* Several .eabi_attribute directives in
2010-09-29-mc-asm-header-test.ll are removed because the .fpu
directive already cover the functionality.
* In the Cortex-A15 test case, the value for
Tag_Advanced_SIMD_arch has be changed from 1 to 2,
which is more precise.
llvm-svn: 193524
2013-10-29 01:51:12 +08:00
|
|
|
// Tag_ABI_HardFP_use, (=27), uleb128
|
|
|
|
HardFPSinglePrecision = 1, // Single-precision only
|
|
|
|
HardFPImplied = 3, // FP use should be implied by Tag_FP_arch
|
|
|
|
|
2013-10-08 00:55:23 +08:00
|
|
|
// Tag_DIV_use, (=44), uleb128
|
|
|
|
AllowDIVIfExists = 0, // Allow hardware divide if available in arch, or no info exists.
|
|
|
|
DisallowDIV = 1, // Hardware divide explicitly disallowed
|
|
|
|
AllowDIVExt = 2 // Allow hardware divide as optional architecture extension above
|
|
|
|
// the base arch specified by Tag_CPU_arch and Tag_CPU_arch_profile.
|
2013-05-04 07:57:17 +08:00
|
|
|
};
|
[arm] Implement eabi_attribute, cpu, and fpu directives.
This commit allows the ARM integrated assembler to parse
and assemble the code with .eabi_attribute, .cpu, and
.fpu directives.
To implement the feature, this commit moves the code from
AttrEmitter to ARMTargetStreamers, and several new test
cases related to cortex-m4, cortex-r5, and cortex-a15 are
added.
Besides, this commit also change the Subtarget->isFPOnlySP()
to Subtarget->hasD16() to match the usage of .fpu directive.
This commit changes the test cases:
* Several .eabi_attribute directives in
2010-09-29-mc-asm-header-test.ll are removed because the .fpu
directive already cover the functionality.
* In the Cortex-A15 test case, the value for
Tag_Advanced_SIMD_arch has be changed from 1 to 2,
which is more precise.
llvm-svn: 193524
2013-10-29 01:51:12 +08:00
|
|
|
|
|
|
|
} // namespace ARMBuildAttrs
|
|
|
|
} // namespace llvm
|
2013-05-04 07:57:17 +08:00
|
|
|
|
|
|
|
#endif // __TARGET_ARMBUILDATTRS_H__
|