[PATCH 2/2][GCC] arm: Declare MVE types internally via pragma

Richard Earnshaw Richard.Earnshaw@foss.arm.com
Thu Nov 18 15:45:11 GMT 2021



On 16/11/2021 10:15, Murray Steele via Gcc-patches wrote:
> Hi all,
> 
> This patch moves the implementation of MVE ACLE types from
> arm_mve_types.h to inside GCC via a new pragma, which replaces the prior
> type definitions. This allows for the types to be used internally for
> intrinsic function definitions.
> 
> Bootstrapped and regression tested on arm-none-linux-gnuabihf, and
> regression tested on arm-eabi -- no issues.
> 
> Thanks,
> Murray
> 
> gcc/ChangeLog:
> 
>          * config.gcc: Add arm-mve-builtins.o to extra_objs for arm-*-*-*
>          targets.
>          * config/arm/arm-c.c (arm_pragma_arm): Handle new pragma.
>          (arm_register_target_pragmas): Register new pragma.
>          * config/arm/arm-protos.h: Add arm_mve namespace and declare
>          arm_handle_mve_types_h.
>          * config/arm/arm_mve_types.h: Replace MVE type definitions with
>          new pragma.
>          * config/arm/t-arm: Add arm-mve-builtins.o target.
>          * config/arm/arm-mve-builtins.cc: New file.
>          * config/arm/arm-mve-builtins.def: New file.
>          * config/arm/arm-mve-builtins.h: New file.
> 
> gcc/testsuite/ChangeLog:
> 
>          * gcc.target/arm/mve/mve.exp: Add new subdirectories.
>          * gcc.target/arm/mve/general-c/type_redef_1.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_10.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_11.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_12.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_13.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_14.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_15.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_16.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_17.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_18.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_19.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_2.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_20.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_21.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_22.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_23.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_24.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_25.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_26.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_27.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_28.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_29.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_3.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_30.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_31.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_4.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_5.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_6.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_7.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_8.c: New test.
>          * gcc.target/arm/mve/general-c/type_redef_9.c: New test.
>          * gcc.target/arm/mve/general/double_pragmas_1.c: New test.
>          * gcc.target/arm/mve/general/nomve_1.c: New test.
> 
> 

This is mostly OK, but can't we reduce the number of tests somewhat? 
For example, I think you can merge type_redef_13.c and type_redef_14.c 
by writing

/* { dg-do compile } */
/* { dg-require-effective-target arm_v8_1m_mve_ok } */
/* { dg-add-options arm_v8_1m_mve } */

int uint8x16x4_t; /* { dg-message "note: previous declaration of 
'uint8x16x4_t'" } */
int uint16x8x2_t; /* { dg-message "note: previous declaration of 
'uint16x8x2_t'" } */

#pragma GCC arm "arm_mve_types.h"  /* { dg-error {'uint8x16x4_t' 
redeclared} } */
   /* { dg-error {'uint16x8x2_t' redeclared} {target *-*-*} .-1 } */

etc.  Note the second dg-error is anchored to the line above it (.-1).

R.


More information about the Gcc-patches mailing list