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

SCM Repository

[smlnj] View of /sml/branches/SMLNJ/src/MLRISC/instructions/basicAnnotations.sml
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 475 - (download) (annotate)
Wed Nov 10 22:59:58 1999 UTC (19 years, 8 months ago) by monnier
File size: 1645 byte(s)
version 110.24
(*
 * These are some basic annotations understood by the MLRISC system
 *
 * -- Allen
 *)

structure BasicAnnotations : BASIC_ANNOTATIONS =
struct

   structure A = Annotations

    (* the branch probability of conditional branches *)
    (* in percentage *) 
   val BRANCH_PROB = A.new(SOME(fn b => "branch("^Int.toString b^"%)"))

    (* the execution frequency of a basic block *)
   val EXECUTION_FREQ = A.new(SOME(fn r => "freq("^Real.toString r^")"))

    (* no effect at all; just allows you to insert comments *)
   val COMMENT = A.new(SOME(fn s => s))

    (* control dependence definition and use *)
   datatype ctrl_dep = CTRL_DEF of int | CTRL_USE of int
   fun prCtrl (CTRL_DEF x) = "ctrl-def "^Int.toString x
     | prCtrl (CTRL_USE x) = "ctrl-use "^Int.toString x
   val CTRL = A.new(SOME prCtrl)

    (*
     * These annotations specifies definitions and uses                              * for a pseudo instruction.
     *)
   fun defUse(d,u) =
   let fun list l = 
           String.concat(foldr (fn (r,l) => Int.toString r::" "::l) [] l)
   in  "defs="^list d^" uses="^list u end

   val DEFUSER  = A.new(SOME(fn x => "reg "^defUse x))
   val DEFUSEF  = A.new(SOME(fn x => "freg "^defUse x))
   val DEFUSECC = A.new(SOME(fn x => "ccreg "^defUse x))

   val REGINFO = A.new(SOME(fn _ => "REGINFO")) : (int -> string) A.property
   val SHOW_CELLSET = A.newFlag("SHOW_CELLSET") 

   val NO_OPTIMIZATION = A.newFlag("NO_OPTIMIZATION") 
   val CALLGC = A.newFlag("CALLGC") 
   val BLOCK_NAMES = A.new(SOME(fn _ => "BLOCK_NAMES")) :
                       A.annotations A.property
   val EMPTY_BLOCK = A.newFlag("EMPTY_BLOCK")

end

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