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

View of /sml/trunk/src/MLRISC/alpha/instructions/alphaFreqProps.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 427 - (download) (annotate)
Wed Sep 8 09:40:08 1999 UTC (20 years, 3 months ago) by monnier
File size: 885 byte(s)
Initial revision
(*
 * Extract frequency information from the Alpha architecture
 * 
 * -- Allen
 *)

functor AlphaFreqProps(AlphaInstr : ALPHAINSTR) : FREQUENCY_PROPERTIES =
struct

   structure I = AlphaInstr

   fun branchProb(I.ANNOTATION{a=BasicAnnotations.BRANCH_PROB b,...}) = b
     | branchProb(I.ANNOTATION{i,...}) = 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