More CPP removal: pprDynamicLinkerAsmLabel in CLabel
[ghc.git] / compiler / nativeGen / SPARC / Ppr.hs
1 -----------------------------------------------------------------------------
2 --
3 -- Pretty-printing assembly language
4 --
5 -- (c) The University of Glasgow 1993-2005
6 --
7 -----------------------------------------------------------------------------
8
9 module SPARC.Ppr (
10 pprNatCmmDecl,
11 pprBasicBlock,
12 pprSectionHeader,
13 pprData,
14 pprInstr,
15 pprSize,
16 pprImm,
17 pprDataItem
18 )
19
20 where
21
22 #include "HsVersions.h"
23 #include "nativeGen/NCG.h"
24
25 import SPARC.Regs
26 import SPARC.Instr
27 import SPARC.Cond
28 import SPARC.Imm
29 import SPARC.AddrMode
30 import SPARC.Base
31 import Instruction
32 import Reg
33 import Size
34 import PprBase
35
36 import OldCmm
37 import OldPprCmm()
38 import CLabel
39
40 import Unique ( Uniquable(..), pprUnique )
41 import qualified Outputable
42 import Outputable (PlatformOutputable, panic)
43 import Platform
44 import Pretty
45 import FastString
46 import Data.Word
47
48 -- -----------------------------------------------------------------------------
49 -- Printing this stuff out
50
51 pprNatCmmDecl :: Platform -> NatCmmDecl CmmStatics Instr -> Doc
52 pprNatCmmDecl platform (CmmData section dats) =
53 pprSectionHeader section $$ pprDatas platform dats
54
55 -- special case for split markers:
56 pprNatCmmDecl platform (CmmProc Nothing lbl (ListGraph [])) = pprLabel platform lbl
57
58 -- special case for code without info table:
59 pprNatCmmDecl platform (CmmProc Nothing lbl (ListGraph blocks)) =
60 pprSectionHeader Text $$
61 pprLabel platform lbl $$ -- blocks guaranteed not null, so label needed
62 vcat (map (pprBasicBlock platform) blocks)
63
64 pprNatCmmDecl platform (CmmProc (Just (Statics info_lbl info)) _entry_lbl (ListGraph blocks)) =
65 pprSectionHeader Text $$
66 (
67 #if HAVE_SUBSECTIONS_VIA_SYMBOLS
68 pprCLabel_asm platform (mkDeadStripPreventer info_lbl)
69 <> char ':' $$
70 #endif
71 vcat (map (pprData platform) info) $$
72 pprLabel platform info_lbl
73 ) $$
74 vcat (map (pprBasicBlock platform) blocks)
75 -- above: Even the first block gets a label, because with branch-chain
76 -- elimination, it might be the target of a goto.
77 #if HAVE_SUBSECTIONS_VIA_SYMBOLS
78 -- If we are using the .subsections_via_symbols directive
79 -- (available on recent versions of Darwin),
80 -- we have to make sure that there is some kind of reference
81 -- from the entry code to a label on the _top_ of of the info table,
82 -- so that the linker will not think it is unreferenced and dead-strip
83 -- it. That's why the label is called a DeadStripPreventer (_dsp).
84 $$ text "\t.long "
85 <+> pprCLabel_asm platform info_lbl
86 <+> char '-'
87 <+> pprCLabel_asm platform (mkDeadStripPreventer info_lbl)
88 #endif
89
90
91 pprBasicBlock :: Platform -> NatBasicBlock Instr -> Doc
92 pprBasicBlock platform (BasicBlock blockid instrs) =
93 pprLabel platform (mkAsmTempLabel (getUnique blockid)) $$
94 vcat (map (pprInstr platform) instrs)
95
96
97 pprDatas :: Platform -> CmmStatics -> Doc
98 pprDatas platform (Statics lbl dats) = vcat (pprLabel platform lbl : map (pprData platform) dats)
99
100 pprData :: Platform -> CmmStatic -> Doc
101 pprData _ (CmmString str) = pprASCII str
102 pprData _ (CmmUninitialised bytes) = ptext (sLit ".skip ") <> int bytes
103 pprData platform (CmmStaticLit lit) = pprDataItem platform lit
104
105 pprGloblDecl :: Platform -> CLabel -> Doc
106 pprGloblDecl platform lbl
107 | not (externallyVisibleCLabel lbl) = empty
108 | otherwise = ptext (sLit ".global ") <> pprCLabel_asm platform lbl
109
110 pprTypeAndSizeDecl :: Platform -> CLabel -> Doc
111 #if linux_TARGET_OS
112 pprTypeAndSizeDecl platform lbl
113 | not (externallyVisibleCLabel lbl) = empty
114 | otherwise = ptext (sLit ".type ") <>
115 pprCLabel_asm platform lbl <> ptext (sLit ", @object")
116 #else
117 pprTypeAndSizeDecl _ _
118 = empty
119 #endif
120
121 pprLabel :: Platform -> CLabel -> Doc
122 pprLabel platform lbl = pprGloblDecl platform lbl
123 $$ pprTypeAndSizeDecl platform lbl
124 $$ (pprCLabel_asm platform lbl <> char ':')
125
126
127 pprASCII :: [Word8] -> Doc
128 pprASCII str
129 = vcat (map do1 str) $$ do1 0
130 where
131 do1 :: Word8 -> Doc
132 do1 w = ptext (sLit "\t.byte\t") <> int (fromIntegral w)
133
134
135 -- -----------------------------------------------------------------------------
136 -- pprInstr: print an 'Instr'
137
138 instance PlatformOutputable Instr where
139 pprPlatform platform instr = Outputable.docToSDoc $ pprInstr platform instr
140
141
142 -- | Pretty print a register.
143 pprReg :: Reg -> Doc
144 pprReg reg
145 = case reg of
146 RegVirtual vr
147 -> case vr of
148 VirtualRegI u -> text "%vI_" <> asmSDoc (pprUnique u)
149 VirtualRegHi u -> text "%vHi_" <> asmSDoc (pprUnique u)
150 VirtualRegF u -> text "%vF_" <> asmSDoc (pprUnique u)
151 VirtualRegD u -> text "%vD_" <> asmSDoc (pprUnique u)
152 VirtualRegSSE u -> text "%vSSE_" <> asmSDoc (pprUnique u)
153
154 RegReal rr
155 -> case rr of
156 RealRegSingle r1
157 -> pprReg_ofRegNo r1
158
159 RealRegPair r1 r2
160 -> text "(" <> pprReg_ofRegNo r1
161 <> text "|" <> pprReg_ofRegNo r2
162 <> text ")"
163
164
165
166 -- | Pretty print a register name, based on this register number.
167 -- The definition has been unfolded so we get a jump-table in the
168 -- object code. This function is called quite a lot when emitting the asm file..
169 --
170 pprReg_ofRegNo :: Int -> Doc
171 pprReg_ofRegNo i
172 = ptext
173 (case i of {
174 0 -> sLit "%g0"; 1 -> sLit "%g1";
175 2 -> sLit "%g2"; 3 -> sLit "%g3";
176 4 -> sLit "%g4"; 5 -> sLit "%g5";
177 6 -> sLit "%g6"; 7 -> sLit "%g7";
178 8 -> sLit "%o0"; 9 -> sLit "%o1";
179 10 -> sLit "%o2"; 11 -> sLit "%o3";
180 12 -> sLit "%o4"; 13 -> sLit "%o5";
181 14 -> sLit "%o6"; 15 -> sLit "%o7";
182 16 -> sLit "%l0"; 17 -> sLit "%l1";
183 18 -> sLit "%l2"; 19 -> sLit "%l3";
184 20 -> sLit "%l4"; 21 -> sLit "%l5";
185 22 -> sLit "%l6"; 23 -> sLit "%l7";
186 24 -> sLit "%i0"; 25 -> sLit "%i1";
187 26 -> sLit "%i2"; 27 -> sLit "%i3";
188 28 -> sLit "%i4"; 29 -> sLit "%i5";
189 30 -> sLit "%i6"; 31 -> sLit "%i7";
190 32 -> sLit "%f0"; 33 -> sLit "%f1";
191 34 -> sLit "%f2"; 35 -> sLit "%f3";
192 36 -> sLit "%f4"; 37 -> sLit "%f5";
193 38 -> sLit "%f6"; 39 -> sLit "%f7";
194 40 -> sLit "%f8"; 41 -> sLit "%f9";
195 42 -> sLit "%f10"; 43 -> sLit "%f11";
196 44 -> sLit "%f12"; 45 -> sLit "%f13";
197 46 -> sLit "%f14"; 47 -> sLit "%f15";
198 48 -> sLit "%f16"; 49 -> sLit "%f17";
199 50 -> sLit "%f18"; 51 -> sLit "%f19";
200 52 -> sLit "%f20"; 53 -> sLit "%f21";
201 54 -> sLit "%f22"; 55 -> sLit "%f23";
202 56 -> sLit "%f24"; 57 -> sLit "%f25";
203 58 -> sLit "%f26"; 59 -> sLit "%f27";
204 60 -> sLit "%f28"; 61 -> sLit "%f29";
205 62 -> sLit "%f30"; 63 -> sLit "%f31";
206 _ -> sLit "very naughty sparc register" })
207
208
209 -- | Pretty print a size for an instruction suffix.
210 pprSize :: Size -> Doc
211 pprSize x
212 = ptext
213 (case x of
214 II8 -> sLit "ub"
215 II16 -> sLit "uh"
216 II32 -> sLit ""
217 II64 -> sLit "d"
218 FF32 -> sLit ""
219 FF64 -> sLit "d"
220 _ -> panic "SPARC.Ppr.pprSize: no match")
221
222
223 -- | Pretty print a size for an instruction suffix.
224 -- eg LD is 32bit on sparc, but LDD is 64 bit.
225 pprStSize :: Size -> Doc
226 pprStSize x
227 = ptext
228 (case x of
229 II8 -> sLit "b"
230 II16 -> sLit "h"
231 II32 -> sLit ""
232 II64 -> sLit "x"
233 FF32 -> sLit ""
234 FF64 -> sLit "d"
235 _ -> panic "SPARC.Ppr.pprSize: no match")
236
237
238 -- | Pretty print a condition code.
239 pprCond :: Cond -> Doc
240 pprCond c
241 = ptext
242 (case c of
243 ALWAYS -> sLit ""
244 NEVER -> sLit "n"
245 GEU -> sLit "geu"
246 LU -> sLit "lu"
247 EQQ -> sLit "e"
248 GTT -> sLit "g"
249 GE -> sLit "ge"
250 GU -> sLit "gu"
251 LTT -> sLit "l"
252 LE -> sLit "le"
253 LEU -> sLit "leu"
254 NE -> sLit "ne"
255 NEG -> sLit "neg"
256 POS -> sLit "pos"
257 VC -> sLit "vc"
258 VS -> sLit "vs")
259
260
261 -- | Pretty print an address mode.
262 pprAddr :: Platform -> AddrMode -> Doc
263 pprAddr platform am
264 = case am of
265 AddrRegReg r1 (RegReal (RealRegSingle 0))
266 -> pprReg r1
267
268 AddrRegReg r1 r2
269 -> hcat [ pprReg r1, char '+', pprReg r2 ]
270
271 AddrRegImm r1 (ImmInt i)
272 | i == 0 -> pprReg r1
273 | not (fits13Bits i) -> largeOffsetError i
274 | otherwise -> hcat [ pprReg r1, pp_sign, int i ]
275 where
276 pp_sign = if i > 0 then char '+' else empty
277
278 AddrRegImm r1 (ImmInteger i)
279 | i == 0 -> pprReg r1
280 | not (fits13Bits i) -> largeOffsetError i
281 | otherwise -> hcat [ pprReg r1, pp_sign, integer i ]
282 where
283 pp_sign = if i > 0 then char '+' else empty
284
285 AddrRegImm r1 imm
286 -> hcat [ pprReg r1, char '+', pprImm platform imm ]
287
288
289 -- | Pretty print an immediate value.
290 pprImm :: Platform -> Imm -> Doc
291 pprImm platform imm
292 = case imm of
293 ImmInt i -> int i
294 ImmInteger i -> integer i
295 ImmCLbl l -> pprCLabel_asm platform l
296 ImmIndex l i -> pprCLabel_asm platform l <> char '+' <> int i
297 ImmLit s -> s
298
299 ImmConstantSum a b
300 -> pprImm platform a <> char '+' <> pprImm platform b
301
302 ImmConstantDiff a b
303 -> pprImm platform a <> char '-' <> lparen <> pprImm platform b <> rparen
304
305 LO i
306 -> hcat [ text "%lo(", pprImm platform i, rparen ]
307
308 HI i
309 -> hcat [ text "%hi(", pprImm platform i, rparen ]
310
311 -- these should have been converted to bytes and placed
312 -- in the data section.
313 ImmFloat _ -> ptext (sLit "naughty float immediate")
314 ImmDouble _ -> ptext (sLit "naughty double immediate")
315
316
317 -- | Pretty print a section \/ segment header.
318 -- On SPARC all the data sections must be at least 8 byte aligned
319 -- incase we store doubles in them.
320 --
321 pprSectionHeader :: Section -> Doc
322 pprSectionHeader seg
323 = case seg of
324 Text -> ptext (sLit ".text\n\t.align 4")
325 Data -> ptext (sLit ".data\n\t.align 8")
326 ReadOnlyData -> ptext (sLit ".text\n\t.align 8")
327 RelocatableReadOnlyData -> ptext (sLit ".text\n\t.align 8")
328 UninitialisedData -> ptext (sLit ".bss\n\t.align 8")
329 ReadOnlyData16 -> ptext (sLit ".data\n\t.align 16")
330 OtherSection _ -> panic "PprMach.pprSectionHeader: unknown section"
331
332
333 -- | Pretty print a data item.
334 pprDataItem :: Platform -> CmmLit -> Doc
335 pprDataItem platform lit
336 = vcat (ppr_item (cmmTypeSize $ cmmLitType lit) lit)
337 where
338 imm = litToImm lit
339
340 ppr_item II8 _ = [ptext (sLit "\t.byte\t") <> pprImm platform imm]
341 ppr_item II32 _ = [ptext (sLit "\t.long\t") <> pprImm platform imm]
342
343 ppr_item FF32 (CmmFloat r _)
344 = let bs = floatToBytes (fromRational r)
345 in map (\b -> ptext (sLit "\t.byte\t") <> pprImm platform (ImmInt b)) bs
346
347 ppr_item FF64 (CmmFloat r _)
348 = let bs = doubleToBytes (fromRational r)
349 in map (\b -> ptext (sLit "\t.byte\t") <> pprImm platform (ImmInt b)) bs
350
351 ppr_item II16 _ = [ptext (sLit "\t.short\t") <> pprImm platform imm]
352 ppr_item II64 _ = [ptext (sLit "\t.quad\t") <> pprImm platform imm]
353 ppr_item _ _ = panic "SPARC.Ppr.pprDataItem: no match"
354
355
356 -- | Pretty print an instruction.
357 pprInstr :: Platform -> Instr -> Doc
358
359 -- nuke comments.
360 pprInstr _ (COMMENT _)
361 = empty
362
363 pprInstr platform (DELTA d)
364 = pprInstr platform (COMMENT (mkFastString ("\tdelta = " ++ show d)))
365
366 -- Newblocks and LData should have been slurped out before producing the .s file.
367 pprInstr _ (NEWBLOCK _)
368 = panic "X86.Ppr.pprInstr: NEWBLOCK"
369
370 pprInstr _ (LDATA _ _)
371 = panic "PprMach.pprInstr: LDATA"
372
373 -- 64 bit FP loads are expanded into individual instructions in CodeGen.Expand
374 pprInstr _ (LD FF64 _ reg)
375 | RegReal (RealRegSingle{}) <- reg
376 = panic "SPARC.Ppr: not emitting potentially misaligned LD FF64 instr"
377
378 pprInstr platform (LD size addr reg)
379 = hcat [
380 ptext (sLit "\tld"),
381 pprSize size,
382 char '\t',
383 lbrack,
384 pprAddr platform addr,
385 pp_rbracket_comma,
386 pprReg reg
387 ]
388
389 -- 64 bit FP storees are expanded into individual instructions in CodeGen.Expand
390 pprInstr _ (ST FF64 reg _)
391 | RegReal (RealRegSingle{}) <- reg
392 = panic "SPARC.Ppr: not emitting potentially misaligned ST FF64 instr"
393
394 -- no distinction is made between signed and unsigned bytes on stores for the
395 -- Sparc opcodes (at least I cannot see any, and gas is nagging me --SOF),
396 -- so we call a special-purpose pprSize for ST..
397 pprInstr platform (ST size reg addr)
398 = hcat [
399 ptext (sLit "\tst"),
400 pprStSize size,
401 char '\t',
402 pprReg reg,
403 pp_comma_lbracket,
404 pprAddr platform addr,
405 rbrack
406 ]
407
408
409 pprInstr platform (ADD x cc reg1 ri reg2)
410 | not x && not cc && riZero ri
411 = hcat [ ptext (sLit "\tmov\t"), pprReg reg1, comma, pprReg reg2 ]
412
413 | otherwise
414 = pprRegRIReg platform (if x then sLit "addx" else sLit "add") cc reg1 ri reg2
415
416
417 pprInstr platform (SUB x cc reg1 ri reg2)
418 | not x && cc && reg2 == g0
419 = hcat [ ptext (sLit "\tcmp\t"), pprReg reg1, comma, pprRI platform ri ]
420
421 | not x && not cc && riZero ri
422 = hcat [ ptext (sLit "\tmov\t"), pprReg reg1, comma, pprReg reg2 ]
423
424 | otherwise
425 = pprRegRIReg platform (if x then sLit "subx" else sLit "sub") cc reg1 ri reg2
426
427 pprInstr platform (AND b reg1 ri reg2) = pprRegRIReg platform (sLit "and") b reg1 ri reg2
428
429 pprInstr platform (ANDN b reg1 ri reg2) = pprRegRIReg platform (sLit "andn") b reg1 ri reg2
430
431 pprInstr platform (OR b reg1 ri reg2)
432 | not b && reg1 == g0
433 = let doit = hcat [ ptext (sLit "\tmov\t"), pprRI platform ri, comma, pprReg reg2 ]
434 in case ri of
435 RIReg rrr | rrr == reg2 -> empty
436 _ -> doit
437
438 | otherwise
439 = pprRegRIReg platform (sLit "or") b reg1 ri reg2
440
441 pprInstr platform (ORN b reg1 ri reg2) = pprRegRIReg platform (sLit "orn") b reg1 ri reg2
442
443 pprInstr platform (XOR b reg1 ri reg2) = pprRegRIReg platform (sLit "xor") b reg1 ri reg2
444 pprInstr platform (XNOR b reg1 ri reg2) = pprRegRIReg platform (sLit "xnor") b reg1 ri reg2
445
446 pprInstr platform (SLL reg1 ri reg2) = pprRegRIReg platform (sLit "sll") False reg1 ri reg2
447 pprInstr platform (SRL reg1 ri reg2) = pprRegRIReg platform (sLit "srl") False reg1 ri reg2
448 pprInstr platform (SRA reg1 ri reg2) = pprRegRIReg platform (sLit "sra") False reg1 ri reg2
449
450 pprInstr _ (RDY rd) = ptext (sLit "\trd\t%y,") <> pprReg rd
451 pprInstr _ (WRY reg1 reg2)
452 = ptext (sLit "\twr\t")
453 <> pprReg reg1
454 <> char ','
455 <> pprReg reg2
456 <> char ','
457 <> ptext (sLit "%y")
458
459 pprInstr platform (SMUL b reg1 ri reg2) = pprRegRIReg platform (sLit "smul") b reg1 ri reg2
460 pprInstr platform (UMUL b reg1 ri reg2) = pprRegRIReg platform (sLit "umul") b reg1 ri reg2
461 pprInstr platform (SDIV b reg1 ri reg2) = pprRegRIReg platform (sLit "sdiv") b reg1 ri reg2
462 pprInstr platform (UDIV b reg1 ri reg2) = pprRegRIReg platform (sLit "udiv") b reg1 ri reg2
463
464 pprInstr platform (SETHI imm reg)
465 = hcat [
466 ptext (sLit "\tsethi\t"),
467 pprImm platform imm,
468 comma,
469 pprReg reg
470 ]
471
472 pprInstr _ NOP
473 = ptext (sLit "\tnop")
474
475 pprInstr _ (FABS size reg1 reg2)
476 = pprSizeRegReg (sLit "fabs") size reg1 reg2
477
478 pprInstr _ (FADD size reg1 reg2 reg3)
479 = pprSizeRegRegReg (sLit "fadd") size reg1 reg2 reg3
480
481 pprInstr _ (FCMP e size reg1 reg2)
482 = pprSizeRegReg (if e then sLit "fcmpe" else sLit "fcmp") size reg1 reg2
483
484 pprInstr _ (FDIV size reg1 reg2 reg3)
485 = pprSizeRegRegReg (sLit "fdiv") size reg1 reg2 reg3
486
487 pprInstr _ (FMOV size reg1 reg2)
488 = pprSizeRegReg (sLit "fmov") size reg1 reg2
489
490 pprInstr _ (FMUL size reg1 reg2 reg3)
491 = pprSizeRegRegReg (sLit "fmul") size reg1 reg2 reg3
492
493 pprInstr _ (FNEG size reg1 reg2)
494 = pprSizeRegReg (sLit "fneg") size reg1 reg2
495
496 pprInstr _ (FSQRT size reg1 reg2)
497 = pprSizeRegReg (sLit "fsqrt") size reg1 reg2
498
499 pprInstr _ (FSUB size reg1 reg2 reg3)
500 = pprSizeRegRegReg (sLit "fsub") size reg1 reg2 reg3
501
502 pprInstr _ (FxTOy size1 size2 reg1 reg2)
503 = hcat [
504 ptext (sLit "\tf"),
505 ptext
506 (case size1 of
507 II32 -> sLit "ito"
508 FF32 -> sLit "sto"
509 FF64 -> sLit "dto"
510 _ -> panic "SPARC.Ppr.pprInstr.FxToY: no match"),
511 ptext
512 (case size2 of
513 II32 -> sLit "i\t"
514 II64 -> sLit "x\t"
515 FF32 -> sLit "s\t"
516 FF64 -> sLit "d\t"
517 _ -> panic "SPARC.Ppr.pprInstr.FxToY: no match"),
518 pprReg reg1, comma, pprReg reg2
519 ]
520
521
522 pprInstr platform (BI cond b blockid)
523 = hcat [
524 ptext (sLit "\tb"), pprCond cond,
525 if b then pp_comma_a else empty,
526 char '\t',
527 pprCLabel_asm platform (mkAsmTempLabel (getUnique blockid))
528 ]
529
530 pprInstr platform (BF cond b blockid)
531 = hcat [
532 ptext (sLit "\tfb"), pprCond cond,
533 if b then pp_comma_a else empty,
534 char '\t',
535 pprCLabel_asm platform (mkAsmTempLabel (getUnique blockid))
536 ]
537
538 pprInstr platform (JMP addr) = (<>) (ptext (sLit "\tjmp\t")) (pprAddr platform addr)
539 pprInstr platform (JMP_TBL op _ _) = pprInstr platform (JMP op)
540
541 pprInstr platform (CALL (Left imm) n _)
542 = hcat [ ptext (sLit "\tcall\t"), pprImm platform imm, comma, int n ]
543
544 pprInstr _ (CALL (Right reg) n _)
545 = hcat [ ptext (sLit "\tcall\t"), pprReg reg, comma, int n ]
546
547
548 -- | Pretty print a RI
549 pprRI :: Platform -> RI -> Doc
550 pprRI _ (RIReg r) = pprReg r
551 pprRI platform (RIImm r) = pprImm platform r
552
553
554 -- | Pretty print a two reg instruction.
555 pprSizeRegReg :: LitString -> Size -> Reg -> Reg -> Doc
556 pprSizeRegReg name size reg1 reg2
557 = hcat [
558 char '\t',
559 ptext name,
560 (case size of
561 FF32 -> ptext (sLit "s\t")
562 FF64 -> ptext (sLit "d\t")
563 _ -> panic "SPARC.Ppr.pprSizeRegReg: no match"),
564
565 pprReg reg1,
566 comma,
567 pprReg reg2
568 ]
569
570
571 -- | Pretty print a three reg instruction.
572 pprSizeRegRegReg :: LitString -> Size -> Reg -> Reg -> Reg -> Doc
573 pprSizeRegRegReg name size reg1 reg2 reg3
574 = hcat [
575 char '\t',
576 ptext name,
577 (case size of
578 FF32 -> ptext (sLit "s\t")
579 FF64 -> ptext (sLit "d\t")
580 _ -> panic "SPARC.Ppr.pprSizeRegReg: no match"),
581 pprReg reg1,
582 comma,
583 pprReg reg2,
584 comma,
585 pprReg reg3
586 ]
587
588
589 -- | Pretty print an instruction of two regs and a ri.
590 pprRegRIReg :: Platform -> LitString -> Bool -> Reg -> RI -> Reg -> Doc
591 pprRegRIReg platform name b reg1 ri reg2
592 = hcat [
593 char '\t',
594 ptext name,
595 if b then ptext (sLit "cc\t") else char '\t',
596 pprReg reg1,
597 comma,
598 pprRI platform ri,
599 comma,
600 pprReg reg2
601 ]
602
603 {-
604 pprRIReg :: LitString -> Bool -> RI -> Reg -> Doc
605 pprRIReg name b ri reg1
606 = hcat [
607 char '\t',
608 ptext name,
609 if b then ptext (sLit "cc\t") else char '\t',
610 pprRI ri,
611 comma,
612 pprReg reg1
613 ]
614 -}
615
616 {-
617 pp_ld_lbracket :: Doc
618 pp_ld_lbracket = ptext (sLit "\tld\t[")
619 -}
620
621 pp_rbracket_comma :: Doc
622 pp_rbracket_comma = text "],"
623
624
625 pp_comma_lbracket :: Doc
626 pp_comma_lbracket = text ",["
627
628
629 pp_comma_a :: Doc
630 pp_comma_a = text ",a"
631