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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 428 - (view) (download)
Original Path: sml/branches/SMLNJ/src/MLRISC/alpha/instructions/alphaFreqProps.sml

1 : monnier 427 (*
2 :     * Extract frequency information from the Alpha architecture
3 :     *
4 :     * -- Allen
5 :     *)
6 :    
7 :     functor AlphaFreqProps(AlphaInstr : ALPHAINSTR) : FREQUENCY_PROPERTIES =
8 :     struct
9 :    
10 :     structure I = AlphaInstr
11 :    
12 :     fun branchProb(I.ANNOTATION{a=BasicAnnotations.BRANCH_PROB b,...}) = b
13 :     | branchProb(I.ANNOTATION{i,...}) = branchProb i
14 :     | branchProb(I.BRANCH(I.BR,_,_)) = 100 (* unconditional *)
15 :     | branchProb(I.BRANCH(I.BEQ,_,_)) = 10
16 :     | branchProb(I.BRANCH(I.BNE,_,_)) = 90
17 :     | branchProb(I.FBRANCH(I.FBEQ,_,_)) = 10
18 :     | branchProb(I.FBRANCH(I.FBNE,_,_)) = 90
19 :     | branchProb(I.BRANCH _) = 50 (* default *)
20 :     | branchProb(I.FBRANCH _) = 50 (* default *)
21 :     | branchProb(I.JMPL(_,[])) = 100 (* unconditional *)
22 :     | branchProb(I.JMPL(_,labs)) = 100 div length labs (* assume equal prob *)
23 :     | branchProb(I.RET _) = 100
24 :     | branchProb _ = 0 (* non-branch *)
25 :    
26 :     end

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