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/branches/SMLNJ/src/MLRISC/instructions/basicAnnotations.sml
ViewVC logotype

Annotation of /sml/branches/SMLNJ/src/MLRISC/instructions/basicAnnotations.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 469 - (view) (download)

1 : monnier 409 (*
2 :     * These are some basic annotations understood by the MLRISC system
3 :     *
4 :     * -- Allen
5 :     *)
6 :    
7 :     structure BasicAnnotations : BASIC_ANNOTATIONS =
8 :     struct
9 :    
10 : monnier 469 structure A = Annotations
11 :    
12 : monnier 409 (* the branch probability of conditional branches *)
13 : monnier 469 (* in percentage *)
14 :     val BRANCH_PROB = A.new(SOME(fn b => "branch("^Int.toString b^"%)"))
15 : monnier 409
16 :     (* the execution frequency of a basic block *)
17 : monnier 469 val EXECUTION_FREQ = A.new(SOME(fn r => "freq("^Real.toString r^")"))
18 : monnier 409
19 :     (* no effect at all; just allows you to insert comments *)
20 : monnier 469 val COMMENT = A.new(SOME(fn s => s))
21 : monnier 409
22 :     (* control dependence definition and use *)
23 : monnier 469 datatype ctrl_dep = CTRL_DEF of int | CTRL_USE of int
24 :     fun prCtrl (CTRL_DEF x) = "ctrl-def "^Int.toString x
25 :     | prCtrl (CTRL_USE x) = "ctrl-use "^Int.toString x
26 :     val CTRL = A.new(SOME prCtrl)
27 : monnier 409
28 : monnier 429 (*
29 :     * These annotations specifies definitions and uses * for a pseudo instruction.
30 :     *)
31 : monnier 469 fun defUse(d,u) =
32 : monnier 429 let fun list l =
33 :     String.concat(foldr (fn (r,l) => Int.toString r::" "::l) [] l)
34 :     in "defs="^list d^" uses="^list u end
35 :    
36 : monnier 469 val DEFUSER = A.new(SOME(fn x => "reg "^defUse x))
37 :     val DEFUSEF = A.new(SOME(fn x => "freg "^defUse x))
38 :     val DEFUSECC = A.new(SOME(fn x => "ccreg "^defUse x))
39 : monnier 409
40 : monnier 469 val REGINFO = A.new(SOME(fn _ => "REGINFO")) : (int -> string) A.property
41 :    
42 :     val NO_OPTIMIZATION = A.newFlag("NO_OPTIMIZATION") : unit A.property
43 :     val CALLGC = A.newFlag("CALLGC") : unit A.property
44 :    
45 : monnier 409 end

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