Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/src/MLRISC/instructions/insnProps.sig
ViewVC logotype

Annotation of /sml/trunk/src/MLRISC/instructions/insnProps.sig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 411 - (view) (download) (as text)
Original Path: sml/branches/SMLNJ/src/MLRISC/instructions/insnProps.sig

1 : monnier 411 (*
2 :     * Basic Instruction properties that must be supported on all architectures.
3 : monnier 245 *
4 : monnier 411 * -- Allen
5 : monnier 245 *)
6 : monnier 411 signature INSN_PROPERTIES =
7 :     sig
8 : monnier 245 structure C : CELLS
9 :     structure I : INSTRUCTIONS
10 :    
11 :     sharing I.C = C
12 :    
13 : monnier 411 (* classify instructions *)
14 :     datatype kind = IK_JUMP (* branches, including returns *)
15 :     | IK_NOP (* no ops *)
16 :     | IK_INSTR (* normal instructions *)
17 :     | IK_COPY (* parallel copy *)
18 :     | IK_CALL (* call instructions *)
19 :     | IK_GROUP (* A nested region of instructions.
20 :     * These are generated by various optimization
21 :     * phases.
22 :     *)
23 :     | IK_PHI (* A phi node (SSA) *)
24 :     | IK_SINK (* A source node (SSA) *)
25 :     | IK_SOURCE (* A sink node (SSA) *)
26 : monnier 245
27 : monnier 411 val instrKind : I.instruction -> kind
28 : monnier 245
29 : monnier 411 (* parallel moves *)
30 :     val moveInstr : I.instruction -> bool
31 :     val moveTmpR : I.instruction -> C.register option
32 :     val moveDstSrc : I.instruction -> C.register list * C.register list
33 : monnier 245
34 : monnier 411 (* no op *)
35 :     val nop : unit -> I.instruction
36 : monnier 245
37 : monnier 411 (* jump instruction *)
38 :     val jump : Label.label -> I.instruction
39 : monnier 245
40 : monnier 411 (* load immediate; must be within immedRange *)
41 :     val immedRange : {lo:int, hi:int}
42 :     val loadImmed : {immed:int, t:C.register} -> I.instruction
43 : monnier 245
44 : monnier 411 (*
45 :     * Targets of a branch instruction
46 :     * precondition: instruction must be of type IK_JUMP.
47 :     *)
48 :     datatype target = LABELLED of Label.label | FALLTHROUGH | ESCAPES
49 : monnier 245 val branchTargets : I.instruction -> target list
50 :    
51 : monnier 411 (* Set the branch target; no effect if not a branch instruction *)
52 : monnier 245 val setTargets : I.instruction * Label.label list -> I.instruction
53 : monnier 411
54 :     (* equality and hashing on operands *)
55 :     val eqOpn : I.operand * I.operand -> bool
56 :     val hashOpn : I.operand -> word
57 : monnier 245
58 : monnier 411 (* Negate the branching condition; raises NegateConditional
59 :     * if it is impossible to negate
60 :     *)
61 :     exception NegateConditional
62 : monnier 245 val negateConditional : I.instruction -> I.instruction
63 :    
64 : monnier 411 (* definition/use for the RA *)
65 :     val defUse : C.cellkind ->
66 :     I.instruction -> (C.register list * C.register list)
67 : monnier 245
68 : monnier 411 (* annotations *)
69 :     val getAnnotations : I.instruction -> Annotations.annotation list
70 :     val annotate : I.instruction * Annotations.annotation -> I.instruction
71 : monnier 245
72 : monnier 411 (*
73 :     * Nested regions.
74 :     * These functions allow the client to convert a complex region
75 :     * of instructions (wrapped around by an annotation) into an instruction
76 :     * and vice versa.
77 :     *)
78 :     val getGroup : I.instruction -> Annotations.annotation
79 :     val makeGroup : Annotations.annotation -> I.instruction
80 :     end
81 : monnier 245

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0