Commit 5241f298 authored by Peter Trommler's avatar Peter Trommler 🥁 Committed by Ben Gamari

SPARC nativeGen: Support for MO_SS_Conv_W32_W64

Support for signed conversion from 32 bit to 64 bit
integers is required by D4363.

Test Plan: validate (perhaps also on SPARC)

Reviewers: simonmar, bgamari, kgardas, jrtc27

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

Differential Revision: https://phabricator.haskell.org/D4489
parent b37a87b7
......@@ -193,6 +193,24 @@ iselExpr64 (CmmMachOp (MO_UU_Conv _ W64) [expr])
return $ ChildCode64 code r_dst_lo
-- only W32 supported for now
iselExpr64 (CmmMachOp (MO_SS_Conv W32 W64) [expr])
= do
r_dst_lo <- getNewRegNat II32
let r_dst_hi = getHiVRegFromLo r_dst_lo
-- compute expr and load it into r_dst_lo
(a_reg, a_code) <- getSomeReg expr
dflags <- getDynFlags
let platform = targetPlatform dflags
code = a_code
`appOL` toOL
[ SRA a_reg (RIImm (ImmInt 31)) r_dst_hi
, mkRegRegMoveInstr platform a_reg r_dst_lo ]
return $ ChildCode64 code r_dst_lo
iselExpr64 expr
= pprPanic "iselExpr64(sparc)" (ppr expr)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment