[PATCH 1/57][Arm][GAS]: Add support for +mve and +mve.fp
authorAndre Vieira <andre.simoesdiasvieira@arm.com>
Wed, 15 May 2019 15:44:57 +0000 (16:44 +0100)
committerAndre Vieira <andre.simoesdiasvieira@arm.com>
Thu, 16 May 2019 15:17:21 +0000 (16:17 +0100)
bfd/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>

* elf32-arm.c (elf32_arm_merge_eabi_attributes): Add case for Tag_MVE_arch.

binutils/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>

* 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  <andre.simoesdiasvieira@arm.com>

* arm.h (Tag_MVE_arch): Define new enum value.

gas/ChangeLog:
2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>

* 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  <andre.simoesdiasvieira@arm.com>

* elf/arm.h (Tag_MVE_arch): Define new enum value.
* opcode/arm.h (FPU_MVE, FPU_MVE_FP): New MACROs for new features.

12 files changed:
bfd/ChangeLog
bfd/elf32-arm.c
binutils/ChangeLog
binutils/readelf.c
elfcpp/ChangeLog
elfcpp/arm.h
gas/ChangeLog
gas/config/tc-arm.c
gas/doc/c-arm.texi
include/ChangeLog
include/elf/arm.h
include/opcode/arm.h

index e3729bbf1f007f5adcab0f7e2f6abd3be2804f8a..9b33ac529417cb9a6875534169d01c84d73dcfbe 100644 (file)
@@ -1,3 +1,7 @@
+2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
+
+       * elf32-arm.c (elf32_arm_merge_eabi_attributes): Add case for Tag_MVE_arch.
+
 2019-05-16  Alan Modra  <amodra@gmail.com>
 
        * elf32-arm.c (elf32_arm_write_section): Revert last change.
index 337961d26e16c6458f41d54b2e8dbe6891a5017c..418458c366572ce9696b5b010998e8fca64f51e3 100644 (file)
@@ -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;
index 2783e58913c67ab75031ada3ac3b01fa100bee82..dd5066b7a9057c8ca450a48d2ed3f7df4e689787 100644 (file)
@@ -1,3 +1,8 @@
+2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
+
+       * 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  <jamey.hicks@gmail.com>
 
        PR 19921
index 1ea4cef15896543b0b114bbd597136d335b8049d..c31a5c1266b7bb62a485895b01b49e1f832ade35 100644 (file)
@@ -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),
index aa8aa74822d2d4e93e47214e532735b546dc4006..fbb045be656fe571e3580b9c11671650bcda23ca 100644 (file)
@@ -1,3 +1,7 @@
+2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
+
+       * arm.h (Tag_MVE_arch): Define new enum value.
+
 2019-04-15  Sudakshina Das  <sudi.das@arm.com>
 
        * arm.h (R_ARM_THM_BF12): New relocation code.
index 19048658ece500ef4406972a453d79d283a4e805..aa573440c28035701b5ea0c265de38b800c63fa0 100644 (file)
@@ -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,
index 874401416ddfe295254a6e53294afa2f9f2a81e3..853d46fb91ee8d37ba71a1758747b36d73601c41 100644 (file)
@@ -1,3 +1,11 @@
+2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
+
+       * 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 <john@darrington.wattle.id.au>
 
        * config/tc-s12z.c (register_prefix): New variable.  (md_show_usage,
index 2ec3ea04465c37b7dc3e55a63d0dc1a6b626ecb7..d68e3e05d3ea1855408292076e263a21342f3328 100644 (file)
@@ -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
     };
index 4c595d8bf0ee7a3b0ff77e1ddc6ab073c5c3e589..d35a34df47e197d9f836cc1da76c89b230a741dd 100644 (file)
@@ -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},
index be6240e883ddd992d3611c07c5d463256ae902d0..96fd26640fc5ac95d6df0f619942d800d0261604 100644 (file)
@@ -1,3 +1,8 @@
+2019-05-16  Andre Vieira  <andre.simoesdiasvieira@arm.com>
+
+       * 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  <matthew.malcomson@arm.com>
 
        * opcode/aarch64.h (enum aarch64_opnd): New SVE_SHLIMM_UNPRED_22
index 9f22ffed2b5c664c72ff53fafdf9c074d1e126b9..5cb99706443838cd2d43accab9e713d53304bd00 100644 (file)
@@ -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,
index 73fb2e3f43c5fd2d77dc796b7decb329c5a8a57f..a870905907b38f001812f460e3cd816e9675f851 100644 (file)
 #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,