From: Michael Meissner Date: Wed, 30 Nov 2016 18:43:17 +0000 (+0000) Subject: re PR target/78602 (PowerPC vec-extract-v2df.c can fail if -mcpu=power9 -O0) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bc28bbb60e30a7aeb401e8a49c73e008929d216f;p=gcc.git re PR target/78602 (PowerPC vec-extract-v2df.c can fail if -mcpu=power9 -O0) 2016-11-30 Michael Meissner PR target/78602 * config/rs6000/rs6000.c (rs6000_expand_vector_extract): If the element is not a constant or in a register, force it to a register. PR target/78560 * config/rs6000/rs6000.c (rs6000_expand_vector_set): Force value that will be set to a vector element to be in a register. * config/rs6000/vsx.md (vsx_set__p9): Fix thinko that used the wrong multiplier to convert the element number to a byte offset. From-SVN: r243044 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6abb47ff0a7..7a46cd22253 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +2016-11-30 Michael Meissner + + PR target/78602 + * config/rs6000/rs6000.c (rs6000_expand_vector_extract): If the + element is not a constant or in a register, force it to a + register. + + PR target/78560 + * config/rs6000/rs6000.c (rs6000_expand_vector_set): Force value + that will be set to a vector element to be in a register. + * config/rs6000/vsx.md (vsx_set__p9): Fix thinko that used + the wrong multiplier to convert the element number to a byte + offset. + 2016-11-30 Vladimir Makarov PR tree-optimization/77856 diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 0a6a784a940..9fe98b7dd6a 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -7105,6 +7105,8 @@ rs6000_expand_vector_set (rtx target, rtx val, int elt) int width = GET_MODE_SIZE (inner_mode); int i; + val = force_reg (GET_MODE (val), val); + if (VECTOR_MEM_VSX_P (mode)) { rtx insn = NULL_RTX; @@ -7257,6 +7259,8 @@ rs6000_expand_vector_extract (rtx target, rtx vec, rtx elt) convert_move (tmp, elt, 0); elt = tmp; } + else if (!REG_P (elt)) + elt = force_reg (DImode, elt); switch (mode) { diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md index 75c16252f8c..01d275d168e 100644 --- a/gcc/config/rs6000/vsx.md +++ b/gcc/config/rs6000/vsx.md @@ -2856,7 +2856,7 @@ if (!VECTOR_ELT_ORDER_BIG) ele = nunits - 1 - ele; - operands[3] = GEN_INT (nunits * ele); + operands[3] = GEN_INT (GET_MODE_SIZE (mode) * ele); if (mode == V4SImode) return "xxinsertw %x0,%x2,%3"; else