S/390: PR69247: Fix bswap hi splitter.

gcc/ChangeLog:

2016-01-13  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	PR target/69247
	* config/s390/s390.md (bswaphi splitter): Use simplify_gen_subreg.

gcc/testsuite/ChangeLog:

2016-01-13  Jakub Jelinek  <jakub@redhat.com>

	PR target/69247
	* gcc.dg/pr69247.c: New test.

From-SVN: r232318
This commit is contained in:
Andreas Krebbel 2016-01-13 11:59:29 +00:00
parent e862906c25
commit 9060e33505
4 changed files with 26 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2016-01-13 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
PR target/69247
* config/s390/s390.md (bswaphi splitter): Use simplify_gen_subreg.
2016-01-13 Richard Biener <rguenther@suse.de>
PR tree-optimization/69242

View File

@ -10522,11 +10522,9 @@
(bswap:HI (match_operand:HI 1 "register_operand" "")))]
"TARGET_CPU_ZARCH"
[(set (match_dup 2) (bswap:SI (match_dup 3)))
(set (match_dup 2) (lshiftrt:SI (match_dup 2)
(const_int 16)))
(set (match_dup 0) (subreg:HI (match_dup 2) 2))]
(set (match_dup 2) (lshiftrt:SI (match_dup 2) (const_int 16)))]
{
operands[2] = gen_reg_rtx (SImode);
operands[2] = simplify_gen_subreg (SImode, operands[0], HImode, 0);
operands[3] = simplify_gen_subreg (SImode, operands[1], HImode, 0);
})

View File

@ -1,3 +1,8 @@
2016-01-13 Jakub Jelinek <jakub@redhat.com>
PR target/69247
* gcc.dg/pr69247.c: New test.
2016-01-13 Richard Biener <rguenther@suse.de>
PR tree-optimization/69242

View File

@ -0,0 +1,14 @@
/* PR target/69247 */
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-additional-options "-march=zEC12" { target s390*-*-* } } */
void foo (short *);
void
bar (short x, int y)
{
if (y)
x = x << 8 | (unsigned short) x >> 8;
foo (&x);
}