mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-22 21:31:19 +08:00
re PR target/31334 (Bad codegen for vector initializer with constants prop'd into a vector initializer)
2008-03-28 Andrew Pinski <andrew_pinski@playstation.sony.com> PR target/31334 * config/rs6000/rs6000.c (rs6000_expand_vector_init): Create a const_vector when all the vectors are constant. 2008-03-28 Andrew Pinski <andrew_pinski@playstation.sony.com> PR target/31334 * gcc.target/powerpc/altivec-25.c: Nnew testcase. From-SVN: r133674
This commit is contained in:
parent
15f4eb4428
commit
501fb355e6
@ -1,3 +1,9 @@
|
||||
2008-03-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
|
||||
|
||||
PR target/31334
|
||||
* config/rs6000/rs6000.c (rs6000_expand_vector_init): Create a
|
||||
const_vector when all the vectors are constant.
|
||||
|
||||
2008-03-27 Bob Wilson <bob.wilson@acm.org>
|
||||
|
||||
* config/xtensa/xtensa.c (gen_float_relational): Handle unordered
|
||||
|
@ -2965,6 +2965,7 @@ rs6000_expand_vector_init (rtx target, rtx vals)
|
||||
|
||||
if (n_var == 0)
|
||||
{
|
||||
rtx const_vec = gen_rtx_CONST_VECTOR (mode, XVEC (vals, 0));
|
||||
if (mode != V4SFmode && all_const_zero)
|
||||
{
|
||||
/* Zero register. */
|
||||
@ -2972,10 +2973,10 @@ rs6000_expand_vector_init (rtx target, rtx vals)
|
||||
gen_rtx_XOR (mode, target, target)));
|
||||
return;
|
||||
}
|
||||
else if (mode != V4SFmode && easy_vector_constant (vals, mode))
|
||||
else if (mode != V4SFmode && easy_vector_constant (const_vec, mode))
|
||||
{
|
||||
/* Splat immediate. */
|
||||
emit_insn (gen_rtx_SET (VOIDmode, target, vals));
|
||||
emit_insn (gen_rtx_SET (VOIDmode, target, const_vec));
|
||||
return;
|
||||
}
|
||||
else if (all_same)
|
||||
@ -2983,7 +2984,7 @@ rs6000_expand_vector_init (rtx target, rtx vals)
|
||||
else
|
||||
{
|
||||
/* Load from constant pool. */
|
||||
emit_move_insn (target, gen_rtx_CONST_VECTOR (mode, XVEC (vals, 0)));
|
||||
emit_move_insn (target, const_vec);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,8 @@
|
||||
2008-03-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
|
||||
|
||||
PR target/31334
|
||||
* gcc.target/powerpc/altivec-25.c: Nnew testcase.
|
||||
|
||||
2008-03-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
|
||||
PR fortran/35724
|
||||
|
20
gcc/testsuite/gcc.target/powerpc/altivec-25.c
Normal file
20
gcc/testsuite/gcc.target/powerpc/altivec-25.c
Normal file
@ -0,0 +1,20 @@
|
||||
/* { dg-do compile { target powerpc*-*-* } } */
|
||||
/* { dg-require-effective-target powerpc_altivec_ok } */
|
||||
/* { dg-options "-maltivec -O2 -Wall" } */
|
||||
|
||||
|
||||
#define vector __attribute__((__vector_size__(16) ))
|
||||
vector int f()
|
||||
{
|
||||
int t = 4;
|
||||
return (vector int){t,t,t,t};
|
||||
}
|
||||
vector int f1()
|
||||
{
|
||||
return (vector int){4,4,4,4};
|
||||
}
|
||||
|
||||
/* We should be able to materialize the constant vector without
|
||||
any lvewx instructions as it is constant. */
|
||||
/* { dg-final { scan-assembler-not "lvewx" } } */
|
||||
|
Loading…
x
Reference in New Issue
Block a user