X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=compiler%2FnativeGen%2FPprMach.hs;fp=compiler%2FnativeGen%2FPprMach.hs;h=24ba78fd5e8634ac84e295aa2be89182bd1e6b00;hb=8480018a7f5f1cd961f3bd8ae758cc01910d5e6a;hp=2d59cf417f472c9590749a2883e319a5dc085b35;hpb=42d87c155aaa9863c40dcdb28af1d23d31b35c9f;p=ghc-hetmet.git diff --git a/compiler/nativeGen/PprMach.hs b/compiler/nativeGen/PprMach.hs index 2d59cf4..24ba78f 100644 --- a/compiler/nativeGen/PprMach.hs +++ b/compiler/nativeGen/PprMach.hs @@ -354,7 +354,10 @@ pprReg IF_ARCH_i386(s,) IF_ARCH_x86_64(s,) r -- ----------------------------------------------------------------------------- --- pprSize: print a 'Size' +-- | print a 'Size' +-- Used for instruction suffixes. +-- eg LD is 32bit on sparc, but LDD is 64 bit. +-- #if powerpc_TARGET_ARCH || i386_TARGET_ARCH || x86_64_TARGET_ARCH || sparc_TARGET_ARCH pprSize :: Size -> Doc @@ -395,6 +398,7 @@ pprSize x = ptext (case x of II8 -> sLit "sb" II16 -> sLit "sh" II32 -> sLit "" + II64 -> sLit "d" FF32 -> sLit "" FF64 -> sLit "d" ) @@ -806,17 +810,18 @@ instance Outputable Instr where pprInstr :: Instr -> Doc ---pprInstr (COMMENT s) = empty -- nuke 'em +pprInstr (COMMENT s) = empty -- nuke 'em +{- pprInstr (COMMENT s) = IF_ARCH_alpha( ((<>) (ptext (sLit "\t# ")) (ftext s)) - ,IF_ARCH_sparc( ((<>) (ptext (sLit "! ")) (ftext s)) + ,IF_ARCH_sparc( ((<>) (ptext (sLit "# ")) (ftext s)) ,IF_ARCH_i386( ((<>) (ptext (sLit "# ")) (ftext s)) ,IF_ARCH_x86_64( ((<>) (ptext (sLit "# ")) (ftext s)) ,IF_ARCH_powerpc( IF_OS_linux( ((<>) (ptext (sLit "# ")) (ftext s)), ((<>) (ptext (sLit "; ")) (ftext s))) ,))))) - +-} pprInstr (DELTA d) = pprInstr (COMMENT (mkFastString ("\tdelta = " ++ show d))) @@ -1959,8 +1964,9 @@ pprInstr (ST size reg addr) ] pprInstr (ADD x cc reg1 ri reg2) - | not x && not cc && riZero ri - = hcat [ ptext (sLit "\tmov\t"), pprReg reg1, comma, pprReg reg2 ] +-- | not x && not cc && riZero ri +-- = hcat [ ptext (sLit "\tmov\t"), pprReg reg1, comma, pprReg reg2 ] + | otherwise = pprRegRIReg (if x then sLit "addx" else sLit "add") cc reg1 ri reg2 @@ -1976,11 +1982,12 @@ pprInstr (AND b reg1 ri reg2) = pprRegRIReg (sLit "and") b reg1 ri reg2 pprInstr (ANDN b reg1 ri reg2) = pprRegRIReg (sLit "andn") b reg1 ri reg2 pprInstr (OR b reg1 ri reg2) - | not b && reg1 == g0 +{- | not b && reg1 == g0 = let doit = hcat [ ptext (sLit "\tmov\t"), pprRI ri, comma, pprReg reg2 ] in case ri of RIReg rrr | rrr == reg2 -> empty other -> doit +-} | otherwise = pprRegRIReg (sLit "or") b reg1 ri reg2