On Mon, Aug 18, 2014 at 11:31 AM, Jiong Wang <jiong.w...@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.