[GCC][PATCH][ARM]: Modify the MVE polymorphic variant arguments to match the MVE intrinsic definition.

Christophe Lyon christophe.lyon@linaro.org
Fri Apr 24 11:38:49 GMT 2020


On Thu, 23 Apr 2020 at 10:03, Kyrylo Tkachov <Kyrylo.Tkachov@arm.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Srinath Parvathaneni <Srinath.Parvathaneni@arm.com>
> > Sent: 22 April 2020 14:00
> > To: gcc-patches@gcc.gnu.org
> > Cc: Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>
> > Subject: [GCC][PATCH][ARM]: Modify the MVE polymorphic variant
> > arguments to match the MVE intrinsic definition.
> >
> > Hello,
> >
> > When MVE intrinsic's are called, few implicit typecasting are done on the
> > formal arguments to match the intrinsic parameters.
> > But when same intrinsics are called through MVE polymorphic variants,
> > _Generic feature used here does strict type checking and fails to match the
> > exact intrinsic.
> > This patch corrects the behaviour of polymorphic variants and match the
> > expected intrinsic by explicitly typecasting the polymorphic variant's
> > arguments.
> >
> > Please refer to M-profile Vector Extension (MVE) intrinsics [1]  for more
> > details.
> > [1] https://developer.arm.com/architectures/instruction-sets/simd-
> > isas/helium/mve-intrinsics
> >
> > Regression tested on arm-none-eabi and found no regressions.
> >
> > Ok for trunk?

Hi,
I have noticed a few regressions:
    gcc.target/arm/mve/intrinsics/vbicq_f16.c (test for excess errors)
    gcc.target/arm/mve/intrinsics/vbicq_f32.c (test for excess errors)
    gcc.target/arm/mve/intrinsics/vbicq_s16.c (test for excess errors)
    gcc.target/arm/mve/intrinsics/vbicq_s32.c (test for excess errors)
    gcc.target/arm/mve/intrinsics/vbicq_s8.c (test for excess errors)
    gcc.target/arm/mve/intrinsics/vbicq_u16.c (test for excess errors)
    gcc.target/arm/mve/intrinsics/vbicq_u32.c (test for excess errors)
    gcc.target/arm/mve/intrinsics/vbicq_u8.c (test for excess errors)

The errors are:
/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_f16.c:18:9: error:
cannot convert a vector of type 'float16x8_t' to type 'short int'
which has different size
/gcc/testsuite/gcc.target/arm/mve/intrinsics/vbicq_f32.c:18:9: error:
cannot convert a vector of type 'float32x4_t' to type 'short int'
which has different size
etc....

In that case, the tests are compiled with -mfloat-abi=hard -mfpu=auto
-march=armv8.1-m.main+mve.fp -mthumb
did you test with different settings?

Thanks,

Christophe

