[commit: ghc] master: PPC nativeGen: Add support for MO_SS_Conv_W32_W64 (b37a87b)

git at git.haskell.org git at git.haskell.org
Mon Mar 19 16:39:13 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/b37a87b7ccc7c9b0a9da9aa987733c85050548b0/ghc

>---------------------------------------------------------------

commit b37a87b7ccc7c9b0a9da9aa987733c85050548b0
Author: Peter Trommler <ptrommler at acm.org>
Date:   Mon Mar 19 12:01:37 2018 -0400

    PPC nativeGen: Add support for MO_SS_Conv_W32_W64
    
    This is required by D4363. D4362 has the implementation for i386
    this commit adds PowerPC.
    
    Test Plan: validate
    
    Reviewers: erikd, hvr, simonmar, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie, carter
    
    Differential Revision: https://phabricator.haskell.org/D4468


>---------------------------------------------------------------

b37a87b7ccc7c9b0a9da9aa987733c85050548b0
 compiler/nativeGen/PPC/CodeGen.hs | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/compiler/nativeGen/PPC/CodeGen.hs b/compiler/nativeGen/PPC/CodeGen.hs
index e2c568c..7c345f2 100644
--- a/compiler/nativeGen/PPC/CodeGen.hs
+++ b/compiler/nativeGen/PPC/CodeGen.hs
@@ -382,6 +382,14 @@ iselExpr64 (CmmMachOp (MO_UU_Conv W32 W64) [expr]) = do
         mov_lo = MR rlo expr_reg
     return $ ChildCode64 (expr_code `snocOL` mov_lo `snocOL` mov_hi)
                          rlo
+
+iselExpr64 (CmmMachOp (MO_SS_Conv W32 W64) [expr]) = do
+    (expr_reg,expr_code) <- getSomeReg expr
+    (rlo, rhi) <- getNewRegPairNat II32
+    let mov_hi = SRA II32 rhi expr_reg (RIImm (ImmInt 31))
+        mov_lo = MR rlo expr_reg
+    return $ ChildCode64 (expr_code `snocOL` mov_lo `snocOL` mov_hi)
+                         rlo
 iselExpr64 expr
    = pprPanic "iselExpr64(powerpc)" (pprExpr expr)
 



More information about the ghc-commits mailing list