This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 7/14][Testsuite] Add tests of reductions using whole-vector-shifts (multiplication)
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Alan Lawrence <alan dot lawrence at arm dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, David Edelsohn <dje dot gcc at gmail dot com>, Aldy Hernandez <aldyh at redhad dot com>
- Date: Mon, 22 Sep 2014 12:41:44 +0200
- Subject: Re: [PATCH 7/14][Testsuite] Add tests of reductions using whole-vector-shifts (multiplication)
- Authentication-results: sourceware.org; auth=none
- References: <541AC4D2 dot 9040901 at arm dot com> <541ACDB7 dot 2010407 at arm dot com>
On Thu, Sep 18, 2014 at 2:19 PM, Alan Lawrence <alan.lawrence@arm.com> wrote:
> For reduction operations (e.g. multiply) that don't have such a tree code
> ,or where the target platform doesn't define an optab handler for the tree
> code, we can perform the reduction using a series of log(N) shifts (where N
> = #elements in vector), using the VEC_RSHIFT_EXPR=whole-vector-shift tree
> code (if the platform handles the vec_shr_optab).
>
> First stage is to add some tests of non-(min/max/plus) reductions; here,
> multiplies. The first is designed to be non-foldable, so we make sure the
> architectural instructions line up with what the tree codes specify. The
> second is designed to be easily constant-propagated, to test the (currently
> endianness-dependent) constant folding code.
>
> In lib/target-supports.exp, I've defined a new
> check_effective_target_whole_vector_shift, which I intended to define to
> true for platforms with the vec_shr optab. However, I've not managed to make
> this test pass on PowerPC - even with -maltivec, -fdump-tree-vect-details
> gives me a message about the target not supporting vector multiplication -
> so I've omitted PowerPC from the whole_vector_shift. This doesn't feel
> right, suggestions welcomed from PowerPC maintainers?
>
> Tests passing on arm-none-eabi and x86_64-none-linux-gnu;
> also verified the scan-tree-dump part works on ia64-none-linux-gnu (by
> compiling to assembly only).
> (Tests are not run on AArch64, because we have no vec_shr_optab at this
> point; PowerPC, as above; or MIPS, as check_effective_target_vect_int_mult
> yields 0.)
Ok.
Thanks,
Richard.
> gcc/testsuite/ChangeLog:
>
> * lib/target-supports.exp
> (check_effective_target_whole_vector_shift):
> New.
>
> * gcc.dg/vect/vect-reduc-mul_1.c: New test.
> * gcc.dg/vect/vect-reduc-mul_2.c: New test.