From 164446e04c89c7f5d8fd3efd7874a1af01035d72 Mon Sep 17 00:00:00 2001 From: Alexander Fedotov Date: Tue, 19 May 2020 12:45:42 +0100 Subject: [PATCH] Fix the ARM assembler to generate a Realtime profile for armv8-r. PR 25992 gas * config/tc-arm.c : Add arm_ext_v8r feature. (it_fsm_post_encode): Check arm_ext_v8r feature. (get_aeabi_cpu_arch_from_fset): Check arm_ext_v8r feature. include * opcode/arm.h (ARM_EXT2_V8R): Define. Modified ARM_AEXT2_V8R. --- gas/ChangeLog | 7 +++++++ gas/config/tc-arm.c | 16 ++++++++++------ .../gas/arm/attr-march-armv8-r+crypto.d | 2 +- gas/testsuite/gas/arm/attr-march-armv8-r+fp.d | 2 +- gas/testsuite/gas/arm/attr-march-armv8-r+simd.d | 2 +- gas/testsuite/gas/arm/attr-march-armv8-r.d | 2 +- include/ChangeLog | 5 +++++ include/opcode/arm.h | 3 ++- 8 files changed, 28 insertions(+), 11 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 05f5f2385cc..67f6174c27e 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2020-05-19 Alexander Fedotov + + PR 25992 + * config/tc-arm.c : Add arm_ext_v8r feature. + (it_fsm_post_encode): Check arm_ext_v8r feature. + (get_aeabi_cpu_arch_from_fset): Check arm_ext_v8r feature. + 2020-05-19 Alan Modra * write.c (write_contents): Use bfd_get_filename rather than diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 12ca245cbc7..bc0b3a4f6f5 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -230,6 +230,7 @@ static const arm_feature_set arm_ext_div = ARM_FEATURE_CORE_LOW (ARM_EXT_DIV); static const arm_feature_set arm_ext_v7 = ARM_FEATURE_CORE_LOW (ARM_EXT_V7); static const arm_feature_set arm_ext_v7a = ARM_FEATURE_CORE_LOW (ARM_EXT_V7A); static const arm_feature_set arm_ext_v7r = ARM_FEATURE_CORE_LOW (ARM_EXT_V7R); +static const arm_feature_set arm_ext_v8r = ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8R); #ifdef OBJ_ELF static const arm_feature_set ATTRIBUTE_UNUSED arm_ext_v7m = ARM_FEATURE_CORE_LOW (ARM_EXT_V7M); #endif @@ -23298,7 +23299,8 @@ it_fsm_post_encode (void) && warn_on_restrict_it && !now_pred.warn_deprecated && warn_on_deprecated - && ARM_CPU_HAS_FEATURE (cpu_variant, arm_ext_v8) + && (ARM_CPU_HAS_FEATURE (cpu_variant, arm_ext_v8) + || ARM_CPU_HAS_FEATURE (cpu_variant, arm_ext_v8r)) && !ARM_CPU_HAS_FEATURE (cpu_variant, arm_ext_m)) { if (inst.instruction >= 0x10000) @@ -32878,12 +32880,14 @@ get_aeabi_cpu_arch_from_fset (const arm_feature_set *arch_ext_fset, found: /* Tag_CPU_arch_profile. */ - if (ARM_CPU_HAS_FEATURE (p_ver_ret->flags, arm_ext_v7a) - || ARM_CPU_HAS_FEATURE (p_ver_ret->flags, arm_ext_v8) - || (ARM_CPU_HAS_FEATURE (p_ver_ret->flags, arm_ext_atomics) - && !ARM_CPU_HAS_FEATURE (p_ver_ret->flags, arm_ext_v8m_m_only))) + if (!ARM_CPU_HAS_FEATURE (p_ver_ret->flags, arm_ext_v8r) + && (ARM_CPU_HAS_FEATURE (p_ver_ret->flags, arm_ext_v7a) + || ARM_CPU_HAS_FEATURE (p_ver_ret->flags, arm_ext_v8) + || (ARM_CPU_HAS_FEATURE (p_ver_ret->flags, arm_ext_atomics) + && !ARM_CPU_HAS_FEATURE (p_ver_ret->flags, arm_ext_v8m_m_only)))) *profile = 'A'; - else if (ARM_CPU_HAS_FEATURE (p_ver_ret->flags, arm_ext_v7r)) + else if (ARM_CPU_HAS_FEATURE (p_ver_ret->flags, arm_ext_v7r) + || ARM_CPU_HAS_FEATURE (p_ver_ret->flags, arm_ext_v8r)) *profile = 'R'; else if (ARM_CPU_HAS_FEATURE (p_ver_ret->flags, arm_ext_m)) *profile = 'M'; diff --git a/gas/testsuite/gas/arm/attr-march-armv8-r+crypto.d b/gas/testsuite/gas/arm/attr-march-armv8-r+crypto.d index e2d83a0dbe9..5bd0fc5f371 100644 --- a/gas/testsuite/gas/arm/attr-march-armv8-r+crypto.d +++ b/gas/testsuite/gas/arm/attr-march-armv8-r+crypto.d @@ -9,7 +9,7 @@ Attribute Section: aeabi File Attributes Tag_CPU_name: "8-R" Tag_CPU_arch: v8-R - Tag_CPU_arch_profile: Application + Tag_CPU_arch_profile: Realtime Tag_ARM_ISA_use: Yes Tag_THUMB_ISA_use: Thumb-2 Tag_FP_arch: FP for ARMv8 diff --git a/gas/testsuite/gas/arm/attr-march-armv8-r+fp.d b/gas/testsuite/gas/arm/attr-march-armv8-r+fp.d index e7a8446f9d2..afd5a756d02 100644 --- a/gas/testsuite/gas/arm/attr-march-armv8-r+fp.d +++ b/gas/testsuite/gas/arm/attr-march-armv8-r+fp.d @@ -9,7 +9,7 @@ Attribute Section: aeabi File Attributes Tag_CPU_name: "8-R" Tag_CPU_arch: v8-R - Tag_CPU_arch_profile: Application + Tag_CPU_arch_profile: Realtime Tag_ARM_ISA_use: Yes Tag_THUMB_ISA_use: Thumb-2 Tag_FP_arch: FP for ARMv8 diff --git a/gas/testsuite/gas/arm/attr-march-armv8-r+simd.d b/gas/testsuite/gas/arm/attr-march-armv8-r+simd.d index e09091cb220..8c8578a78f1 100644 --- a/gas/testsuite/gas/arm/attr-march-armv8-r+simd.d +++ b/gas/testsuite/gas/arm/attr-march-armv8-r+simd.d @@ -9,7 +9,7 @@ Attribute Section: aeabi File Attributes Tag_CPU_name: "8-R" Tag_CPU_arch: v8-R - Tag_CPU_arch_profile: Application + Tag_CPU_arch_profile: Realtime Tag_ARM_ISA_use: Yes Tag_THUMB_ISA_use: Thumb-2 Tag_FP_arch: FP for ARMv8 diff --git a/gas/testsuite/gas/arm/attr-march-armv8-r.d b/gas/testsuite/gas/arm/attr-march-armv8-r.d index 820f32beeaf..cf4b3a51f80 100644 --- a/gas/testsuite/gas/arm/attr-march-armv8-r.d +++ b/gas/testsuite/gas/arm/attr-march-armv8-r.d @@ -9,7 +9,7 @@ Attribute Section: aeabi File Attributes Tag_CPU_name: "8-R" Tag_CPU_arch: v8-R - Tag_CPU_arch_profile: Application + Tag_CPU_arch_profile: Realtime Tag_ARM_ISA_use: Yes Tag_THUMB_ISA_use: Thumb-2 Tag_MPextension_use: Allowed diff --git a/include/ChangeLog b/include/ChangeLog index c14cea3bfe1..9f2599f81c4 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,8 @@ +2020-05-19 Alexander Fedotov + + PR 25992 + * opcode/arm.h (ARM_EXT2_V8R): Define. Modified ARM_AEXT2_V8R. + 2020-05-11 Alan Modra * opcode/ppc.h (PPC_OPERAND_ACC): Define. Renumber following diff --git a/include/opcode/arm.h b/include/opcode/arm.h index 979bd208858..834edf0a244 100644 --- a/include/opcode/arm.h +++ b/include/opcode/arm.h @@ -88,6 +88,7 @@ #define ARM_EXT2_CDE5 0x10000000 /* Using CDE coproc 5. */ #define ARM_EXT2_CDE6 0x20000000 /* Using CDE coproc 6. */ #define ARM_EXT2_CDE7 0x40000000 /* Using CDE coproc 7. */ +#define ARM_EXT2_V8R 0x80000000 /* Arm V8R. */ /* Co-processor space extensions. */ #define ARM_CEXT_XSCALE 0x00000001 /* Allow MIA etc. */ @@ -191,7 +192,7 @@ #define ARM_AEXT2_V8M_MAIN (ARM_AEXT2_V8M_BASE | ARM_EXT2_V8M_MAIN) #define ARM_AEXT2_V8M_MAIN_DSP ARM_AEXT2_V8M_MAIN #define ARM_AEXT_V8R ARM_AEXT_V8A -#define ARM_AEXT2_V8R ARM_AEXT2_V8AR +#define ARM_AEXT2_V8R (ARM_EXT2_V8R | ARM_AEXT2_V8AR) #define ARM_AEXT_V8_1M_MAIN ARM_AEXT_V8M_MAIN #define ARM_AEXT2_V8_1M_MAIN (ARM_AEXT2_V8M_MAIN | ARM_EXT2_V8_1M_MAIN \ | ARM_EXT2_FP16_INST) -- 2.30.2