arm: Remove coercion from scalar argument to vmin & vmax intrinsics
authorJoe Ramsay <Joe.Ramsay@arm.com>
Fri, 2 Oct 2020 14:28:29 +0000 (15:28 +0100)
committerSrinath Parvathaneni <srinath.parvathaneni@arm.com>
Fri, 2 Oct 2020 14:38:58 +0000 (15:38 +0100)
commit251950d899bc3c18b5775fe9fe20bebbdc8d15cb
treec8a9c48d9814e9f6f8430190897fa84654c2787e
parentc8c77ed747abb61a7f3cf34f71539bc87a5d6c3c
arm: Remove coercion from scalar argument to vmin & vmax intrinsics

This patch fixes an issue with vmin* and vmax* intrinsics which accept
a scalar argument. Previously when the scalar was of different width
to the vector elements this would generate __ARM_undef. This change
allows the scalar argument to be implicitly converted to the correct
width. Also tidied up the relevant unit tests, some of which would
have passed even if only one of two or three intrinsic calls had
compiled correctly.

Bootstrapped and tested on arm-none-eabi, gcc and CMSIS_DSP
testsuites are clean. OK for trunk?

Thanks,
Joe

gcc/ChangeLog:

2020-08-10  Joe Ramsay  <joe.ramsay@arm.com>

* config/arm/arm_mve.h (__arm_vmaxnmavq): Remove coercion of scalar
argument.
(__arm_vmaxnmvq): Likewise.
(__arm_vminnmavq): Likewise.
(__arm_vminnmvq): Likewise.
(__arm_vmaxnmavq_p): Likewise.
(__arm_vmaxnmvq_p): Likewise (and delete duplicate definition).
(__arm_vminnmavq_p): Likewise.
(__arm_vminnmvq_p): Likewise.
(__arm_vmaxavq): Likewise.
(__arm_vmaxavq_p): Likewise.
(__arm_vmaxvq): Likewise.
(__arm_vmaxvq_p): Likewise.
(__arm_vminavq): Likewise.
(__arm_vminavq_p): Likewise.
(__arm_vminvq): Likewise.
(__arm_vminvq_p): Likewise.

gcc/testsuite/ChangeLog:

* gcc.target/arm/mve/intrinsics/vmaxavq_p_s16.c: Add test for mismatched
width of scalar argument.
* gcc.target/arm/mve/intrinsics/vmaxavq_p_s32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxavq_p_s8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxavq_s16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxavq_s32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxavq_s8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxnmavq_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxnmavq_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxnmavq_p_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxnmavq_p_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxnmvq_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxnmvq_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxnmvq_p_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxnmvq_p_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxvq_p_s16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxvq_p_s32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxvq_p_s8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxvq_p_u16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxvq_p_u32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxvq_p_u8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxvq_s16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxvq_s32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxvq_s8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxvq_u16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxvq_u32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vmaxvq_u8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminavq_p_s16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminavq_p_s32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminavq_p_s8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminavq_s16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminavq_s32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminavq_s8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminnmavq_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminnmavq_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminnmavq_p_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminnmavq_p_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminnmvq_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminnmvq_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminnmvq_p_f16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminnmvq_p_f32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminvq_p_s16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminvq_p_s32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminvq_p_s8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminvq_p_u16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminvq_p_u32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminvq_p_u8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminvq_s16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminvq_s32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminvq_s8.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminvq_u16.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminvq_u32.c: Likewise.
* gcc.target/arm/mve/intrinsics/vminvq_u8.c: Likewise.
53 files changed:
gcc/config/arm/arm_mve.h
gcc/testsuite/gcc.target/arm/mve/intrinsics/vmaxavq_p_s16.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vmaxavq_p_s32.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vmaxavq_p_s8.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vmaxavq_s16.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vmaxavq_s32.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vmaxavq_s8.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vmaxnmavq_f16.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vmaxnmavq_f32.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vmaxnmavq_p_f16.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vmaxnmavq_p_f32.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vmaxnmvq_f16.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vmaxnmvq_f32.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vmaxnmvq_p_f16.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vmaxnmvq_p_f32.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vmaxvq_p_s16.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vmaxvq_p_s32.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vmaxvq_p_s8.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vmaxvq_p_u16.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vmaxvq_p_u32.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vmaxvq_p_u8.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vmaxvq_s16.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vmaxvq_s32.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vmaxvq_s8.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vmaxvq_u16.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vmaxvq_u32.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vmaxvq_u8.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vminavq_p_s16.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vminavq_p_s32.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vminavq_p_s8.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vminavq_s16.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vminavq_s32.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vminavq_s8.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vminnmavq_f16.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vminnmavq_f32.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vminnmavq_p_f16.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vminnmavq_p_f32.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vminnmvq_f16.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vminnmvq_f32.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vminnmvq_p_f16.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vminnmvq_p_f32.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vminvq_p_s16.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vminvq_p_s32.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vminvq_p_s8.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vminvq_p_u16.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vminvq_p_u32.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vminvq_p_u8.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vminvq_s16.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vminvq_s32.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vminvq_s8.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vminvq_u16.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vminvq_u32.c
gcc/testsuite/gcc.target/arm/mve/intrinsics/vminvq_u8.c