[Git][ghc/ghc][wip/T23576] Try fixing iselExpr64 for MO_Mul

Jaro Reinders (@Noughtmare) gitlab at gitlab.haskell.org
Fri Jun 30 13:53:09 UTC 2023



Jaro Reinders pushed to branch wip/T23576 at Glasgow Haskell Compiler / GHC


Commits:
fca81f47 by Jaro Reinders at 2023-06-30T15:53:02+02:00
Try fixing iselExpr64 for MO_Mul

- - - - -


1 changed file:

- compiler/GHC/CmmToAsm/X86/CodeGen.hs


Changes:

=====================================
compiler/GHC/CmmToAsm/X86/CodeGen.hs
=====================================
@@ -625,17 +625,18 @@ iselExpr64 (CmmMachOp (MO_Mul _) [e1,e2]) = do
    RegCode64 code1 r1hi r1lo <- iselExpr64 e1
    RegCode64 code2 r2hi r2lo <- iselExpr64 e2
    Reg64 rhi rlo <- getNewReg64
+   Reg64 rhi' rlo' <- getNewReg64
    let
         code =  code1 `appOL`
                 code2 `appOL`
-                toOL [ MOV  II32 (OpReg r1lo) (OpReg eax),
-                       MOV  II32 (OpReg r2lo) (OpReg edx),
+                toOL [ MOV  II32 (OpReg r1lo) (OpReg rlo'),
+                       MOV  II32 (OpReg r2lo) (OpReg rhi'),
                        MOV  II32 (OpReg r1hi) (OpReg rhi),
-                       IMUL II32 (OpReg edx) (OpReg rhi),
+                       IMUL II32 (OpReg rhi') (OpReg rhi),
                        MOV  II32 (OpReg r2hi) (OpReg rlo),
-                       IMUL II32 (OpReg eax) (OpReg rlo),
+                       IMUL II32 (OpReg rlo') (OpReg rlo),
                        ADD  II32 (OpReg rlo) (OpReg rhi),
-                       MUL2 II32 (OpReg edx),
+                       MUL2 II32 (OpReg rhi'),
                        ADD  II32 (OpReg edx) (OpReg rhi),
                        MOV  II32 (OpReg eax) (OpReg rlo)
                      ]



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fca81f47f3256c2a56823c7ee7f11425498af059

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fca81f47f3256c2a56823c7ee7f11425498af059
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/20230630/4a1d42ac/attachment-0001.html>


More information about the ghc-commits mailing list