From d27336edcf2667c3c3908694247861beec3fc29b Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Mon, 19 Mar 2018 12:02:29 -0400 Subject: [RFC] nativeGen: Add support for MO_SS_Conv_W32_W64 on i386 This is required by D4288. However, this only handles i386; we will likely also need to do the same for PPC and SPARC, lest they break when D4288 is re-merged. Test Plan: Validate Reviewers: simonmar Reviewed By: simonmar Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4362 --- compiler/nativeGen/X86/CodeGen.hs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'compiler/nativeGen') diff --git a/compiler/nativeGen/X86/CodeGen.hs b/compiler/nativeGen/X86/CodeGen.hs index 09757e769e..a0b0673d27 100644 --- a/compiler/nativeGen/X86/CodeGen.hs +++ b/compiler/nativeGen/X86/CodeGen.hs @@ -468,6 +468,20 @@ iselExpr64 (CmmMachOp (MO_UU_Conv _ W64) [expr]) = do r_dst_lo ) +iselExpr64 (CmmMachOp (MO_SS_Conv W32 W64) [expr]) = do + fn <- getAnyReg expr + r_dst_lo <- getNewRegNat II32 + let r_dst_hi = getHiVRegFromLo r_dst_lo + code = fn r_dst_lo + return ( + ChildCode64 (code `snocOL` + MOV II32 (OpReg r_dst_lo) (OpReg eax) `snocOL` + CLTD II32 `snocOL` + MOV II32 (OpReg eax) (OpReg r_dst_lo) `snocOL` + MOV II32 (OpReg edx) (OpReg r_dst_hi)) + r_dst_lo + ) + iselExpr64 expr = pprPanic "iselExpr64(i386)" (ppr expr) -- cgit v1.2.1