[Git][ghc/ghc][wip/T23576] Add MO_SS_Conv W16/W8 W64

Jaro Reinders (@Noughtmare) gitlab at gitlab.haskell.org
Mon Jul 3 15:39:26 UTC 2023



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


Commits:
08553be2 by Jaro Reinders at 2023-07-03T17:39:18+02:00
Add MO_SS_Conv W16/W8 W64

- - - - -


1 changed file:

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


Changes:

=====================================
compiler/GHC/CmmToAsm/X86/CodeGen.hs
=====================================
@@ -610,6 +610,28 @@ iselExpr64 (CmmMachOp (MO_SS_Conv W32 W64) [expr]) = do
                           r_dst_hi
                           r_dst_lo
 
+iselExpr64 (CmmMachOp (MO_SS_Conv W16 W64) [expr]) = do
+     code <- getAnyReg expr
+     Reg64 r_dst_hi r_dst_lo <- getNewReg64
+     return $ RegCode64 (code r_dst_lo `snocOL`
+                          MOV II16 (OpReg r_dst_lo) (OpReg eax) `snocOL`
+                          CLTD II16 `snocOL`
+                          MOV II32 (OpReg eax) (OpReg r_dst_lo) `snocOL`
+                          MOV II32 (OpReg edx) (OpReg r_dst_hi))
+                          r_dst_hi
+                          r_dst_lo
+
+iselExpr64 (CmmMachOp (MO_SS_Conv W8 W64) [expr]) = do
+     code <- getAnyReg expr
+     Reg64 r_dst_hi r_dst_lo <- getNewReg64
+     return $ RegCode64 (code r_dst_lo `snocOL`
+                          MOV II8 (OpReg r_dst_lo) (OpReg eax) `snocOL`
+                          CLTD II8 `snocOL`
+                          MOV II32 (OpReg eax) (OpReg r_dst_lo) `snocOL`
+                          MOV II32 (OpReg edx) (OpReg r_dst_hi))
+                          r_dst_hi
+                          r_dst_lo
+
 iselExpr64 (CmmMachOp (MO_S_Neg _) [expr]) = do
    RegCode64 code rhi rlo <- iselExpr64 expr
    Reg64 rohi rolo <- getNewReg64



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/08553be2b8223389584146da8d5ffa06da022da0
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/20230703/d8ab4b43/attachment-0001.html>


More information about the ghc-commits mailing list