Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/MLRISC/alpha/instructions/alphaFreqProps.sml
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1002, Fri Nov 30 17:11:33 2001 UTC revision 1003, Fri Dec 7 02:45:32 2001 UTC
# Line 9  Line 9 
9    
10     structure I = AlphaInstr     structure I = AlphaInstr
11    
12       fun alphaBranchProb(I.BRANCH{b=I.BR, ...}) = 100 (* unconditional *)
13         | alphaBranchProb(I.BRANCH{b=I.BEQ, ...}) = 10
14         | alphaBranchProb(I.BRANCH{b=I.BNE, ...}) = 90
15         | alphaBranchProb(I.FBRANCH{b=I.FBEQ, ...}) = 10
16         | alphaBranchProb(I.FBRANCH{b=I.FBNE, ...}) = 90
17         | alphaBranchProb(I.BRANCH _) = 50 (* default *)
18         | alphaBranchProb(I.FBRANCH _) = 50 (* default *)
19         | alphaBranchProb(I.JMPL(_,[])) = 100 (* unconditional *)
20         | alphaBranchProb(I.JMPL(_,labs)) = 100 div length labs  (* assume equal prob *)
21         | alphaBranchProb(I.RET _) = 100
22         | alphaBranchProb _ = 0 (* non-branch *)
23    
24     fun branchProb(I.ANNOTATION{a, i, ...}) =     fun branchProb(I.ANNOTATION{a, i, ...}) =
25          (case #peek MLRiscAnnotations.BRANCH_PROB a of          (case #peek MLRiscAnnotations.BRANCH_PROB a of
26             SOME b => b             SOME b => b
27           | NONE => branchProb i           | NONE => branchProb i
28          )          )
29       | branchProb(I.BRANCH{b=I.BR, ...}) = 100 (* unconditional *)       | branchProb(I.INSTR i) = alphaBranchProb(i)
      | branchProb(I.BRANCH{b=I.BEQ, ...}) = 10  
      | branchProb(I.BRANCH{b=I.BNE, ...}) = 90  
      | branchProb(I.FBRANCH{b=I.FBEQ, ...}) = 10  
      | branchProb(I.FBRANCH{b=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  
30       | branchProb _ = 0 (* non-branch *)       | branchProb _ = 0 (* non-branch *)
   
31  end  end

Legend:
Removed from v.1002  
changed lines
  Added in v.1003

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