summaryrefslogtreecommitdiff
path: root/compiler/GHC/CmmToAsm/PPC/CodeGen.hs
diff options
context:
space:
mode:
authorPeter Trommler <ptrommler@acm.org>2021-05-16 15:01:52 +0200
committerPeter Trommler <ptrommler@acm.org>2021-05-16 18:58:50 +0200
commit429397ffe297cea01a21ff86467d94b78b25d2b5 (patch)
treea47e0e3e07b0adbcf1dc8667435b887f114da2a7 /compiler/GHC/CmmToAsm/PPC/CodeGen.hs
parentfc9546caf3e16db070bfc7bb5523c38595233e26 (diff)
downloadhaskell-wip/T19852.tar.gz
PPC NCG: Fix unsigned compare with 16-bit constantswip/T19852
Fixes #19852 and #19609
Diffstat (limited to 'compiler/GHC/CmmToAsm/PPC/CodeGen.hs')
-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 c3e66c02ac..e3170c1bea 100644
--- a/compiler/GHC/CmmToAsm/PPC/CodeGen.hs
+++ b/compiler/GHC/CmmToAsm/PPC/CodeGen.hs
@@ -978,7 +978,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`