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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 410, Fri Sep 3 00:25:03 1999 UTC revision 411, Fri Sep 3 00:25:03 1999 UTC
# Line 1  Line 1 
1  (* insnProps.sig --- instruction set properties  (*
2   *   * Basic Instruction properties that must be supported on all architectures.
  * COPYRIGHT (c) 1996 AT&T Bell Laboratories.  
3   *   *
4     * -- Allen
5   *)   *)
6  signature INSN_PROPERTIES = sig  signature INSN_PROPERTIES =
7    sig
8     structure C : CELLS     structure C : CELLS
9     structure I : INSTRUCTIONS     structure I : INSTRUCTIONS
10    
11     sharing I.C = C     sharing I.C = C
12    
13     exception NegateConditional        (* 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    
    datatype kind = IK_JUMP | IK_NOP | IK_INSTR  
    datatype target = LABELLED of Label.label | FALLTHROUGH | ESCAPES  
   
    (*========================================================================  
     *  Instruction Kinds  
     *========================================================================*)  
27     val instrKind     : I.instruction -> kind     val instrKind     : I.instruction -> kind
       (* kind of instruction  *)  
28    
29          (* parallel moves *)
30     val moveInstr     : I.instruction -> bool     val moveInstr     : I.instruction -> bool
31        (* is the instruction a move? Assumed to have exactly one     val moveTmpR   : I.instruction -> C.register option
32         * source and one destination     val moveDstSrc : I.instruction -> C.register list * C.register list
        *)  
    val nop           : unit -> I.instruction  
       (* generate a nop *)  
33    
34     (*========================================================================        (* no op *)
35      *  Parallel Move     val nop        : unit -> I.instruction
     *========================================================================*)  
    val moveTmpR : I.instruction -> int option  
       (* temporary register associated with parallel move  
        * instructions if any.  
        *)  
   
    val moveDstSrc : I.instruction -> int list * int list  
       (* source and destinations associated with a parallel move *)  
   
    val copy : { src : int list, dst : int list } -> I.instruction  
       (* create a parallel move *)  
36    
37     val fcopy : { src : int list, dst : int list } -> I.instruction        (* jump instruction *)
38        (* create a floating point parallel move *)     val jump       : Label.label -> I.instruction
39    
40     val splitCopies:{regmap:int->int, insns:I.instruction list} -> I.instruction list        (* load immediate; must be within immedRange *)
41        (* split all parallel moves in the instruction stream into individual moves *)     val immedRange : {lo:int, hi:int}
42       val loadImmed  : {immed:int, t:C.register} -> I.instruction
43    
44     (*========================================================================       (*
45      *  Branches and Calls/Returns        * 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     val branchTargets : I.instruction -> target list     val branchTargets : I.instruction -> target list
       (* targets of an instruction. The instruction kind must be IK_JUMP *)  
   
    val jump : Label.label -> I.instruction  
       (* create a jump instruction *)  
50    
51          (* Set the branch target; no effect if not a branch instruction *)
52     val setTargets : I.instruction * Label.label list -> I.instruction     val setTargets : I.instruction * Label.label list -> I.instruction
       (* set the targets of a branch/jump instruction.  
        * do nothing if the instruction is not a branch/jump instruction  
        *)  
   
    val negateConditional : I.instruction -> I.instruction  
       (* negate a conditional branch.  
        * raise NegateConditional if the instruction is not a conditional  
        * or if it cannot be negated.  
        *)  
53    
54     (*========================================================================        (* equality and hashing on operands *)
55      *  Definition and use (for register allocation mainly)     val eqOpn      : I.operand * I.operand -> bool
56      *========================================================================*)     val hashOpn    : I.operand -> word
    val defUse : C.cellclass -> I.instruction -> (int list * int list)  
       (* def/use lists *)  
 end  
57    
58          (* Negate the branching condition; raises NegateConditional
59           * if it is impossible to negate
60           *)
61       exception NegateConditional
62       val negateConditional : I.instruction -> I.instruction
63    
64         (* definition/use for the RA *)
65       val defUse     : C.cellkind ->
66                          I.instruction -> (C.register list * C.register list)
67    
68         (* annotations *)
69       val getAnnotations : I.instruction -> Annotations.annotation list
70       val annotate       : I.instruction * Annotations.annotation -> I.instruction
71    
72  (*  (*
73   * $Log: insnProps.sig,v $        * Nested regions.
74   * Revision 1.3  1998/05/25 15:11:04  george        * These functions allow the client to convert a complex region
75   *   Fixed RCS keywords        * 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    

Legend:
Removed from v.410  
changed lines
  Added in v.411

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