[commit: ghc] master: Call expandCallishMachOp in the x86_64 codegen too (7d8b2c1)

Ian Lynagh igloo at earth.li
Fri Feb 24 03:46:22 CET 2012


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/7d8b2c18eeb166ea64504fb3a8022edd6b36e870

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

commit 7d8b2c18eeb166ea64504fb3a8022edd6b36e870
Author: Ian Lynagh <igloo at earth.li>
Date:   Thu Feb 23 15:25:51 2012 +0000

    Call expandCallishMachOp in the x86_64 codegen too
    
    Currently it does nothing, as x86_64 supports all the callishMachOps
    that expandCallishMachOp expands, but it might be needed in the future.

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

 compiler/nativeGen/X86/CodeGen.hs |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/compiler/nativeGen/X86/CodeGen.hs b/compiler/nativeGen/X86/CodeGen.hs
index ec6bf59..7a3f93d 100644
--- a/compiler/nativeGen/X86/CodeGen.hs
+++ b/compiler/nativeGen/X86/CodeGen.hs
@@ -1844,6 +1844,10 @@ genCCall64 target dest_regs args =
     (CmmPrim (MO_S_QuotRem width), _) -> divOp True  width dest_regs args
     (CmmPrim (MO_U_QuotRem width), _) -> divOp False width dest_regs args
 
+    (CmmPrim op, results)
+     | Just stmts <- expandCallishMachOp op results args ->
+        stmtsToInstrs stmts
+
     _ -> genCCall64' target dest_regs args
 
   where divOp signed width [CmmHinted res_q _, CmmHinted res_r _]





More information about the Cvs-ghc mailing list