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/basicAnnotations.sml
ViewVC logotype

Annotation of /sml/trunk/src/MLRISC/instructions/basicAnnotations.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 409 - (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 :     (* the branch probability of conditional branches *)
11 :     exception BRANCH_PROB of int (* in percentage *)
12 :    
13 :     (* the execution frequency of a basic block *)
14 :     exception EXECUTION_FREQ of real
15 :    
16 :     (* no effect at all; just allows you to insert comments *)
17 :     exception COMMENT of string
18 :    
19 :     (* control dependence definition and use *)
20 :     exception CTRL_DEF of int
21 :     exception CTRL_USE of int
22 :    
23 :     fun toString(BRANCH_PROB b) = "branch("^Int.toString b^"%)"
24 :     | toString(EXECUTION_FREQ r) = "freq("^Real.toString r^")"
25 :     | toString(COMMENT s) = s
26 :     | toString(CTRL_DEF x) = "ctrl-def "^Int.toString x
27 :     | toString(CTRL_USE x) = "ctrl-use "^Int.toString x
28 :     | toString a = raise a
29 :    
30 :     val _ = Annotations.attachPrettyPrinter toString
31 :    
32 :     end

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