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?

Thanks,
Srinath.

gcc/ChangeLog:

2020-04-22  Srinath Parvathaneni  <srinath.parvathan...@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.parvathan...@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.

Attachment: rb12937.patch.gz
Description: application/gzip

Reply via email to