backport: re PR target/91275 (__builtin_crypto_vpmsumd gives different results -O[123] vs -O0)

[gcc]

2019-10-07  Bill Schmidt  <wschmidt@linux.ibm.com>

	Backport from mainline
	2019-10-01  Bill Schmidt  <wschmidt@linux.ibm.com>

	PR target/91275
	* config/rs6000/rs6000.c (rtx_is_swappable_p): Don't swap
	vpmsumd.

[gcc/testsuite]

2019-10-07  Bill Schmidt  <wschmidt@linux.ibm.com>

	Backport from mainline
	2019-10-01  Bill Schmidt  <wschmdit@linux.ibm.com>

	PR target/91275
	* gcc.target/powerpc/pr91275.c: New.

From-SVN: r276678
This commit is contained in:
Bill Schmidt 2019-10-07 20:50:05 +00:00 committed by William Schmidt
parent 9e8661ee99
commit 2cd5a89bc4
4 changed files with 43 additions and 0 deletions

View File

@ -1,3 +1,12 @@
2019-10-07 Bill Schmidt <wschmidt@linux.ibm.com>
Backport from mainline
2019-10-01 Bill Schmidt <wschmidt@linux.ibm.com>
PR target/91275
* config/rs6000/rs6000.c (rtx_is_swappable_p): Don't swap
vpmsumd.
2019-10-01 Oleg Endo <olegendo@gcc.gnu.org>
Backport from mainline

View File

@ -42005,6 +42005,11 @@ rtx_is_swappable_p (rtx op, unsigned int *special)
case UNSPEC_REDUC_PLUS:
case UNSPEC_REDUC:
return 1;
case UNSPEC_VPMSUM:
/* vpmsumd is not swappable, but vpmsum[bhw] are. */
if (GET_MODE (op) == V2DImode)
return 0;
break;
}
}

View File

@ -1,3 +1,11 @@
2019-10-07 Bill Schmidt <wschmidt@linux.ibm.com>
Backport from mainline
2019-10-01 Bill Schmidt <wschmdit@linux.ibm.com>
PR target/91275
* gcc.target/powerpc/pr91275.c: New.
2019-09-28 Iain Sandoe <iain@sandoe.co.uk>
PR target/82920

View File

@ -0,0 +1,21 @@
/* Test that we generate vpmsumd correctly without a swap error. */
/* { dg-do run { target { p8vector_hw } } } */
/* { dg-options "-O2 -std=gnu11" } */
#include <altivec.h>
int main() {
const unsigned long long r0l = 0x8e7dfceac070e3a0;
vector unsigned long long r0 = (vector unsigned long long) {r0l, 0}, v;
const vector unsigned long long pd
= (vector unsigned long) {0xc2LLU << 56, 0};
v = __builtin_crypto_vpmsumd ((vector unsigned long long) {r0[0], 0}, pd);
if (v[0] != 0x4000000000000000 || v[1] != 0x65bd7ab605a4a8ff)
__builtin_abort ();
return 0;
}