public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r9-8915] rs6000: Properly handle LE index munging in vec_shr (PR94710)
@ 2020-09-17 21:50 Segher Boessenkool
  0 siblings, 0 replies; only message in thread
From: Segher Boessenkool @ 2020-09-17 21:50 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:336b4100940a9db7825b96d450a21040ae11b7b9

commit r9-8915-g336b4100940a9db7825b96d450a21040ae11b7b9
Author: Segher Boessenkool <segher@kernel.crashing.org>
Date:   Fri Apr 24 13:33:14 2020 +0000

    rs6000: Properly handle LE index munging in vec_shr (PR94710)
    
    The PR shows the compiler crashing with -mvsx -mlittle -O0.  This turns
    out to be caused by a failure to make of the higher bits in an index
    endian conversion.
    
    2020-04-24  Segher Boessenkool  <segher@kernel.crashing.org>
    
            PR target/94710
            * config/rs6000/vector.md (vec_shr_<mode> for VEC_L): Correct little
            endian byteshift_val calculation.
    
    (cherry picked from commit 9c725245beed2f056b67f5dc218fef6cb869c5f2)

Diff:
---
 gcc/config/rs6000/vector.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/config/rs6000/vector.md b/gcc/config/rs6000/vector.md
index 0b62dd04bde..f90489c0203 100644
--- a/gcc/config/rs6000/vector.md
+++ b/gcc/config/rs6000/vector.md
@@ -1322,7 +1322,8 @@
   emit_move_insn (zero_reg, CONST0_RTX (<MODE>mode));
   if (!BYTES_BIG_ENDIAN)
     {
-      byteshift_val = 16 - byteshift_val;
+      /* Note, byteshift_val can be 0!  */
+      byteshift_val = -byteshift_val & 15;
       op1 = zero_reg;
       op2 = operands[1];
     }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-17 21:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-17 21:50 [gcc r9-8915] rs6000: Properly handle LE index munging in vec_shr (PR94710) Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).