Commit 730301c6 authored by Ian Lynagh's avatar Ian Lynagh

Remove more defaultTargetPlatform uses

parent 5c718b15
...@@ -245,7 +245,7 @@ nativeCodeGen' dflags ncgImpl h us cmms ...@@ -245,7 +245,7 @@ nativeCodeGen' dflags ncgImpl h us cmms
dumpIfSet_dyn dflags dumpIfSet_dyn dflags
Opt_D_dump_asm_conflicts "Register conflict graph" Opt_D_dump_asm_conflicts "Register conflict graph"
$ Color.dotGraph $ Color.dotGraph
targetRegDotColor (targetRegDotColor platform)
(Color.trivColorable platform (Color.trivColorable platform
(targetVirtualRegSqueeze platform) (targetVirtualRegSqueeze platform)
(targetRealRegSqueeze platform)) (targetRealRegSqueeze platform))
...@@ -386,7 +386,7 @@ cmmNativeGen dflags ncgImpl us cmm count ...@@ -386,7 +386,7 @@ cmmNativeGen dflags ncgImpl us cmm count
-- the regs usable for allocation -- the regs usable for allocation
let (alloc_regs :: UniqFM (UniqSet RealReg)) let (alloc_regs :: UniqFM (UniqSet RealReg))
= foldr (\r -> plusUFM_C unionUniqSets = foldr (\r -> plusUFM_C unionUniqSets
$ unitUFM (targetClassOfRealReg r) (unitUniqSet r)) $ unitUFM (targetClassOfRealReg platform r) (unitUniqSet r))
emptyUFM emptyUFM
$ allocatableRegs ncgImpl $ allocatableRegs ncgImpl
......
...@@ -14,6 +14,7 @@ import Reg ...@@ -14,6 +14,7 @@ import Reg
import BlockId import BlockId
import OldCmm import OldCmm
import Platform
-- | Holds a list of source and destination registers used by a -- | Holds a list of source and destination registers used by a
-- particular instruction. -- particular instruction.
...@@ -103,7 +104,8 @@ class Instruction instr where ...@@ -103,7 +104,8 @@ class Instruction instr where
-- | An instruction to spill a register into a spill slot. -- | An instruction to spill a register into a spill slot.
mkSpillInstr mkSpillInstr
:: Reg -- ^ the reg to spill :: Platform
-> Reg -- ^ the reg to spill
-> Int -- ^ the current stack delta -> Int -- ^ the current stack delta
-> Int -- ^ spill slot to use -> Int -- ^ spill slot to use
-> instr -> instr
...@@ -111,7 +113,8 @@ class Instruction instr where ...@@ -111,7 +113,8 @@ class Instruction instr where
-- | An instruction to reload a register from a spill slot. -- | An instruction to reload a register from a spill slot.
mkLoadInstr mkLoadInstr
:: Reg -- ^ the reg to reload. :: Platform
-> Reg -- ^ the reg to reload.
-> Int -- ^ the current stack delta -> Int -- ^ the current stack delta
-> Int -- ^ the spill slot to use -> Int -- ^ the spill slot to use
-> instr -> instr
...@@ -137,7 +140,8 @@ class Instruction instr where ...@@ -137,7 +140,8 @@ class Instruction instr where
-- | Copy the value in a register to another one. -- | Copy the value in a register to another one.
-- Must work for all register classes. -- Must work for all register classes.
mkRegRegMoveInstr mkRegRegMoveInstr
:: Reg -- ^ source register :: Platform
-> Reg -- ^ source register
-> Reg -- ^ destination register -> Reg -- ^ destination register
-> instr -> instr
......
...@@ -130,18 +130,20 @@ getNewLabelNat ...@@ -130,18 +130,20 @@ getNewLabelNat
getNewRegNat :: Size -> NatM Reg getNewRegNat :: Size -> NatM Reg
getNewRegNat rep getNewRegNat rep
= do u <- getUniqueNat = do u <- getUniqueNat
return (RegVirtual $ targetMkVirtualReg u rep) dflags <- getDynFlagsNat
return (RegVirtual $ targetMkVirtualReg (targetPlatform dflags) u rep)
getNewRegPairNat :: Size -> NatM (Reg,Reg) getNewRegPairNat :: Size -> NatM (Reg,Reg)
getNewRegPairNat rep getNewRegPairNat rep
= do u <- getUniqueNat = do u <- getUniqueNat
let vLo = targetMkVirtualReg u rep dflags <- getDynFlagsNat
let lo = RegVirtual $ targetMkVirtualReg u rep let vLo = targetMkVirtualReg (targetPlatform dflags) u rep
let hi = RegVirtual $ getHiVirtualRegFromLo vLo let lo = RegVirtual $ targetMkVirtualReg (targetPlatform dflags) u rep
return (lo, hi) let hi = RegVirtual $ getHiVirtualRegFromLo vLo
return (lo, hi)
getPicBaseMaybeNat :: NatM (Maybe Reg) getPicBaseMaybeNat :: NatM (Maybe Reg)
......
...@@ -404,11 +404,12 @@ getRegister' dflags (CmmMachOp (MO_SS_Conv W64 W32) [x]) ...@@ -404,11 +404,12 @@ getRegister' dflags (CmmMachOp (MO_SS_Conv W64 W32) [x])
ChildCode64 code rlo <- iselExpr64 x ChildCode64 code rlo <- iselExpr64 x
return $ Fixed II32 rlo code return $ Fixed II32 rlo code
getRegister' _ (CmmLoad mem pk) getRegister' dflags (CmmLoad mem pk)
| not (isWord64 pk) | not (isWord64 pk)
= do = do
let platform = targetPlatform dflags
Amode addr addr_code <- getAmode mem Amode addr addr_code <- getAmode mem
let code dst = ASSERT((targetClassOfReg dst == RcDouble) == isFloatType pk) let code dst = ASSERT((targetClassOfReg platform dst == RcDouble) == isFloatType pk)
addr_code `snocOL` LD size dst addr addr_code `snocOL` LD size dst addr
return (Any size code) return (Any size code)
where size = cmmTypeSize pk where size = cmmTypeSize pk
......
...@@ -32,6 +32,7 @@ import OldCmm ...@@ -32,6 +32,7 @@ import OldCmm
import FastString import FastString
import CLabel import CLabel
import Outputable import Outputable
import Platform
import FastBool import FastBool
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
...@@ -43,18 +44,18 @@ archWordSize = II32 ...@@ -43,18 +44,18 @@ archWordSize = II32
-- | Instruction instance for powerpc -- | Instruction instance for powerpc
instance Instruction Instr where instance Instruction Instr where
regUsageOfInstr = ppc_regUsageOfInstr regUsageOfInstr = ppc_regUsageOfInstr
patchRegsOfInstr = ppc_patchRegsOfInstr patchRegsOfInstr = ppc_patchRegsOfInstr
isJumpishInstr = ppc_isJumpishInstr isJumpishInstr = ppc_isJumpishInstr
jumpDestsOfInstr = ppc_jumpDestsOfInstr jumpDestsOfInstr = ppc_jumpDestsOfInstr
patchJumpInstr = ppc_patchJumpInstr patchJumpInstr = ppc_patchJumpInstr
mkSpillInstr = ppc_mkSpillInstr mkSpillInstr = ppc_mkSpillInstr
mkLoadInstr = ppc_mkLoadInstr mkLoadInstr = ppc_mkLoadInstr
takeDeltaInstr = ppc_takeDeltaInstr takeDeltaInstr = ppc_takeDeltaInstr
isMetaInstr = ppc_isMetaInstr isMetaInstr = ppc_isMetaInstr
mkRegRegMoveInstr = ppc_mkRegRegMoveInstr mkRegRegMoveInstr _ = ppc_mkRegRegMoveInstr
takeRegRegMoveInstr = ppc_takeRegRegMoveInstr takeRegRegMoveInstr = ppc_takeRegRegMoveInstr
mkJumpInstr = ppc_mkJumpInstr mkJumpInstr = ppc_mkJumpInstr
-- ----------------------------------------------------------------------------- -- -----------------------------------------------------------------------------
...@@ -346,15 +347,16 @@ ppc_patchJumpInstr insn patchF ...@@ -346,15 +347,16 @@ ppc_patchJumpInstr insn patchF
-- | An instruction to spill a register into a spill slot. -- | An instruction to spill a register into a spill slot.
ppc_mkSpillInstr ppc_mkSpillInstr
:: Reg -- register to spill :: Platform
-> Int -- current stack delta -> Reg -- register to spill
-> Int -- spill slot to use -> Int -- current stack delta
-> Int -- spill slot to use
-> Instr -> Instr
ppc_mkSpillInstr reg delta slot ppc_mkSpillInstr platform reg delta slot
= let off = spillSlotToOffset slot = let off = spillSlotToOffset slot
in in
let sz = case targetClassOfReg reg of let sz = case targetClassOfReg platform reg of
RcInteger -> II32 RcInteger -> II32
RcDouble -> FF64 RcDouble -> FF64
_ -> panic "PPC.Instr.mkSpillInstr: no match" _ -> panic "PPC.Instr.mkSpillInstr: no match"
...@@ -362,15 +364,16 @@ ppc_mkSpillInstr reg delta slot ...@@ -362,15 +364,16 @@ ppc_mkSpillInstr reg delta slot
ppc_mkLoadInstr ppc_mkLoadInstr
:: Reg -- register to load :: Platform
-> Int -- current stack delta -> Reg -- register to load
-> Int -- spill slot to use -> Int -- current stack delta
-> Int -- spill slot to use
-> Instr -> Instr
ppc_mkLoadInstr reg delta slot ppc_mkLoadInstr platform reg delta slot
= let off = spillSlotToOffset slot = let off = spillSlotToOffset slot
in in
let sz = case targetClassOfReg reg of let sz = case targetClassOfReg platform reg of
RcInteger -> II32 RcInteger -> II32
RcDouble -> FF64 RcDouble -> FF64
_ -> panic "PPC.Instr.mkLoadInstr: no match" _ -> panic "PPC.Instr.mkLoadInstr: no match"
......
...@@ -58,12 +58,12 @@ pprNatCmmTop _ (CmmData section dats) = ...@@ -58,12 +58,12 @@ pprNatCmmTop _ (CmmData section dats) =
pprNatCmmTop _ (CmmProc Nothing lbl (ListGraph [])) = pprLabel lbl pprNatCmmTop _ (CmmProc Nothing lbl (ListGraph [])) = pprLabel lbl
-- special case for code without an info table: -- special case for code without an info table:
pprNatCmmTop _ (CmmProc Nothing lbl (ListGraph blocks)) = pprNatCmmTop platform (CmmProc Nothing lbl (ListGraph blocks)) =
pprSectionHeader Text $$ pprSectionHeader Text $$
pprLabel lbl $$ -- blocks guaranteed not null, so label needed pprLabel lbl $$ -- blocks guaranteed not null, so label needed
vcat (map pprBasicBlock blocks) vcat (map (pprBasicBlock platform) blocks)
pprNatCmmTop _ (CmmProc (Just (Statics info_lbl info)) _entry_lbl (ListGraph blocks)) = pprNatCmmTop platform (CmmProc (Just (Statics info_lbl info)) _entry_lbl (ListGraph blocks)) =
pprSectionHeader Text $$ pprSectionHeader Text $$
( (
#if HAVE_SUBSECTIONS_VIA_SYMBOLS #if HAVE_SUBSECTIONS_VIA_SYMBOLS
...@@ -73,7 +73,7 @@ pprNatCmmTop _ (CmmProc (Just (Statics info_lbl info)) _entry_lbl (ListGraph blo ...@@ -73,7 +73,7 @@ pprNatCmmTop _ (CmmProc (Just (Statics info_lbl info)) _entry_lbl (ListGraph blo
vcat (map pprData info) $$ vcat (map pprData info) $$
pprLabel info_lbl pprLabel info_lbl
) $$ ) $$
vcat (map pprBasicBlock blocks) vcat (map (pprBasicBlock platform) blocks)
-- above: Even the first block gets a label, because with branch-chain -- above: Even the first block gets a label, because with branch-chain
-- elimination, it might be the target of a goto. -- elimination, it might be the target of a goto.
#if HAVE_SUBSECTIONS_VIA_SYMBOLS #if HAVE_SUBSECTIONS_VIA_SYMBOLS
...@@ -90,10 +90,10 @@ pprNatCmmTop _ (CmmProc (Just (Statics info_lbl info)) _entry_lbl (ListGraph blo ...@@ -90,10 +90,10 @@ pprNatCmmTop _ (CmmProc (Just (Statics info_lbl info)) _entry_lbl (ListGraph blo
#endif #endif
pprBasicBlock :: NatBasicBlock Instr -> Doc pprBasicBlock :: Platform -> NatBasicBlock Instr -> Doc
pprBasicBlock (BasicBlock blockid instrs) = pprBasicBlock platform (BasicBlock blockid instrs) =
pprLabel (mkAsmTempLabel (getUnique blockid)) $$ pprLabel (mkAsmTempLabel (getUnique blockid)) $$
vcat (map pprInstr instrs) vcat (map (pprInstr platform) instrs)
...@@ -143,7 +143,7 @@ pprASCII str ...@@ -143,7 +143,7 @@ pprASCII str
-- pprInstr: print an 'Instr' -- pprInstr: print an 'Instr'
instance PlatformOutputable Instr where instance PlatformOutputable Instr where
pprPlatform _ instr = Outputable.docToSDoc $ pprInstr instr pprPlatform platform instr = Outputable.docToSDoc $ pprInstr platform instr
pprReg :: Reg -> Doc pprReg :: Reg -> Doc
...@@ -337,26 +337,26 @@ pprDataItem lit ...@@ -337,26 +337,26 @@ pprDataItem lit
= panic "PPC.Ppr.pprDataItem: no match" = panic "PPC.Ppr.pprDataItem: no match"
pprInstr :: Instr -> Doc pprInstr :: Platform -> Instr -> Doc
pprInstr (COMMENT _) = empty -- nuke 'em pprInstr _ (COMMENT _) = empty -- nuke 'em
{- {-
pprInstr (COMMENT s) pprInstr _ (COMMENT s)
IF_OS_linux( IF_OS_linux(
((<>) (ptext (sLit "# ")) (ftext s)), ((<>) (ptext (sLit "# ")) (ftext s)),
((<>) (ptext (sLit "; ")) (ftext s))) ((<>) (ptext (sLit "; ")) (ftext s)))
-} -}
pprInstr (DELTA d) pprInstr platform (DELTA d)
= pprInstr (COMMENT (mkFastString ("\tdelta = " ++ show d))) = pprInstr platform (COMMENT (mkFastString ("\tdelta = " ++ show d)))
pprInstr (NEWBLOCK _) pprInstr _ (NEWBLOCK _)
= panic "PprMach.pprInstr: NEWBLOCK" = panic "PprMach.pprInstr: NEWBLOCK"
pprInstr (LDATA _ _) pprInstr _ (LDATA _ _)
= panic "PprMach.pprInstr: LDATA" = panic "PprMach.pprInstr: LDATA"
{- {-
pprInstr (SPILL reg slot) pprInstr _ (SPILL reg slot)
= hcat [ = hcat [
ptext (sLit "\tSPILL"), ptext (sLit "\tSPILL"),
char '\t', char '\t',
...@@ -364,7 +364,7 @@ pprInstr (SPILL reg slot) ...@@ -364,7 +364,7 @@ pprInstr (SPILL reg slot)
comma, comma,
ptext (sLit "SLOT") <> parens (int slot)] ptext (sLit "SLOT") <> parens (int slot)]
pprInstr (RELOAD slot reg) pprInstr _ (RELOAD slot reg)
= hcat [ = hcat [
ptext (sLit "\tRELOAD"), ptext (sLit "\tRELOAD"),
char '\t', char '\t',
...@@ -373,7 +373,7 @@ pprInstr (RELOAD slot reg) ...@@ -373,7 +373,7 @@ pprInstr (RELOAD slot reg)
pprReg reg] pprReg reg]
-} -}
pprInstr (LD sz reg addr) = hcat [ pprInstr _ (LD sz reg addr) = hcat [
char '\t', char '\t',
ptext (sLit "l"), ptext (sLit "l"),
ptext (case sz of ptext (case sz of
...@@ -391,7 +391,7 @@ pprInstr (LD sz reg addr) = hcat [ ...@@ -391,7 +391,7 @@ pprInstr (LD sz reg addr) = hcat [
ptext (sLit ", "), ptext (sLit ", "),
pprAddr addr pprAddr addr
] ]
pprInstr (LA sz reg addr) = hcat [ pprInstr _ (LA sz reg addr) = hcat [
char '\t', char '\t',
ptext (sLit "l"), ptext (sLit "l"),
ptext (case sz of ptext (case sz of
...@@ -409,7 +409,7 @@ pprInstr (LA sz reg addr) = hcat [ ...@@ -409,7 +409,7 @@ pprInstr (LA sz reg addr) = hcat [
ptext (sLit ", "), ptext (sLit ", "),
pprAddr addr pprAddr addr
] ]
pprInstr (ST sz reg addr) = hcat [ pprInstr _ (ST sz reg addr) = hcat [
char '\t', char '\t',
ptext (sLit "st"), ptext (sLit "st"),
pprSize sz, pprSize sz,
...@@ -420,7 +420,7 @@ pprInstr (ST sz reg addr) = hcat [ ...@@ -420,7 +420,7 @@ pprInstr (ST sz reg addr) = hcat [
ptext (sLit ", "), ptext (sLit ", "),
pprAddr addr pprAddr addr
] ]
pprInstr (STU sz reg addr) = hcat [ pprInstr _ (STU sz reg addr) = hcat [
char '\t', char '\t',
ptext (sLit "st"), ptext (sLit "st"),
pprSize sz, pprSize sz,
...@@ -431,7 +431,7 @@ pprInstr (STU sz reg addr) = hcat [ ...@@ -431,7 +431,7 @@ pprInstr (STU sz reg addr) = hcat [
ptext (sLit ", "), ptext (sLit ", "),
pprAddr addr pprAddr addr
] ]
pprInstr (LIS reg imm) = hcat [ pprInstr _ (LIS reg imm) = hcat [
char '\t', char '\t',
ptext (sLit "lis"), ptext (sLit "lis"),
char '\t', char '\t',
...@@ -439,7 +439,7 @@ pprInstr (LIS reg imm) = hcat [ ...@@ -439,7 +439,7 @@ pprInstr (LIS reg imm) = hcat [
ptext (sLit ", "), ptext (sLit ", "),
pprImm imm pprImm imm
] ]
pprInstr (LI reg imm) = hcat [ pprInstr _ (LI reg imm) = hcat [
char '\t', char '\t',
ptext (sLit "li"), ptext (sLit "li"),
char '\t', char '\t',
...@@ -447,11 +447,11 @@ pprInstr (LI reg imm) = hcat [ ...@@ -447,11 +447,11 @@ pprInstr (LI reg imm) = hcat [
ptext (sLit ", "), ptext (sLit ", "),
pprImm imm pprImm imm
] ]
pprInstr (MR reg1 reg2) pprInstr platform (MR reg1 reg2)
| reg1 == reg2 = empty | reg1 == reg2 = empty
| otherwise = hcat [ | otherwise = hcat [
char '\t', char '\t',
case targetClassOfReg reg1 of case targetClassOfReg platform reg1 of
RcInteger -> ptext (sLit "mr") RcInteger -> ptext (sLit "mr")
_ -> ptext (sLit "fmr"), _ -> ptext (sLit "fmr"),
char '\t', char '\t',
...@@ -459,7 +459,7 @@ pprInstr (MR reg1 reg2) ...@@ -459,7 +459,7 @@ pprInstr (MR reg1 reg2)
ptext (sLit ", "), ptext (sLit ", "),
pprReg reg2 pprReg reg2
] ]
pprInstr (CMP sz reg ri) = hcat [ pprInstr _ (CMP sz reg ri) = hcat [
char '\t', char '\t',
op, op,
char '\t', char '\t',
...@@ -475,7 +475,7 @@ pprInstr (CMP sz reg ri) = hcat [ ...@@ -475,7 +475,7 @@ pprInstr (CMP sz reg ri) = hcat [
RIReg _ -> empty RIReg _ -> empty
RIImm _ -> char 'i' RIImm _ -> char 'i'
] ]
pprInstr (CMPL sz reg ri) = hcat [ pprInstr _ (CMPL sz reg ri) = hcat [
char '\t', char '\t',
op, op,
char '\t', char '\t',
...@@ -491,7 +491,7 @@ pprInstr (CMPL sz reg ri) = hcat [ ...@@ -491,7 +491,7 @@ pprInstr (CMPL sz reg ri) = hcat [
RIReg _ -> empty RIReg _ -> empty
RIImm _ -> char 'i' RIImm _ -> char 'i'
] ]
pprInstr (BCC cond blockid) = hcat [ pprInstr _ (BCC cond blockid) = hcat [
char '\t', char '\t',
ptext (sLit "b"), ptext (sLit "b"),
pprCond cond, pprCond cond,
...@@ -500,7 +500,7 @@ pprInstr (BCC cond blockid) = hcat [ ...@@ -500,7 +500,7 @@ pprInstr (BCC cond blockid) = hcat [
] ]
where lbl = mkAsmTempLabel (getUnique blockid) where lbl = mkAsmTempLabel (getUnique blockid)
pprInstr (BCCFAR cond blockid) = vcat [ pprInstr _ (BCCFAR cond blockid) = vcat [
hcat [ hcat [
ptext (sLit "\tb"), ptext (sLit "\tb"),
pprCond (condNegate cond), pprCond (condNegate cond),
...@@ -513,33 +513,33 @@ pprInstr (BCCFAR cond blockid) = vcat [ ...@@ -513,33 +513,33 @@ pprInstr (BCCFAR cond blockid) = vcat [
] ]
where lbl = mkAsmTempLabel (getUnique blockid) where lbl = mkAsmTempLabel (getUnique blockid)
pprInstr (JMP lbl) = hcat [ -- an alias for b that takes a CLabel pprInstr _ (JMP lbl) = hcat [ -- an alias for b that takes a CLabel
char '\t', char '\t',
ptext (sLit "b"), ptext (sLit "b"),
char '\t', char '\t',
pprCLabel_asm lbl pprCLabel_asm lbl
] ]
pprInstr (MTCTR reg) = hcat [ pprInstr _ (MTCTR reg) = hcat [
char '\t', char '\t',
ptext (sLit "mtctr"), ptext (sLit "mtctr"),
char '\t', char '\t',
pprReg reg pprReg reg
] ]
pprInstr (BCTR _ _) = hcat [ pprInstr _ (BCTR _ _) = hcat [
char '\t', char '\t',
ptext (sLit "bctr") ptext (sLit "bctr")
] ]
pprInstr (BL lbl _) = hcat [ pprInstr _ (BL lbl _) = hcat [
ptext (sLit "\tbl\t"), ptext (sLit "\tbl\t"),
pprCLabel_asm lbl pprCLabel_asm lbl
] ]
pprInstr (BCTRL _) = hcat [ pprInstr _ (BCTRL _) = hcat [
char '\t', char '\t',
ptext (sLit "bctrl") ptext (sLit "bctrl")
] ]
pprInstr (ADD reg1 reg2 ri) = pprLogic (sLit "add") reg1 reg2 ri pprInstr _ (ADD reg1 reg2 ri) = pprLogic (sLit "add") reg1 reg2 ri
pprInstr (ADDIS reg1 reg2 imm) = hcat [ pprInstr _ (ADDIS reg1 reg2 imm) = hcat [
char '\t', char '\t',
ptext (sLit "addis"), ptext (sLit "addis"),
char '\t', char '\t',
...@@ -550,15 +550,15 @@ pprInstr (ADDIS reg1 reg2 imm) = hcat [ ...@@ -550,15 +550,15 @@ pprInstr (ADDIS reg1 reg2 imm) = hcat [
pprImm imm pprImm imm
] ]
pprInstr (ADDC reg1 reg2 reg3) = pprLogic (sLit "addc") reg1 reg2 (RIReg reg3) pprInstr _ (ADDC reg1 reg2 reg3) = pprLogic (sLit "addc") reg1 reg2 (RIReg reg3)
pprInstr (ADDE reg1 reg2 reg3) = pprLogic (sLit "adde") reg1 reg2 (RIReg reg3) pprInstr _ (ADDE reg1 reg2 reg3) = pprLogic (sLit "adde") reg1 reg2 (RIReg reg3)
pprInstr (SUBF reg1 reg2 reg3) = pprLogic (sLit "subf") reg1 reg2 (RIReg reg3) pprInstr _ (SUBF reg1 reg2 reg3) = pprLogic (sLit "subf") reg1 reg2 (RIReg reg3)
pprInstr (MULLW reg1 reg2 ri@(RIReg _)) = pprLogic (sLit "mullw") reg1 reg2 ri pprInstr _ (MULLW reg1 reg2 ri@(RIReg _)) = pprLogic (sLit "mullw") reg1 reg2 ri
pprInstr (MULLW reg1 reg2 ri@(RIImm _)) = pprLogic (sLit "mull") reg1 reg2 ri pprInstr _ (MULLW reg1 reg2 ri@(RIImm _)) = pprLogic (sLit "mull") reg1 reg2 ri
pprInstr (DIVW reg1 reg2 reg3) = pprLogic (sLit "divw") reg1 reg2 (RIReg reg3) pprInstr _ (DIVW reg1 reg2 reg3) = pprLogic (sLit "divw") reg1 reg2 (RIReg reg3)
pprInstr (DIVWU reg1 reg2 reg3) = pprLogic (sLit "divwu") reg1 reg2 (RIReg reg3) pprInstr _ (DIVWU reg1 reg2 reg3) = pprLogic (sLit "divwu") reg1 reg2 (RIReg reg3)
pprInstr (MULLW_MayOflo reg1 reg2 reg3) = vcat [ pprInstr _ (MULLW_MayOflo reg1 reg2 reg3) = vcat [
hcat [ ptext (sLit "\tmullwo\t"), pprReg reg1, ptext (sLit ", "), hcat [ ptext (sLit "\tmullwo\t"), pprReg reg1, ptext (sLit ", "),
pprReg reg2, ptext (sLit ", "), pprReg reg2, ptext (sLit ", "),
pprReg reg3 ], pprReg reg3 ],
...@@ -570,7 +570,7 @@ pprInstr (MULLW_MayOflo reg1 reg2 reg3) = vcat [ ...@@ -570,7 +570,7 @@ pprInstr (MULLW_MayOflo reg1 reg2 reg3) = vcat [
-- for some reason, "andi" doesn't exist. -- for some reason, "andi" doesn't exist.
-- we'll use "andi." instead. -- we'll use "andi." instead.
pprInstr (AND reg1 reg2 (RIImm imm)) = hcat [ pprInstr _ (AND reg1 reg2 (RIImm imm)) = hcat [
char '\t', char '\t',
ptext (sLit "andi."), ptext (sLit "andi."),
char '\t', char '\t',
...@@ -580,12 +580,12 @@ pprInstr (AND reg1 reg2 (RIImm imm)) = hcat [ ...@@ -580,12 +580,12 @@ pprInstr (AND reg1 reg2 (RIImm imm)) = hcat [
ptext (sLit ", "), ptext (sLit ", "),
pprImm imm pprImm imm
]