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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 469 - (view) (download)

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 : monnier 469 fun branchProb(I.ANNOTATION{a, i, ...}) =
13 :     (case #peek BasicAnnotations.BRANCH_PROB a of
14 :     SOME b => b
15 :     | NONE => branchProb i
16 :     )
17 : monnier 427 | branchProb(I.BRANCH(I.BR,_,_)) = 100 (* unconditional *)
18 :     | branchProb(I.BRANCH(I.BEQ,_,_)) = 10
19 :     | branchProb(I.BRANCH(I.BNE,_,_)) = 90
20 :     | branchProb(I.FBRANCH(I.FBEQ,_,_)) = 10
21 :     | branchProb(I.FBRANCH(I.FBNE,_,_)) = 90
22 :     | branchProb(I.BRANCH _) = 50 (* default *)
23 :     | branchProb(I.FBRANCH _) = 50 (* default *)
24 :     | branchProb(I.JMPL(_,[])) = 100 (* unconditional *)
25 :     | branchProb(I.JMPL(_,labs)) = 100 div length labs (* assume equal prob *)
26 :     | branchProb(I.RET _) = 100
27 :     | branchProb _ = 0 (* non-branch *)
28 :    
29 :     end

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