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/alpha/instructions/alphaFreqProps.sml
ViewVC logotype

View of /sml/branches/SMLNJ/src/MLRISC/alpha/instructions/alphaFreqProps.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 469 - (download) (annotate)
Wed Nov 10 22:42:52 1999 UTC (20 years, 5 months ago) by monnier
File size: 921 byte(s)
version 110.23
(*
 * Extract frequency information from the Alpha architecture
 * 
 * -- Allen
 *)

functor AlphaFreqProps(AlphaInstr : ALPHAINSTR) : FREQUENCY_PROPERTIES =
struct

   structure I = AlphaInstr

   fun branchProb(I.ANNOTATION{a, i, ...}) =
        (case #peek BasicAnnotations.BRANCH_PROB a of
           SOME b => b
         | NONE => branchProb i
        )
     | branchProb(I.BRANCH(I.BR,_,_)) = 100 (* unconditional *)
     | branchProb(I.BRANCH(I.BEQ,_,_)) = 10
     | branchProb(I.BRANCH(I.BNE,_,_)) = 90
     | branchProb(I.FBRANCH(I.FBEQ,_,_)) = 10 
     | branchProb(I.FBRANCH(I.FBNE,_,_)) = 90
     | branchProb(I.BRANCH _) = 50 (* default *)
     | branchProb(I.FBRANCH _) = 50 (* default *)
     | branchProb(I.JMPL(_,[])) = 100 (* unconditional *)
     | branchProb(I.JMPL(_,labs)) = 100 div length labs  (* assume equal prob *)
     | branchProb(I.RET _) = 100
     | branchProb _ = 0 (* non-branch *)

end

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