projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 1998-12-02 13:17:09 by simonm]
[ghc-hetmet.git]
/
ghc
/
compiler
/
nativeGen
/
PprMach.lhs
diff --git
a/ghc/compiler/nativeGen/PprMach.lhs
b/ghc/compiler/nativeGen/PprMach.lhs
index
bd242bf
..
700700e
100644
(file)
--- a/
ghc/compiler/nativeGen/PprMach.lhs
+++ b/
ghc/compiler/nativeGen/PprMach.lhs
@@
-1,5
+1,5
@@
%
%
-% (c) The AQUA Project, Glasgow University, 1996
+% (c) The AQUA Project, Glasgow University, 1996-1998
%
\section[PprMach]{Pretty-printing assembly language}
%
\section[PprMach]{Pretty-printing assembly language}
@@
-17,12
+17,10
@@
module PprMach ( pprInstr ) where
import MachRegs -- may differ per-platform
import MachMisc
import MachRegs -- may differ per-platform
import MachMisc
-import AbsCSyn ( MagicId )
import CLabel ( pprCLabel_asm, externallyVisibleCLabel )
import CStrings ( charToC )
import Maybes ( maybeToBool )
import CLabel ( pprCLabel_asm, externallyVisibleCLabel )
import CStrings ( charToC )
import Maybes ( maybeToBool )
-import OrdList ( OrdList )
-import Stix ( CodeSegment(..), StixTree )
+import Stix ( CodeSegment(..) )
import Char ( isPrint, isDigit )
import Outputable
\end{code}
import Char ( isPrint, isDigit )
import Outputable
\end{code}
@@
-291,6
+289,7
@@
pprImm :: Imm -> SDoc
pprImm (ImmInt i) = int i
pprImm (ImmInteger i) = integer i
pprImm (ImmCLbl l) = pprCLabel_asm l
pprImm (ImmInt i) = int i
pprImm (ImmInteger i) = integer i
pprImm (ImmCLbl l) = pprCLabel_asm l
+pprImm (ImmIndex l i) = pprCLabel_asm l <> char '+' <> int i
pprImm (ImmLit s) = s
pprImm (ImmLab s) | underscorePrefix = (<>) (char '_') s
pprImm (ImmLit s) = s
pprImm (ImmLab s) | underscorePrefix = (<>) (char '_') s
@@
-300,12
+299,12
@@
pprImm (ImmLab s) | underscorePrefix = (<>) (char '_') s
pprImm (LO i)
= hcat [ pp_lo, pprImm i, rparen ]
where
pprImm (LO i)
= hcat [ pp_lo, pprImm i, rparen ]
where
- pp_lo = ptext SLIT("%lo(")
+ pp_lo = text "%lo("
pprImm (HI i)
= hcat [ pp_hi, pprImm i, rparen ]
where
pprImm (HI i)
= hcat [ pp_hi, pprImm i, rparen ]
where
- pp_hi = ptext SLIT("%hi(")
+ pp_hi = text "%hi("
#endif
\end{code}
#endif
\end{code}
@@
-442,7
+441,7
@@
pprInstr (ASCII True str)
asciify ('\\':cs) n = (<>) (text "\\\\") (asciify cs (n-1))
asciify ('\"':cs) n = (<>) (text "\\\"") (asciify cs (n-1))
asciify (c:cs) n | isPrint c = (<>) (char c) (asciify cs (n-1))
asciify ('\\':cs) n = (<>) (text "\\\\") (asciify cs (n-1))
asciify ('\"':cs) n = (<>) (text "\\\"") (asciify cs (n-1))
asciify (c:cs) n | isPrint c = (<>) (char c) (asciify cs (n-1))
- asciify [c] _ = (<>) (text (charToC c)) (text ("\\0\""))
+ asciify [c] _ = (<>) (text (charToC c)) (text ("\\0\"")){-"-}
asciify (c:(cs@(d:_))) n
| isDigit d = (<>) (text (charToC c)) (asciify cs 0)
| otherwise = (<>) (text (charToC c)) (asciify cs (n-1))
asciify (c:(cs@(d:_))) n
| isDigit d = (<>) (text (charToC c)) (asciify cs 0)
| otherwise = (<>) (text (charToC c)) (asciify cs (n-1))
@@
-469,7
+468,7
@@
pprInstr (DATA s xs)
--UNUSED: HB -> SLIT("\t.byte\t")
--UNUSED: S -> SLIT("\t.word\t")
L -> SLIT("\t.long\t")
--UNUSED: HB -> SLIT("\t.byte\t")
--UNUSED: S -> SLIT("\t.word\t")
L -> SLIT("\t.long\t")
- F -> SLIT("\t.long\t")
+ F -> SLIT("\t.float\t")
DF -> SLIT("\t.double\t")
#endif
#if sparc_TARGET_ARCH
DF -> SLIT("\t.double\t")
#endif
#if sparc_TARGET_ARCH
@@
-1369,9
+1368,9
@@
pprRIReg name b ri reg1
]
pp_ld_lbracket = ptext SLIT("\tld\t[")
]
pp_ld_lbracket = ptext SLIT("\tld\t[")
-pp_rbracket_comma = ptext SLIT("],")
-pp_comma_lbracket = ptext SLIT(",[")
-pp_comma_a = ptext SLIT(",a")
+pp_rbracket_comma = text "],"
+pp_comma_lbracket = text ",["
+pp_comma_a = text ",a"
#endif {-sparc_TARGET_ARCH-}
\end{code}
#endif {-sparc_TARGET_ARCH-}
\end{code}