From: wschmidt Date: Sat, 19 Oct 2013 20:52:34 +0000 (+0000) Subject: 2013-10-19 Bill Schmidt X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=75023973ef1b511cb71a55edca93ba9be81b6350;p=thirdparty%2Fgcc.git 2013-10-19 Bill Schmidt * config/rs6000/rs6000.c (vspltis_constant): Make sure we check all elements for both endian flavors. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@203863 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 78bc3bd56d7f..198b0958c9b2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2013-10-19 Bill Schmidt + + * config/rs6000/rs6000.c (vspltis_constant): Make sure we check + all elements for both endian flavors. + 2013-10-19 Uros Bizjak PR target/58792 diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 7dc68fdf44bd..e05458565439 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -4981,15 +4981,16 @@ vspltis_constant (rtx op, unsigned step, unsigned copies) /* Check if VAL is present in every STEP-th element, and the other elements are filled with its most significant bit. */ - for (i = 0; i < nunits - 1; ++i) + for (i = 1; i < nunits; ++i) { HOST_WIDE_INT desired_val; - if (((BYTES_BIG_ENDIAN ? i + 1 : i) & (step - 1)) == 0) + unsigned elt = BYTES_BIG_ENDIAN ? nunits - 1 - i : i; + if ((i & (step - 1)) == 0) desired_val = val; else desired_val = msb_val; - if (desired_val != const_vector_elt_as_int (op, i)) + if (desired_val != const_vector_elt_as_int (op, elt)) return false; }