2 % (c) The AQUA Project, Glasgow University, 1993-1998
5 This is useful, general stuff for the Native Code Generator.
11 mkParList, mkSeqList, mkEmptyList, mkUnitList,
17 This section provides an ordering list that allows fine grain
18 parallelism to be expressed. This is used (ultimately) for scheduling
19 of assembly language instructions.
23 = SeqList (OrdList a) (OrdList a)
24 | ParList (OrdList a) (OrdList a)
29 mkSeqList a b = SeqList a b
30 mkParList a b = ParList a b
35 %------------------------------------------------------------------------
37 Notice this this throws away all potential expression of parallelism.
40 flattenOrdList :: OrdList a -> [a]
45 flat NoObj rest = rest
46 flat (OrdObj x) rest = x:rest
47 flat (ParList a b) rest = flat a (flat b rest)
48 flat (SeqList a b) rest = flat a (flat b rest)
51 instance Text (OrdList a) where
52 showsPrec _ NoObj = showString "_N_"
53 showsPrec _ (OrdObj _) = showString "_O_"
54 showsPrec _ (ParList a b) = showString "(PAR " . shows a . showChar ')'
55 showsPrec _ (SeqList a b) = showString "(SEQ " . shows a . showChar ')'