From: Erik de Castro Lopo Date: Sat, 16 Jun 2012 15:48:05 +0000 (-0500) Subject: PPC: Handle right shift of > 31 bits. Fix #5900. X-Git-Tag: archive/raspbian/8.0.2-9+rpi1~1^2^2^2^2^2^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=375c4291ee9a0e3532efd030f57295b578fc91c9;p=ghc.git PPC: Handle right shift of > 31 bits. Fix #5900. Gbp-Pq: Name fix-PPC-right-shift-bug --- diff --git a/compiler/nativeGen/PPC/Ppr.hs b/compiler/nativeGen/PPC/Ppr.hs index 26f06c37..8b0bc1e4 100644 --- a/compiler/nativeGen/PPC/Ppr.hs +++ b/compiler/nativeGen/PPC/Ppr.hs @@ -594,6 +594,13 @@ pprInstr platform (NEG reg1 reg2) = pprUnary platform (sLit "neg") reg1 reg2 pprInstr platform (NOT reg1 reg2) = pprUnary platform (sLit "not") reg1 reg2 pprInstr platform (SLW reg1 reg2 ri) = pprLogic platform (sLit "slw") reg1 reg2 (limitShiftRI ri) + +pprInstr platform (SRW reg1 reg2 (RIImm (ImmInt i))) | i > 31 || i < 0 = + -- Handle the case where we are asked to shift a 32 bit register by + -- less than zero or more than 31 bits. We convert this into a clear + -- of the destination register. + -- Fixes ticket http://hackage.haskell.org/trac/ghc/ticket/5900 + pprInstr platform (XOR reg1 reg2 (RIReg reg2)) pprInstr platform (SRW reg1 reg2 ri) = pprLogic platform (sLit "srw") reg1 reg2 (limitShiftRI ri) pprInstr platform (SRAW reg1 reg2 ri) = pprLogic platform (sLit "sraw") reg1 reg2 (limitShiftRI ri) pprInstr platform (RLWINM reg1 reg2 sh mb me) = hcat [