On Wed, Mar 14, 2018 at 04:27:31PM -0500, Kelvin Nilsen wrote:
> During code review, it was discovered that the implementation of
> __builtin_altivec_lvx_v1ti is not complete. The constant
> ALTIVEC_BUILTINLVX_V1TI is introduced and is bound to the function
> __builtin_altivec_lvx_v1ti. However, this function's implementation is
> incomplete because there is no call to the def_builtin function for this
> binding.
>
> This patch provides the missing pieces to add support for this function.
> Additionally, this patch introduces four new __int128-based prototypes
> of the overloaded __builtin_vec_ld function. This is the function that
> implements the vec_ld () macro expansion. A new test case has been
> provided to exercise each of these prototypes.
Do we want/need stvx_v1ti as well?
> --- gcc/config/rs6000/rs6000.c (revision 258341)
> +++ gcc/config/rs6000/rs6000.c (working copy)
> @@ -14452,6 +14452,7 @@ altivec_expand_lv_builtin (enum insn_code icode, t
> LVXL and LVE*X expand to use UNSPECs to hide their special behavior,
> so the raw address is fine. */
> if (icode == CODE_FOR_altivec_lvx_v2df_2op
> + || icode == CODE_FOR_altivec_lvx_v1ti_2op
> || icode == CODE_FOR_altivec_lvx_v2di_2op
> || icode == CODE_FOR_altivec_lvx_v4sf_2op
> || icode == CODE_FOR_altivec_lvx_v4si_2op
That's a weird ordering; put v1ti first?
> @@ -15811,6 +15812,9 @@ altivec_expand_builtin (tree exp, rtx target, bool
> case ALTIVEC_BUILTIN_LVX_V2DI:
> return altivec_expand_lv_builtin (CODE_FOR_altivec_lvx_v2di_2op,
> exp, target, false);
> + case ALTIVEC_BUILTIN_LVX_V1TI:
> + return altivec_expand_lv_builtin (CODE_FOR_altivec_lvx_v1ti_2op,
> + exp, target, false);
> case ALTIVEC_BUILTIN_LVX_V4SF:
> return altivec_expand_lv_builtin (CODE_FOR_altivec_lvx_v4sf_2op,
> exp, target, false);
Same here.
> --- gcc/testsuite/gcc.target/powerpc/altivec-ld-1.c (nonexistent)
> +++ gcc/testsuite/gcc.target/powerpc/altivec-ld-1.c (working copy)
> @@ -0,0 +1,67 @@
> +/* { dg-do run { target powerpc*-*-* } } */
> +/* { dg-require-effective-target powerpc_altivec_ok } */
> +/* { dg-require-effective-target lp64 } */
> +/* { dg-options "-maltivec -O0 -Wall -Wno-deprecated" } */
Since this is a run testcase you need vmx_hw instead of powerpc_altivec_ok.
You also need a test for int128. I don't think you need lp64, please check.
Okay for trunk with that fixed. Thanks!
Segher