summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Trommler <ptrommler@acm.org>2021-05-16 15:01:52 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-05-19 23:41:22 -0400
commit6a577cf0edb38577e703c9523a4307ae9fa7576d (patch)
tree5e225f4a18f3d94ed415c55eb1039ce97fbbbd4e
parent441fdd6ce8af823e99fd260ed0f96b99e457bce5 (diff)
downloadhaskell-6a577cf0edb38577e703c9523a4307ae9fa7576d.tar.gz
PPC NCG: Fix unsigned compare with 16-bit constants
Fixes #19852 and #19609
-rw-r--r--compiler/GHC/CmmToAsm/PPC/CodeGen.hs3
-rw-r--r--testsuite/tests/ghci/should_run/UnboxedTuples/unboxedtuples.T1
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/CmmToAsm/PPC/CodeGen.hs b/compiler/GHC/CmmToAsm/PPC/CodeGen.hs
index 4be45098be..c821ea71a2 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`
diff --git a/testsuite/tests/ghci/should_run/UnboxedTuples/unboxedtuples.T b/testsuite/tests/ghci/should_run/UnboxedTuples/unboxedtuples.T
index 530c9a4ac9..4166c82f7f 100644
--- a/testsuite/tests/ghci/should_run/UnboxedTuples/unboxedtuples.T
+++ b/testsuite/tests/ghci/should_run/UnboxedTuples/unboxedtuples.T
@@ -1,7 +1,6 @@
test('UnboxedTuples',
[ extra_files(['Obj.hs', 'ByteCode.hs', 'Common.hs-incl']),
req_interp,
- when(arch('powerpc64le'), expect_broken(19609)),
extra_ways(['ghci']),
when(config.have_ext_interp, extra_ways(['ghci', 'ghci-ext'])),
when(config.have_ext_interp and config.have_profiling, extra_ways(['ghci', 'ghci-ext', 'ghci-ext-prof']))