diff options
author | Peter Trommler <ptrommler@acm.org> | 2021-05-16 15:01:52 +0200 |
---|---|---|
committer | Peter Trommler <ptrommler@acm.org> | 2021-06-21 18:31:50 +0000 |
commit | aa3bbb77632b7371ef2b138f71e64ad16aa526b1 (patch) | |
tree | 0e5daa6579720be98eb9e0fd39fb584d2954df25 | |
parent | 7927a1cbb5a52a054cb510e8e3c4e11c198d3917 (diff) | |
download | haskell-wip/T19852-backport-9.2.tar.gz |
PPC NCG: Fix unsigned compare with 16-bit constantswip/T19852-backport-9.2
Fixes #19852 and #19609
-rw-r--r-- | compiler/GHC/CmmToAsm/PPC/CodeGen.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/GHC/CmmToAsm/PPC/CodeGen.hs b/compiler/GHC/CmmToAsm/PPC/CodeGen.hs index 0a78722c85..baa874fc30 100644 --- a/compiler/GHC/CmmToAsm/PPC/CodeGen.hs +++ b/compiler/GHC/CmmToAsm/PPC/CodeGen.hs @@ -982,7 +982,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` |