From a7ad558c377fd5f5cc7bc77837c532f907f2c53b Mon Sep 17 00:00:00 2001 From: Andre Vieira Date: Wed, 15 May 2019 16:44:57 +0100 Subject: [PATCH] [PATCH 1/57][Arm][GAS]: Add support for +mve and +mve.fp bfd/ChangeLog: 2019-05-16 Andre Vieira * elf32-arm.c (elf32_arm_merge_eabi_attributes): Add case for Tag_MVE_arch. binutils/ChangeLog: 2019-05-16 Andre Vieira * readelf.c (arm_attr_tag_MVE_arch): New array for Tag_MVE_arch values. (arm_attr_public_tag arm_attr_public_tags): Add case for Tag_MVE_arch. elfcpp/ChangeLog: 2019-05-16 Andre Vieira * arm.h (Tag_MVE_arch): Define new enum value. gas/ChangeLog: 2019-05-16 Andre Vieira * config/tc-arm.c (mve_ext, mve_fp_ext): New features. (armv8_1m_main_ext_table): Add new extensions. (aeabi_set_public_attributes): Translate new features to new build attributes. (arm_convert_symbolic_attribute): Add Tag_MVE_arch. * doc/c-arm.texi: Document new extensions and new build attribute. include/ChangeLog: 2019-05-16 Andre Vieira * elf/arm.h (Tag_MVE_arch): Define new enum value. * opcode/arm.h (FPU_MVE, FPU_MVE_FP): New MACROs for new features. --- bfd/ChangeLog | 4 ++++ bfd/elf32-arm.c | 1 + binutils/ChangeLog | 5 +++++ binutils/readelf.c | 4 ++++ elfcpp/ChangeLog | 4 ++++ elfcpp/arm.h | 1 + gas/ChangeLog | 8 ++++++++ gas/config/tc-arm.c | 16 ++++++++++++++++ gas/doc/c-arm.texi | 7 ++++++- include/ChangeLog | 5 +++++ include/elf/arm.h | 1 + include/opcode/arm.h | 2 ++ 12 files changed, 57 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index e3729bbf1f..9b33ac5294 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,7 @@ +2019-05-16 Andre Vieira + + * elf32-arm.c (elf32_arm_merge_eabi_attributes): Add case for Tag_MVE_arch. + 2019-05-16 Alan Modra * elf32-arm.c (elf32_arm_write_section): Revert last change. diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 337961d26e..418458c366 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -14713,6 +14713,7 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, struct bfd_link_info *info) case Tag_CPU_unaligned_access: case Tag_T2EE_use: case Tag_MPextension_use: + case Tag_MVE_arch: /* Use the largest value specified. */ if (in_attr[i].i > out_attr[i].i) out_attr[i].i = in_attr[i].i; diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 2783e58913..dd5066b7a9 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2019-05-16 Andre Vieira + + * readelf.c (arm_attr_tag_MVE_arch): New array for Tag_MVE_arch values. + (arm_attr_public_tag arm_attr_public_tags): Add case for Tag_MVE_arch. + 2019-05-14 Jamey Hicks PR 19921 diff --git a/binutils/readelf.c b/binutils/readelf.c index 1ea4cef158..c31a5c1266 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -14434,6 +14434,9 @@ static const char * arm_attr_tag_Virtualization_use[] = static const char * arm_attr_tag_MPextension_use_legacy[] = {"Not Allowed", "Allowed"}; +static const char * arm_attr_tag_MVE_arch[] = + {"No MVE", "MVE Integer only", "MVE Integer and FP"}; + #define LOOKUP(id, name) \ {id, #name, 0x80 | ARRAY_SIZE(arm_attr_tag_##name), arm_attr_tag_##name} static arm_attr_public_tag arm_attr_public_tags[] = @@ -14473,6 +14476,7 @@ static arm_attr_public_tag arm_attr_public_tags[] = LOOKUP(42, MPextension_use), LOOKUP(44, DIV_use), LOOKUP(46, DSP_extension), + LOOKUP(48, MVE_arch), {64, "nodefaults", 0, NULL}, {65, "also_compatible_with", 0, NULL}, LOOKUP(66, T2EE_use), diff --git a/elfcpp/ChangeLog b/elfcpp/ChangeLog index aa8aa74822..fbb045be65 100644 --- a/elfcpp/ChangeLog +++ b/elfcpp/ChangeLog @@ -1,3 +1,7 @@ +2019-05-16 Andre Vieira + + * arm.h (Tag_MVE_arch): Define new enum value. + 2019-04-15 Sudakshina Das * arm.h (R_ARM_THM_BF12): New relocation code. diff --git a/elfcpp/arm.h b/elfcpp/arm.h index 19048658ec..aa573440c2 100644 --- a/elfcpp/arm.h +++ b/elfcpp/arm.h @@ -305,6 +305,7 @@ enum Tag_MPextension_use = 42, Tag_undefined43 = 43, Tag_DIV_use = 44, + Tag_MVE_arch = 48, Tag_nodefaults = 64, Tag_also_compatible_with = 65, Tag_T2EE_use = 66, diff --git a/gas/ChangeLog b/gas/ChangeLog index 874401416d..853d46fb91 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,11 @@ +2019-05-16 Andre Vieira + + * config/tc-arm.c (mve_ext, mve_fp_ext): New features. + (armv8_1m_main_ext_table): Add new extensions. + (aeabi_set_public_attributes): Translate new features to new build attributes. + (arm_convert_symbolic_attribute): Add Tag_MVE_arch. + * doc/c-arm.texi: Document new extensions and new build attribute. + 2019-05-15 John Darrington * config/tc-s12z.c (register_prefix): New variable. (md_show_usage, diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 2ec3ea0446..d68e3e05d3 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -302,6 +302,10 @@ static const arm_feature_set fpu_neon_ext_v1 = ARM_FEATURE_COPROC (FPU_NEON_EXT_V1); static const arm_feature_set fpu_vfp_v3_or_neon_ext = ARM_FEATURE_COPROC (FPU_NEON_EXT_V1 | FPU_VFP_EXT_V3); +static const arm_feature_set mve_ext = + ARM_FEATURE_COPROC (FPU_MVE); +static const arm_feature_set mve_fp_ext = + ARM_FEATURE_COPROC (FPU_MVE_FP); #ifdef OBJ_ELF static const arm_feature_set fpu_vfp_fp16 = ARM_FEATURE_COPROC (FPU_VFP_EXT_FP16); @@ -27248,6 +27252,12 @@ static const struct arm_ext_table armv8_1m_main_ext_table[] = ARM_ADD ("fp.dp", ARM_FEATURE (0, ARM_EXT2_FP16_INST, FPU_VFP_V5D16 | FPU_VFP_EXT_FP16 | FPU_VFP_EXT_FMA)), + ARM_EXT ("mve", ARM_FEATURE_COPROC (FPU_MVE), + ARM_FEATURE_COPROC (FPU_MVE | FPU_MVE_FP)), + ARM_ADD ("mve.fp", + ARM_FEATURE (0, ARM_EXT2_FP16_INST, + FPU_MVE | FPU_MVE_FP | FPU_VFP_V5_SP_D16 | + FPU_VFP_EXT_FP16 | FPU_VFP_EXT_FMA)), { NULL, 0, ARM_ARCH_NONE, ARM_ARCH_NONE } }; @@ -28425,6 +28435,11 @@ aeabi_set_public_attributes (void) } } + if (ARM_CPU_HAS_FEATURE (flags, mve_fp_ext)) + aeabi_set_attribute_int (Tag_MVE_arch, 2); + else if (ARM_CPU_HAS_FEATURE (flags, mve_ext)) + aeabi_set_attribute_int (Tag_MVE_arch, 1); + /* Tag_VFP_HP_extension (formerly Tag_NEON_FP16_arch). */ if (ARM_CPU_HAS_FEATURE (flags, fpu_vfp_fp16) && fp16_optional) aeabi_set_attribute_int (Tag_VFP_HP_extension, 1); @@ -28766,6 +28781,7 @@ arm_convert_symbolic_attribute (const char *name) T (Tag_T2EE_use), T (Tag_Virtualization_use), T (Tag_DSP_extension), + T (Tag_MVE_arch), /* We deliberately do not include Tag_MPextension_use_legacy. */ #undef T }; diff --git a/gas/doc/c-arm.texi b/gas/doc/c-arm.texi index 4c595d8bf0..d35a34df47 100644 --- a/gas/doc/c-arm.texi +++ b/gas/doc/c-arm.texi @@ -363,8 +363,13 @@ For @code{armv8.1-m.main}: for Armv8.1-M Mainline with 16 double-word registers. @code{+fp.dp}: Enables double precision scalar Floating Point Extensions for Armv8.1-M Mainline, implies @code{+fp}. +@code{+mve}: Enables integer only M-profile Vector Extension for +Armv8.1-M Mainline, implies @code{+dsp}. +@code{+mve.fp}: Enables Floating Point M-profile Vector Extension for +Armv8.1-M Mainline, implies @code{+mve} and @code{+fp}. @code{+nofp}: Disables all FPU instructions. @code{+nodsp}: Disables DSP Extension. +@code{+nomve}: Disables all M-profile Vector Extensions. For @code{armv8-a}: @@ -891,7 +896,7 @@ The @var{tag} is either an attribute number, or one of the following: @code{Tag_CPU_raw_name}, @code{Tag_CPU_name}, @code{Tag_CPU_arch}, @code{Tag_CPU_arch_profile}, @code{Tag_ARM_ISA_use}, @code{Tag_THUMB_ISA_use}, @code{Tag_FP_arch}, @code{Tag_WMMX_arch}, -@code{Tag_Advanced_SIMD_arch}, @code{Tag_PCS_config}, +@code{Tag_Advanced_SIMD_arch}, @code{Tag_MVE_arch}, @code{Tag_PCS_config}, @code{Tag_ABI_PCS_R9_use}, @code{Tag_ABI_PCS_RW_data}, @code{Tag_ABI_PCS_RO_data}, @code{Tag_ABI_PCS_GOT_use}, @code{Tag_ABI_PCS_wchar_t}, @code{Tag_ABI_FP_rounding}, diff --git a/include/ChangeLog b/include/ChangeLog index be6240e883..96fd26640f 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,8 @@ +2019-05-16 Andre Vieira + + * elf/arm.h (Tag_MVE_arch): Define new enum value. + * opcode/arm.h (FPU_MVE, FPU_MVE_FP): New MACROs for new features. + 2019-05-09 Matthew Malcomson * opcode/aarch64.h (enum aarch64_opnd): New SVE_SHLIMM_UNPRED_22 diff --git a/include/elf/arm.h b/include/elf/arm.h index 9f22ffed2b..5cb9970644 100644 --- a/include/elf/arm.h +++ b/include/elf/arm.h @@ -326,6 +326,7 @@ enum Tag_undefined_43, Tag_DIV_use, Tag_DSP_extension = 46, + Tag_MVE_arch = 48, Tag_nodefaults = 64, Tag_also_compatible_with, Tag_T2EE_use, diff --git a/include/opcode/arm.h b/include/opcode/arm.h index 73fb2e3f43..a870905907 100644 --- a/include/opcode/arm.h +++ b/include/opcode/arm.h @@ -103,6 +103,8 @@ #define FPU_VFP_EXT_ARMV8xD 0x00002000 /* Single-precision FP for ARMv8. */ #define FPU_NEON_EXT_RDMA 0x00001000 /* v8.1 Adv.SIMD extensions. */ #define FPU_NEON_EXT_DOTPROD 0x00000800 /* Dot Product extension. */ +#define FPU_MVE 0x00000400 /* MVE Integer extension. */ +#define FPU_MVE_FP 0x00000200 /* MVE Floating Point extension. */ /* Architectures are the sum of the base and extensions. The ARM ARM (rev E) defines the following: ARMv3, ARMv3M, ARMv4xM, ARMv4, ARMv4TxM, ARMv4T,