From 6687d58dbc006e5300976b79b753a9525b19dd01 Mon Sep 17 00:00:00 2001 From: Bill Schmidt Date: Mon, 30 Jan 2017 03:32:59 +0000 Subject: [PATCH] re PR target/79268 (Wrong code generation for vec_xl and vec_xst intrinsics) [gcc] 2017-01-29 Bill Schmidt PR target/79268 * config/rs6000/altivec.h (vec_xl): Revise #define. (vec_xst): Likewise. [gcc/testsuite] 2017-01-29 Bill Schmidt PR target/79268 * gcc.target/powerpc/pr79268.c: New file. * gcc.target/powerpc/vsx-elemrev-1.c: Delete file. * gcc.target/powerpc/vsx-elemrev-2.c: Likewise. * gcc.target/powerpc/vsx-elemrev-3.c: Likewise. * gcc.target/powerpc/vsx-elemrev-4.c: Likewise. From-SVN: r245021 --- gcc/ChangeLog | 6 + gcc/config/rs6000/altivec.h | 4 +- gcc/testsuite/ChangeLog | 9 + gcc/testsuite/gcc.target/powerpc/pr79268.c | 19 ++ .../gcc.target/powerpc/vsx-elemrev-1.c | 143 ----------- .../gcc.target/powerpc/vsx-elemrev-2.c | 236 ------------------ .../gcc.target/powerpc/vsx-elemrev-3.c | 142 ----------- .../gcc.target/powerpc/vsx-elemrev-4.c | 233 ----------------- 8 files changed, 36 insertions(+), 756 deletions(-) create mode 100644 gcc/testsuite/gcc.target/powerpc/pr79268.c delete mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-elemrev-1.c delete mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-elemrev-2.c delete mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-elemrev-3.c delete mode 100644 gcc/testsuite/gcc.target/powerpc/vsx-elemrev-4.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d9afe08245f..535647aeb2c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-01-29 Bill Schmidt + + PR target/79268 + * config/rs6000/altivec.h (vec_xl): Revise #define. + (vec_xst): Likewise. + 2017-01-27 Uros Bizjak * config/i386/i386.c (print_reg): Use REGNO instead of true_regnum. diff --git a/gcc/config/rs6000/altivec.h b/gcc/config/rs6000/altivec.h index c5879234ff5..53ddced016f 100644 --- a/gcc/config/rs6000/altivec.h +++ b/gcc/config/rs6000/altivec.h @@ -333,8 +333,8 @@ #define vec_sqrt __builtin_vec_sqrt #define vec_vsx_ld __builtin_vec_vsx_ld #define vec_vsx_st __builtin_vec_vsx_st -#define vec_xl __builtin_vec_xl -#define vec_xst __builtin_vec_xst +#define vec_xl __builtin_vec_vsx_ld +#define vec_xst __builtin_vec_vsx_st /* Note, xxsldi and xxpermdi were added as __builtin_vsx_ functions instead of __builtin_vec_ */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5a938234731..84b45441fdb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2017-01-29 Bill Schmidt + + PR target/79268 + * gcc.target/powerpc/pr79268.c: New file. + * gcc.target/powerpc/vsx-elemrev-1.c: Delete file. + * gcc.target/powerpc/vsx-elemrev-2.c: Likewise. + * gcc.target/powerpc/vsx-elemrev-3.c: Likewise. + * gcc.target/powerpc/vsx-elemrev-4.c: Likewise. + 2017-01-28 John David Anglin * gnat.dg/trampoline4.adb: Skip on hppa*-*-*. diff --git a/gcc/testsuite/gcc.target/powerpc/pr79268.c b/gcc/testsuite/gcc.target/powerpc/pr79268.c new file mode 100644 index 00000000000..8e451778227 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr79268.c @@ -0,0 +1,19 @@ +/* { dg-do compile { target { powerpc64*-*-* && lp64 } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* powerpc-*-aix* } } */ +/* { dg-options "-mcpu=power8 -O3" } */ + +/* Verify that vec_xl and vec_xst accept vector pixel parameters. */ + +/* Test case to resolve PR79268. */ + +#include + +vector pixel a; + +vector pixel +pr79268 (vector pixel *x) +{ + vec_xst (a, 0, x); + return vec_xl (0, x); +} diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-elemrev-1.c b/gcc/testsuite/gcc.target/powerpc/vsx-elemrev-1.c deleted file mode 100644 index 7ab6d446a23..00000000000 --- a/gcc/testsuite/gcc.target/powerpc/vsx-elemrev-1.c +++ /dev/null @@ -1,143 +0,0 @@ -/* { dg-do compile { target { powerpc64le*-*-* } } } */ -/* { dg-skip-if "do not override mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ -/* { dg-options "-mcpu=power8 -O0" } */ -/* { dg-final { scan-assembler-times "lxvd2x" 18 } } */ -/* { dg-final { scan-assembler-times "lxvw4x" 6 } } */ -/* { dg-final { scan-assembler-times "stxvd2x" 18 } } */ -/* { dg-final { scan-assembler-times "stxvw4x" 6 } } */ -/* { dg-final { scan-assembler-times "xxpermdi" 24 } } */ - -#include - -extern vector double vd, *vdp; -extern vector signed long long vsll, *vsllp; -extern vector unsigned long long vull, *vullp; -extern vector float vf, *vfp; -extern vector signed int vsi, *vsip; -extern vector unsigned int vui, *vuip; -extern double *dp; -extern signed long long *sllp; -extern unsigned long long *ullp; -extern float *fp; -extern signed int *sip; -extern unsigned int *uip; - -void foo0 (void) -{ - vd = vec_xl (0, vdp); -} - -void foo1 (void) -{ - vsll = vec_xl (0, vsllp); -} - -void foo2 (void) -{ - vull = vec_xl (0, vullp); -} - -void foo3 (void) -{ - vf = vec_xl (0, vfp); -} - -void foo4 (void) -{ - vsi = vec_xl (0, vsip); -} - -void foo5 (void) -{ - vui = vec_xl (0, vuip); -} - -void foo6 (void) -{ - vec_xst (vd, 0, vdp); -} - -void foo7 (void) -{ - vec_xst (vsll, 0, vsllp); -} - -void foo8 (void) -{ - vec_xst (vull, 0, vullp); -} - -void foo9 (void) -{ - vec_xst (vf, 0, vfp); -} - -void foo10 (void) -{ - vec_xst (vsi, 0, vsip); -} - -void foo11 (void) -{ - vec_xst (vui, 0, vuip); -} - -void foo20 (void) -{ - vd = vec_xl (0, dp); -} - -void foo21 (void) -{ - vsll = vec_xl (0, sllp); -} - -void foo22 (void) -{ - vull = vec_xl (0, ullp); -} - -void foo23 (void) -{ - vf = vec_xl (0, fp); -} - -void foo24 (void) -{ - vsi = vec_xl (0, sip); -} - -void foo25 (void) -{ - vui = vec_xl (0, uip); -} - -void foo26 (void) -{ - vec_xst (vd, 0, dp); -} - -void foo27 (void) -{ - vec_xst (vsll, 0, sllp); -} - -void foo28 (void) -{ - vec_xst (vull, 0, ullp); -} - -void foo29 (void) -{ - vec_xst (vf, 0, fp); -} - -void foo30 (void) -{ - vec_xst (vsi, 0, sip); -} - -void foo31 (void) -{ - vec_xst (vui, 0, uip); -} diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-elemrev-2.c b/gcc/testsuite/gcc.target/powerpc/vsx-elemrev-2.c deleted file mode 100644 index eb4a13081a2..00000000000 --- a/gcc/testsuite/gcc.target/powerpc/vsx-elemrev-2.c +++ /dev/null @@ -1,236 +0,0 @@ -/* { dg-do compile { target { powerpc64le*-*-* } } } */ -/* { dg-skip-if "do not override mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ -/* { dg-options "-mcpu=power9 -O0" } */ -/* { dg-require-effective-target powerpc_p9vector_ok } */ -/* { dg-skip-if "" { powerpc*-*-aix* } { "*" } { "" } } */ -/* { dg-final { scan-assembler-times "lxvd2x" 6 } } */ -/* { dg-final { scan-assembler-times "lxvw4x" 6 } } */ -/* { dg-final { scan-assembler-times "lxvh8x" 4 } } */ -/* { dg-final { scan-assembler-times "lxvb16x" 4 } } */ -/* { dg-final { scan-assembler-times "stxvd2x" 6 } } */ -/* { dg-final { scan-assembler-times "stxvw4x" 6 } } */ -/* { dg-final { scan-assembler-times "stxvh8x" 4 } } */ -/* { dg-final { scan-assembler-times "stxvb16x" 4 } } */ - -#include - -extern vector double vd, *vdp; -extern vector signed long long vsll, *vsllp; -extern vector unsigned long long vull, *vullp; -extern vector float vf, *vfp; -extern vector signed int vsi, *vsip; -extern vector unsigned int vui, *vuip; -extern vector signed short vss, *vssp; -extern vector unsigned short vus, *vusp; -extern vector signed char vsc, *vscp; -extern vector unsigned char vuc, *vucp; -extern double *dp; -extern signed long long *sllp; -extern unsigned long long *ullp; -extern float *fp; -extern signed int *sip; -extern unsigned int *uip; -extern signed short *ssp; -extern unsigned short *usp; -extern signed char *scp; -extern unsigned char *ucp; - -void foo0 (void) -{ - vd = vec_xl (0, vdp); -} - -void foo1 (void) -{ - vsll = vec_xl (0, vsllp); -} - -void foo2 (void) -{ - vull = vec_xl (0, vullp); -} - -void foo3 (void) -{ - vf = vec_xl (0, vfp); -} - -void foo4 (void) -{ - vsi = vec_xl (0, vsip); -} - -void foo5 (void) -{ - vui = vec_xl (0, vuip); -} - -void foo6 (void) -{ - vss = vec_xl (0, vssp); -} - -void foo7 (void) -{ - vus = vec_xl (0, vusp); -} - -void foo8 (void) -{ - vsc = vec_xl (0, vscp); -} - -void foo9 (void) -{ - vuc = vec_xl (0, vucp); -} - -void foo10 (void) -{ - vec_xst (vd, 0, vdp); -} - -void foo11 (void) -{ - vec_xst (vsll, 0, vsllp); -} - -void foo12 (void) -{ - vec_xst (vull, 0, vullp); -} - -void foo13 (void) -{ - vec_xst (vf, 0, vfp); -} - -void foo14 (void) -{ - vec_xst (vsi, 0, vsip); -} - -void foo15 (void) -{ - vec_xst (vui, 0, vuip); -} - -void foo16 (void) -{ - vec_xst (vss, 0, vssp); -} - -void foo17 (void) -{ - vec_xst (vus, 0, vusp); -} - -void foo18 (void) -{ - vec_xst (vsc, 0, vscp); -} - -void foo19 (void) -{ - vec_xst (vuc, 0, vucp); -} - -void foo20 (void) -{ - vd = vec_xl (0, dp); -} - -void foo21 (void) -{ - vsll = vec_xl (0, sllp); -} - -void foo22 (void) -{ - vull = vec_xl (0, ullp); -} - -void foo23 (void) -{ - vf = vec_xl (0, fp); -} - -void foo24 (void) -{ - vsi = vec_xl (0, sip); -} - -void foo25 (void) -{ - vui = vec_xl (0, uip); -} - -void foo26 (void) -{ - vss = vec_xl (0, ssp); -} - -void foo27 (void) -{ - vus = vec_xl (0, usp); -} - -void foo28 (void) -{ - vsc = vec_xl (0, scp); -} - -void foo29 (void) -{ - vuc = vec_xl (0, ucp); -} - -void foo30 (void) -{ - vec_xst (vd, 0, dp); -} - -void foo31 (void) -{ - vec_xst (vsll, 0, sllp); -} - -void foo32 (void) -{ - vec_xst (vull, 0, ullp); -} - -void foo33 (void) -{ - vec_xst (vf, 0, fp); -} - -void foo34 (void) -{ - vec_xst (vsi, 0, sip); -} - -void foo35 (void) -{ - vec_xst (vui, 0, uip); -} - -void foo36 (void) -{ - vec_xst (vss, 0, ssp); -} - -void foo37 (void) -{ - vec_xst (vus, 0, usp); -} - -void foo38 (void) -{ - vec_xst (vsc, 0, scp); -} - -void foo39 (void) -{ - vec_xst (vuc, 0, ucp); -} diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-elemrev-3.c b/gcc/testsuite/gcc.target/powerpc/vsx-elemrev-3.c deleted file mode 100644 index 2888c171c4f..00000000000 --- a/gcc/testsuite/gcc.target/powerpc/vsx-elemrev-3.c +++ /dev/null @@ -1,142 +0,0 @@ -/* { dg-do compile { target { powerpc64-*-* } } } */ -/* { dg-skip-if "do not override mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ -/* { dg-options "-mcpu=power8 -O0" } */ -/* { dg-final { scan-assembler-times "lxvd2x" 16 } } */ -/* { dg-final { scan-assembler-times "lxvw4x" 8 } } */ -/* { dg-final { scan-assembler-times "stxvd2x" 16 } } */ -/* { dg-final { scan-assembler-times "stxvw4x" 8 } } */ - -#include - -extern vector double vd, *vdp; -extern vector signed long long vsll, *vsllp; -extern vector unsigned long long vull, *vullp; -extern vector float vf, *vfp; -extern vector signed int vsi, *vsip; -extern vector unsigned int vui, *vuip; -extern double *dp; -extern signed long long *sllp; -extern unsigned long long *ullp; -extern float *fp; -extern signed int *sip; -extern unsigned int *uip; - -void foo0 (void) -{ - vd = vec_xl (0, vdp); -} - -void foo1 (void) -{ - vsll = vec_xl (0, vsllp); -} - -void foo2 (void) -{ - vull = vec_xl (0, vullp); -} - -void foo3 (void) -{ - vf = vec_xl (0, vfp); -} - -void foo4 (void) -{ - vsi = vec_xl (0, vsip); -} - -void foo5 (void) -{ - vui = vec_xl (0, vuip); -} - -void foo6 (void) -{ - vec_xst (vd, 0, vdp); -} - -void foo7 (void) -{ - vec_xst (vsll, 0, vsllp); -} - -void foo8 (void) -{ - vec_xst (vull, 0, vullp); -} - -void foo9 (void) -{ - vec_xst (vf, 0, vfp); -} - -void foo10 (void) -{ - vec_xst (vsi, 0, vsip); -} - -void foo11 (void) -{ - vec_xst (vui, 0, vuip); -} - -void foo20 (void) -{ - vd = vec_xl (0, dp); -} - -void foo21 (void) -{ - vsll = vec_xl (0, sllp); -} - -void foo22 (void) -{ - vull = vec_xl (0, ullp); -} - -void foo23 (void) -{ - vf = vec_xl (0, fp); -} - -void foo24 (void) -{ - vsi = vec_xl (0, sip); -} - -void foo25 (void) -{ - vui = vec_xl (0, uip); -} - -void foo26 (void) -{ - vec_xst (vd, 0, dp); -} - -void foo27 (void) -{ - vec_xst (vsll, 0, sllp); -} - -void foo28 (void) -{ - vec_xst (vull, 0, ullp); -} - -void foo29 (void) -{ - vec_xst (vf, 0, fp); -} - -void foo30 (void) -{ - vec_xst (vsi, 0, sip); -} - -void foo31 (void) -{ - vec_xst (vui, 0, uip); -} diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-elemrev-4.c b/gcc/testsuite/gcc.target/powerpc/vsx-elemrev-4.c deleted file mode 100644 index f40946353e4..00000000000 --- a/gcc/testsuite/gcc.target/powerpc/vsx-elemrev-4.c +++ /dev/null @@ -1,233 +0,0 @@ -/* { dg-do compile { target { powerpc64-*-* } } } */ -/* { dg-skip-if "do not override mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ -/* { dg-options "-mcpu=power9 -O0" } */ -/* { dg-require-effective-target powerpc_p9vector_ok } */ -/* { dg-skip-if "" { powerpc*-*-aix* } { "*" } { "" } } */ - -/* Following will match either lxv or lxvx, either stxv or stxvx. - This is purposeful as either is fine. */ -/* { dg-final { scan-assembler-times "lxv" 40 } } */ -/* { dg-final { scan-assembler-times "stxv" 40 } } */ - -#include - -extern vector double vd, *vdp; -extern vector signed long long vsll, *vsllp; -extern vector unsigned long long vull, *vullp; -extern vector float vf, *vfp; -extern vector signed int vsi, *vsip; -extern vector unsigned int vui, *vuip; -extern vector signed short vss, *vssp; -extern vector unsigned short vus, *vusp; -extern vector signed char vsc, *vscp; -extern vector unsigned char vuc, *vucp; -extern double *dp; -extern signed long long *sllp; -extern unsigned long long *ullp; -extern float *fp; -extern signed int *sip; -extern unsigned int *uip; -extern signed short *ssp; -extern unsigned short *usp; -extern signed char *scp; -extern unsigned char *ucp; - -void foo0 (void) -{ - vd = vec_xl (0, vdp); -} - -void foo1 (void) -{ - vsll = vec_xl (0, vsllp); -} - -void foo2 (void) -{ - vull = vec_xl (0, vullp); -} - -void foo3 (void) -{ - vf = vec_xl (0, vfp); -} - -void foo4 (void) -{ - vsi = vec_xl (0, vsip); -} - -void foo5 (void) -{ - vui = vec_xl (0, vuip); -} - -void foo6 (void) -{ - vss = vec_xl (0, vssp); -} - -void foo7 (void) -{ - vus = vec_xl (0, vusp); -} - -void foo8 (void) -{ - vsc = vec_xl (0, vscp); -} - -void foo9 (void) -{ - vuc = vec_xl (0, vucp); -} - -void foo10 (void) -{ - vec_xst (vd, 0, vdp); -} - -void foo11 (void) -{ - vec_xst (vsll, 0, vsllp); -} - -void foo12 (void) -{ - vec_xst (vull, 0, vullp); -} - -void foo13 (void) -{ - vec_xst (vf, 0, vfp); -} - -void foo14 (void) -{ - vec_xst (vsi, 0, vsip); -} - -void foo15 (void) -{ - vec_xst (vui, 0, vuip); -} - -void foo16 (void) -{ - vec_xst (vss, 0, vssp); -} - -void foo17 (void) -{ - vec_xst (vus, 0, vusp); -} - -void foo18 (void) -{ - vec_xst (vsc, 0, vscp); -} - -void foo19 (void) -{ - vec_xst (vuc, 0, vucp); -} - -void foo20 (void) -{ - vd = vec_xl (0, dp); -} - -void foo21 (void) -{ - vsll = vec_xl (0, sllp); -} - -void foo22 (void) -{ - vull = vec_xl (0, ullp); -} - -void foo23 (void) -{ - vf = vec_xl (0, fp); -} - -void foo24 (void) -{ - vsi = vec_xl (0, sip); -} - -void foo25 (void) -{ - vui = vec_xl (0, uip); -} - -void foo26 (void) -{ - vss = vec_xl (0, ssp); -} - -void foo27 (void) -{ - vus = vec_xl (0, usp); -} - -void foo28 (void) -{ - vsc = vec_xl (0, scp); -} - -void foo29 (void) -{ - vuc = vec_xl (0, ucp); -} - -void foo30 (void) -{ - vec_xst (vd, 0, dp); -} - -void foo31 (void) -{ - vec_xst (vsll, 0, sllp); -} - -void foo32 (void) -{ - vec_xst (vull, 0, ullp); -} - -void foo33 (void) -{ - vec_xst (vf, 0, fp); -} - -void foo34 (void) -{ - vec_xst (vsi, 0, sip); -} - -void foo35 (void) -{ - vec_xst (vui, 0, uip); -} - -void foo36 (void) -{ - vec_xst (vss, 0, ssp); -} - -void foo37 (void) -{ - vec_xst (vus, 0, usp); -} - -void foo38 (void) -{ - vec_xst (vsc, 0, scp); -} - -void foo39 (void) -{ - vec_xst (vuc, 0, ucp); -} -- 2.30.2