[Git][ghc/ghc][master] 2 commits: powerpc32: fix 64-bit comparison (#16465)

Marge Bot gitlab at gitlab.haskell.org
Fri May 31 05:57:34 UTC 2019



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
973077ac by Sergei Trofimovich at 2019-05-31T05:57:31Z
powerpc32: fix 64-bit comparison (#16465)

On powerpc32 64-bit comparison code generated dangling
target labels. This caused ghc build failure as:

    $ ./configure --target=powerpc-unknown-linux-gnu && make
    ...
    SCCs aren't in reverse dependent order
    bad blockId n3U

This happened because condIntCode' in PPC codegen generated
label name but did not place the label into `cmp_lo` code block.

The change adds the `cmp_lo` label into the case of negative
comparison.

Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>

- - - - -
bb2ee86a by Sergei Trofimovich at 2019-05-31T05:57:31Z
powerpc32: fix stack allocation code generation

When ghc was built for powerpc32 built failed as:

It's a fallout of commit 3f46cffcc2850e68405a1
("PPC NCG: Refactor stack allocation code") where
word size used to be
    II32/II64
and changed to
    II8/panic "no width for given number of bytes"
    widthFromBytes ((platformWordSize platform) `quot` 8)

The change restores initial behaviour by removing extra division.

Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>

- - - - -


2 changed files:

- compiler/nativeGen/PPC/CodeGen.hs
- compiler/nativeGen/PPC/Instr.hs


Changes:

=====================================
compiler/nativeGen/PPC/CodeGen.hs
=====================================
@@ -949,6 +949,7 @@ condIntCode' True cond W64 x y
                  , BCC LE cmp_lo Nothing
                  , CMPL II32 x_lo (RIReg y_lo)
                  , BCC ALWAYS end_lbl Nothing
+                 , NEWBLOCK cmp_lo
                  , CMPL II32 y_lo (RIReg x_lo)
                  , BCC ALWAYS end_lbl Nothing
 


=====================================
compiler/nativeGen/PPC/Instr.hs
=====================================
@@ -98,7 +98,7 @@ ppc_mkStackAllocInstr' platform amount
     , STU fmt r0 (AddrRegReg sp tmp)
     ]
   where
-    fmt = intFormat $ widthFromBytes ((platformWordSize platform) `quot` 8)
+    fmt = intFormat $ widthFromBytes (platformWordSize platform)
     zero = ImmInt 0
     tmp = tmpReg platform
     immAmount = ImmInt amount



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/0b01a3541e483ea3fcbd6c0f1586a063310b75f9...bb2ee86a4cf47eb56d4b8b4a552537449d492f88

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/0b01a3541e483ea3fcbd6c0f1586a063310b75f9...bb2ee86a4cf47eb56d4b8b4a552537449d492f88
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20190531/ab78aef5/attachment.html>


More information about the ghc-commits mailing list