Hi Carl,

On Tue, Jun 20, 2017 at 06:23:33PM -0700, Carl Love wrote:
>       * config/rs6000/rs6000-builtin.def (VREVE_V2DI, VREVE_V4SI,
>       VREVE_V8HI, VREVE_V16QI, VREVE_V2DF, VREVE_V4SF, VREVE): New

"New." or "New builtin.".

>       * config/rs6000/altivec.md (UNSPEC_VREVEV, VEC_A_size,
>       altivec_vrev): New
>       UNSPEC, new mode_attr, new patterns.

This wrapped oddly...  mail client problem?

Please put these things in separate entries.

>       * config/rs6000/altivec.h (vec_reve): New define

Dot.

>       * gcc.target/powerpc/builtins-3-vec_reve-runable.c (test_results,
>       main): Add new runnable test file for the vec_rev built-ins.

You misspelled the filename.

> diff --git a/gcc/config/rs6000/altivec.h b/gcc/config/rs6000/altivec.h
> index d542315..98ccfd2 100644
> --- a/gcc/config/rs6000/altivec.h
> +++ b/gcc/config/rs6000/altivec.h
> @@ -142,6 +142,7 @@
>  #define vec_madd __builtin_vec_madd
>  #define vec_madds __builtin_vec_madds
>  #define vec_mtvscr __builtin_vec_mtvscr
> +#define vec_reve   __builtin_vec_vreve
>  #define vec_vmaxfp __builtin_vec_vmaxfp
>  #define vec_vmaxsw __builtin_vec_vmaxsw
>  #define vec_vmaxsh __builtin_vec_vmaxsh

All the rest here use just a single space, please do the same.

>     UNSPEC_VPACK_UNS_UNS_SAT
>     UNSPEC_VPACK_UNS_UNS_MOD
>     UNSPEC_VPACK_UNS_UNS_MOD_DIRECT
> +   UNSPEC_VREVEV
>     UNSPEC_VSLV4SI
>     UNSPEC_VSLO
>     UNSPEC_VSR
> @@ -231,6 +232,11 @@
>  ;; Vector negate
>  (define_mode_iterator VNEG [V4SI V2DI])
>  
> +;; Vector reverse elements, uses define_mode_iterator VEC_A
> +;; size in bytes of the vector element
> +(define_mode_attr VEC_A_size [(V2DI "8") (V4SI "4") (V8HI "2")
> +                              (V16QI "1") (V2DF "8") (V4SF "4")])

I think you want to use GET_MODE_UNIT_SIZE instead, no need for a new
attribute.

> +  size = <VEC_A_size>;

size = GET_MODE_UNIT_SIZE (<MODE>mode);

> +  num_elements = 16 / size;

num_elements = GET_MODE_NUNITS (<MODE>mode);

> +  for (j = num_elements-1; j >= 0; j--)
> +    for (i = 0; i < size; i++)
> +      RTVEC_ELT (v, i + j*size) = gen_rtx_CONST_INT (QImode, k++);

Why does j walk backwards?  Oh, because of k++.  Write that one as
something with i and j as well?


Segher

Reply via email to