summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/GHC/CmmToAsm/PPC/CodeGen.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/GHC/CmmToAsm/PPC/CodeGen.hs b/compiler/GHC/CmmToAsm/PPC/CodeGen.hs
index 367faa25bc..516a3840b6 100644
--- a/compiler/GHC/CmmToAsm/PPC/CodeGen.hs
+++ b/compiler/GHC/CmmToAsm/PPC/CodeGen.hs
@@ -981,7 +981,8 @@ condIntCode' _ cond width x (CmmLit (CmmInt y rep))
| Just src2 <- makeImmediate rep (not $ condUnsigned cond) y
= do
let op_len = max W32 width
- let extend = extendSExpr width op_len
+ let extend = if condUnsigned cond then extendUExpr width op_len
+ else extendSExpr width op_len
(src1, code) <- getSomeReg (extend x)
let format = intFormat op_len
code' = code `snocOL`