From: Peter Trommler Date: Tue, 7 Nov 2023 20:47:24 +0000 (+0100) Subject: [PATCH] PPC NCG: Generate clear right insn at arch width X-Git-Tag: archive/raspbian/9.6.6-4+rpi1^2~17 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=15855ce2a7d8e2801dbf23448d71794345aa2c8a;p=ghc.git [PATCH] PPC NCG: Generate clear right insn at arch width The clear right immediate (clrrxi) is only available in word and doubleword width. Generate clrrxi instructions at architecture width for all MachOp widths. Fixes #24145 Gbp-Pq: Name ppc64el-fix-clrri --- diff --git a/compiler/GHC/CmmToAsm/PPC/CodeGen.hs b/compiler/GHC/CmmToAsm/PPC/CodeGen.hs index 0584afef..6f0fe0dd 100644 --- a/compiler/GHC/CmmToAsm/PPC/CodeGen.hs +++ b/compiler/GHC/CmmToAsm/PPC/CodeGen.hs @@ -546,7 +546,7 @@ getRegister' config platform (CmmMachOp mop [x]) -- unary MachOps CLRLI arch_fmt dst src1 (arch_bits - size) return (Any (intFormat to) code) -getRegister' _ _ (CmmMachOp mop [x, y]) -- dyadic PrimOps +getRegister' _ platform (CmmMachOp mop [x, y]) -- dyadic PrimOps = case mop of MO_F_Eq _ -> condFltReg EQQ x y MO_F_Ne _ -> condFltReg NE x y @@ -626,8 +626,9 @@ getRegister' _ _ (CmmMachOp mop [x, y]) -- dyadic PrimOps (src, srcCode) <- getSomeReg x let clear_mask = if imm == -4 then 2 else 3 fmt = intFormat rep + arch_fmt = intFormat (wordWidth platform) code dst = srcCode - `appOL` unitOL (CLRRI fmt dst src clear_mask) + `appOL` unitOL (CLRRI arch_fmt dst src clear_mask) return (Any fmt code) _ -> trivialCode rep False AND x y MO_Or rep -> trivialCode rep False OR x y