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 545 - (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 : monnier 498 (case #peek MLRiscAnnotations.BRANCH_PROB a of
14 : monnier 469 SOME b => b
15 :     | NONE => branchProb i
16 :     )
17 : george 545 | branchProb(I.BRANCH{b=I.BR, ...}) = 100 (* unconditional *)
18 :     | branchProb(I.BRANCH{b=I.BEQ, ...}) = 10
19 :     | branchProb(I.BRANCH{b=I.BNE, ...}) = 90
20 :     | branchProb(I.FBRANCH{b=I.FBEQ, ...}) = 10
21 :     | branchProb(I.FBRANCH{b=I.FBNE, ...}) = 90
22 : monnier 427 | 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