>
> Ok.
> Thanks,
> Kyrill
>
> >
> > Thanks,
> > Srinath.
> >
> > gcc/ChangeLog:
> >
> > 2020-04-22  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>
> >
> >       * config/arm/arm_mve.h (__arm_vbicq_n_u16): Modify function
> > parameter's
> >       datatype.
> >       (__arm_vbicq_n_s16): Likewise.
> >       (__arm_vbicq_n_u32): Likewise.
> >       (__arm_vbicq_n_s32): Likewise.
> >       (__arm_vbicq): Likewise.
> >       (__arm_vbicq_n_s16): Modify MVE polymorphic variant argument's
> > datatype.
> >       (__arm_vbicq_n_s32): Likewise.
> >       (__arm_vbicq_n_u16): Likewise.
> >       (__arm_vbicq_n_u32): Likewise.
> >       (__arm_vdupq_m_n_s8): Likewise.
> >       (__arm_vdupq_m_n_s16): Likewise.
> >       (__arm_vdupq_m_n_s32): Likewise.
> >       (__arm_vdupq_m_n_u8): Likewise.
> >       (__arm_vdupq_m_n_u16): Likewise.
> >       (__arm_vdupq_m_n_u32): Likewise.
> >       (__arm_vdupq_m_n_f16): Likewise.
> >       (__arm_vdupq_m_n_f32): Likewise.
> >       (__arm_vldrhq_gather_offset_s16): Likewise.
> >       (__arm_vldrhq_gather_offset_s32): Likewise.
> >       (__arm_vldrhq_gather_offset_u16): Likewise.
> >       (__arm_vldrhq_gather_offset_u32): Likewise.
> >       (__arm_vldrhq_gather_offset_f16): Likewise.
> >       (__arm_vldrhq_gather_offset_z_s16): Likewise.
> >       (__arm_vldrhq_gather_offset_z_s32): Likewise.
> >       (__arm_vldrhq_gather_offset_z_u16): Likewise.
> >       (__arm_vldrhq_gather_offset_z_u32): Likewise.
> >       (__arm_vldrhq_gather_offset_z_f16): Likewise.
> >       (__arm_vldrhq_gather_shifted_offset_s16): Likewise.
> >       (__arm_vldrhq_gather_shifted_offset_s32): Likewise.
> >       (__arm_vldrhq_gather_shifted_offset_u16): Likewise.
> >       (__arm_vldrhq_gather_shifted_offset_u32): Likewise.
> >       (__arm_vldrhq_gather_shifted_offset_f16): Likewise.
> >       (__arm_vldrhq_gather_shifted_offset_z_s16): Likewise.
> >       (__arm_vldrhq_gather_shifted_offset_z_s32): Likewise.
> >       (__arm_vldrhq_gather_shifted_offset_z_u16): Likewise.
> >       (__arm_vldrhq_gather_shifted_offset_z_u32): Likewise.
> >       (__arm_vldrhq_gather_shifted_offset_z_f16): Likewise.
> >       (__arm_vldrwq_gather_offset_s32): Likewise.
> >       (__arm_vldrwq_gather_offset_u32): Likewise.
> >       (__arm_vldrwq_gather_offset_f32): Likewise.
> >       (__arm_vldrwq_gather_offset_z_s32): Likewise.
> >       (__arm_vldrwq_gather_offset_z_u32): Likewise.
> >       (__arm_vldrwq_gather_offset_z_f32): Likewise.
> >       (__arm_vldrwq_gather_shifted_offset_s32): Likewise.
> >       (__arm_vldrwq_gather_shifted_offset_u32): Likewise.
> >       (__arm_vldrwq_gather_shifted_offset_f32): Likewise.
> >       (__arm_vldrwq_gather_shifted_offset_z_s32): Likewise.
> >       (__arm_vldrwq_gather_shifted_offset_z_u32): Likewise.
> >       (__arm_vldrwq_gather_shifted_offset_z_f32): Likewise.
> >       (__arm_vdwdupq_x_n_u8): Likewise.
> >       (__arm_vdwdupq_x_n_u16): Likewise.
> >       (__arm_vdwdupq_x_n_u32): Likewise.
> >       (__arm_viwdupq_x_n_u8): Likewise.
> >       (__arm_viwdupq_x_n_u16): Likewise.
> >       (__arm_viwdupq_x_n_u32): Likewise.
> >       (__arm_vidupq_x_n_u8): Likewise.
> >       (__arm_vddupq_x_n_u8): Likewise.
> >       (__arm_vidupq_x_n_u16): Likewise.
> >       (__arm_vddupq_x_n_u16): Likewise.
> >       (__arm_vidupq_x_n_u32): Likewise.
> >       (__arm_vddupq_x_n_u32): Likewise.
> >       (__arm_vldrdq_gather_offset_s64): Likewise.
> >       (__arm_vldrdq_gather_offset_u64): Likewise.
> >       (__arm_vldrdq_gather_offset_z_s64): Likewise.
> >       (__arm_vldrdq_gather_offset_z_u64): Likewise.
> >       (__arm_vldrdq_gather_shifted_offset_s64): Likewise.
> >       (__arm_vldrdq_gather_shifted_offset_u64): Likewise.
> >       (__arm_vldrdq_gather_shifted_offset_z_s64): Likewise.
> >       (__arm_vldrdq_gather_shifted_offset_z_u64): Likewise.
> >       (__arm_vidupq_m_n_u8): Likewise.
> >       (__arm_vidupq_m_n_u16): Likewise.
> >       (__arm_vidupq_m_n_u32): Likewise.
> >       (__arm_vddupq_m_n_u8): Likewise.
> >       (__arm_vddupq_m_n_u16): Likewise.
> >       (__arm_vddupq_m_n_u32): Likewise.
> >       (__arm_vidupq_n_u16): Likewise.
> >       (__arm_vidupq_n_u32): Likewise.
> >       (__arm_vidupq_n_u8): Likewise.
> >       (__arm_vddupq_n_u16): Likewise.
> >       (__arm_vddupq_n_u32): Likewise.
> >       (__arm_vddupq_n_u8): Likewise.
> >
> > gcc/testsuite/ChangeLog:
> >
> > 2020-04-22  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>
> >
> >       * gcc.target/arm/mve/intrinsics/mve_vddupq_m_n_u16.c: New test.
> >       * gcc.target/arm/mve/intrinsics/mve_vddupq_m_n_u32.c: Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vddupq_m_n_u8.c: Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vddupq_n_u16.c: Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vddupq_n_u32.c: Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vddupq_n_u8.c: Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vddupq_x_n_u16.c: Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vddupq_x_n_u32.c: Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vddupq_x_n_u8.c: Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vdwdupq_x_n_u16.c: Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vdwdupq_x_n_u32.c: Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vdwdupq_x_n_u8.c: Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vidupq_m_n_u16.c: Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vidupq_m_n_u32.c: Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vidupq_m_n_u8.c: Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vidupq_n_u16.c: Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vidupq_n_u32.c: Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vidupq_n_u8.c: Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vidupq_x_n_u16.c: Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vidupq_x_n_u32.c: Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vidupq_x_n_u8.c: Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_viwdupq_x_n_u16.c: Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_viwdupq_x_n_u32.c: Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_viwdupq_x_n_u8.c: Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vldrdq_gather_offset_s64.c:
> >       Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vldrdq_gather_offset_u64.c:
> >       Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vldrdq_gather_offset_z_s64.c:
> >       Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vldrdq_gather_offset_z_u64.c:
> >       Likewise.
> >       *
> > gcc.target/arm/mve/intrinsics/mve_vldrdq_gather_shifted_offset_s64.c:
> >       Likewise.
> >       *
> > gcc.target/arm/mve/intrinsics/mve_vldrdq_gather_shifted_offset_u64.c:
> >       Likewise.
> >       *
> > gcc.target/arm/mve/intrinsics/mve_vldrdq_gather_shifted_offset_z_s64.c
> >       : Likewise.
> >       *
> > gcc.target/arm/mve/intrinsics/mve_vldrdq_gather_shifted_offset_z_u64.c
> >       : Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_offset_f16.c:
> >       Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_offset_s16.c:
> >       Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_offset_s32.c:
> >       Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_offset_u16.c:
> >       Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_offset_u32.c:
> >       Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_offset_z_f16.c:
> >       Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_offset_z_s16.c:
> >       Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_offset_z_s32.c:
> >       Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_offset_z_u16.c:
> >       Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_offset_z_u32.c:
> >       Likewise.
> >       *
> > gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_shifted_offset_f16.c:
> >       Likewise.
> >       *
> > gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_shifted_offset_s16.c:
> >       Likewise.
> >       *
> > gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_shifted_offset_s32.c:
> >       Likewise.
> >       *
> > gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_shifted_offset_u16.c:
> >       Likewise.
> >       *
> > gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_shifted_offset_u32.c:
> >       Likewise.
> >       *
> > gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_shifted_offset_z_f16.c
> >       : Likewise.
> >       *
> > gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_shifted_offset_z_s16.c
> >       : Likewise.
> >       *
> > gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_shifted_offset_z_s32.c
> >       : Likewise.
> >       *
> > gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_shifted_offset_z_u16.c
> >       : Likewise.
> >       *
> > gcc.target/arm/mve/intrinsics/mve_vldrhq_gather_shifted_offset_z_u32.c
> >       : Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vldrwq_gather_offset_f32.c:
> >       Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vldrwq_gather_offset_s32.c:
> >       Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vldrwq_gather_offset_u32.c:
> >       Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vldrwq_gather_offset_z_f32.c:
> >       Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vldrwq_gather_offset_z_s32.c:
> >       Likewise.
> >       * gcc.target/arm/mve/intrinsics/mve_vldrwq_gather_offset_z_u32.c:
> >       Likewise.
> >       *
> > gcc.target/arm/mve/intrinsics/mve_vldrwq_gather_shifted_offset_f32.c:
> >       Likewise.
> >       *
> > gcc.target/arm/mve/intrinsics/mve_vldrwq_gather_shifted_offset_s32.c:
> >       Likewise.
> >       *
> > gcc.target/arm/mve/intrinsics/mve_vldrwq_gather_shifted_offset_u32.c:
> >       Likewise.
> >       *
> > gcc.target/arm/mve/intrinsics/mve_vldrwq_gather_shifted_offset_z_f32.c
> >       : Likewise.
> >       *
> > gcc.target/arm/mve/intrinsics/mve_vldrwq_gather_shifted_offset_z_s32.c
> >       : Likewise.
> >       *
> > gcc.target/arm/mve/intrinsics/mve_vldrwq_gather_shifted_offset_z_u32.c
> >       : Likewise.


More information about the Gcc-patches mailing list