This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][ARM] Enable auto-vectorization for copysignf
- From: Ramana Radhakrishnan <ramana dot gcc at googlemail dot com>
- To: Jiong Wang <jiong dot wang at arm dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 9 Sep 2014 11:59:15 +0100
- Subject: Re: [PATCH][ARM] Enable auto-vectorization for copysignf
- Authentication-results: sourceware.org; auth=none
- References: <53F1D60D dot 9050101 at arm dot com>
- Reply-to: ramrad01 at arm dot com
On Mon, Aug 18, 2014 at 11:31 AM, Jiong Wang <jiong.wang@arm.com> wrote:
> this patch enable auto-vectorization for copysignf by using vector
> bit selection instruction on arm32 when neon available.
>
> for a simple testcase:
>
> for (i = 0; i < N; i++)
> r[i] = __builtin_copysignf (a[i], b[i]);
>
>
> assuming vector factor be 4, the generated instruction sequences is:
>
> vmov.i32 q10, #2147483648 @ v4si
> .L2:
> vld1.64 {d18-d19}, [ip:64]
> add r3, r3, #16
> add ip, ip, #16
> vldr d16, [r3, #-16]
> vldr d17, [r3, #-8]
> vbif q8, q9, q10
Ok.
Ramana
>
> thanks.
>
> gcc/
> * config/arm/arm.c (NEON_COPYSIGNF): New enum.
> (arm_init_neon_builtins): Support NEON_COPYSIGNF.
> (arm_builtin_vectorized_function): Likewise.
> * config/arm/arm_neon_builtins.def: New macro for copysignf.
> * config/arm/neon.md (neon_copysignf<mode>): New pattern for vector
> copysignf.
>
> gcc/testsuite/
> * gcc.target/arm/vect-copysignf.c: New testcase.