[AARCH64][PATCH 3/3] Adding tests to check proper error reporting of out of bounds accesses to vmulx_lane* NEON intrinsics

Bilyan Borisov bilyan.borisov@foss.arm.com
Tue Nov 24 10:24:00 GMT 2015


I've made the change you've requested. Changelog & patch description are 
below.

Thanks,
Bilyan

---

This patch from the series adds tests that check for the proper error reporting
of out of bounds accesses to all the vmulx_lane NEON intrinsics variants. The
tests were added separately from the previous patch in order to reduce its
size.

gcc/testsuite/

2015-XX-XX  Bilyan Borisov  <bilyan.borisov@arm.com>

	* gcc.target/aarch64/advsimd-intrinsics/vmulx_lane_f32_indices_1.c:
	New.
	* gcc.target/aarch64/advsimd-intrinsics/vmulx_lane_f64_indices_1.c:
	New.
	* gcc.target/aarch64/advsimd-intrinsics/vmulx_laneq_f32_indices_1.c:
	New.
	* gcc.target/aarch64/advsimd-intrinsics/vmulx_laneq_f64_indices_1.c:
	New.
	* gcc.target/aarch64/advsimd-intrinsics/vmulxd_lane_f64_indices_1.c:
	New.
	* gcc.target/aarch64/advsimd-intrinsics/vmulxd_laneq_f64_indices_1.c:
	New.
	* gcc.target/aarch64/advsimd-intrinsics/vmulxq_lane_f32_indices_1.c:
	New.
	* gcc.target/aarch64/advsimd-intrinsics/vmulxq_lane_f64_indices_1.c:
	New.
	* gcc.target/aarch64/advsimd-intrinsics/vmulxq_laneq_f32_indices_1.c:
	New.
	* gcc.target/aarch64/advsimd-intrinsics/vmulxq_laneq_f64_indices_1.c:
	New.
	* gcc.target/aarch64/advsimd-intrinsics/vmulxs_lane_f32_indices_1.c:
	New.
	* gcc.target/aarch64/advsimd-intrinsics/vmulxs_laneq_f32_indices_1.c:
	New.


On 22/11/15 15:24, James Greenhalgh wrote:
> On Fri, Oct 30, 2015 at 09:32:07AM +0000, Bilyan Borisov wrote:
>> Implementing vmulx_* and vmulx_lane* NEON intrinsics
>>
>> Hi all,
>>
>> This series of patches focuses on the different vmulx_ and vmulx_lane NEON
>> intrinsics variants. All of the existing inlined assembly block implementations
>> are replaced with newly defined __builtin functions, and the missing intrinsics
>> are implemented with __builtins as well.
>>
>> The rationale for the change from assembly to __builtin is that the compiler
>> would be able to do more optimisations like instruction scheduling. A new named
>> md pattern was added for the new fmulx __builtin.
>>
>> Most vmulx_lane variants have been implemented as a combination of a vdup
>> followed by a vmulx_, rather than as separate __builtins.  The remaining
>> vmulx_lane intrinsics (vmulx(s|d)_lane*) were implemented using
>> __aarch64_vget_lane_any () and an appropriate vmulx. Four new nameless md
>> patterns were added to replace all the different types of RTL generated from the
>> combination of these intrinsics during the combine pass.
>>
>> The rationale for this change is that in this way we would be able to optimise
>> away all uses of a dup followed by a fmulx to the appropriate fmulx lane variant
>> instruction.
>>
>> New test cases were added for all the implemented intrinsics. Also new tests
>> were added for the proper error reporting of out-of-bounds accesses to _lane
>> intrinsics.
>>
>> Tested on targets aarch64-none-elf and aarch64_be-none-elf.
>>
>> diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vmulx_lane_f32_indices_1.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vmulx_lane_f32_indices_1.c
>> new file mode 100644
>> index 0000000000000000000000000000000000000000..5681d5d21bc62e54e308c0a7c171f6f1b8969b71
>> --- /dev/null
>> +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vmulx_lane_f32_indices_1.c
>> @@ -0,0 +1,16 @@
>> +#include <arm_neon.h>
>> +
>> +/* { dg-do compile } */
>> +/* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } } */
>> +/* { dg-skip-if "" { arm*-*-* } } */
>> +
>> +float32x2_t
>> +f_vmulx_lane_f32 (float32x2_t v1, float32x2_t v2)
>> +{
>> +  float32x2_t res;
>> +  /* { dg-error "lane -1 out of range 0 - 1" "" { xfail arm*-*-* } 0 } */
>> +  res = vmulx_lane_f32 (v1, v2, -1);
>> +  /* { dg-error "lane 2 out of range 0 - 1" "" { xfail arm*-*-* } 0 } */
> Given the dg-skip-if directive, do we really need the cfail directive for
> arm*-*-*, surely the whole test is skipped regardless?
>
> Could you respin this patch without the xfails?
>
> Thanks,
> James
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: rb4601.patch
Type: text/x-patch
Size: 10536 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20151124/810c8eb4/attachment.bin>


More information about the Gcc-patches mailing list