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/ppc/instructions/ppcFreqProps.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/ppc/instructions/ppcFreqProps.sml

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

revision 1124, Thu Mar 7 19:49:22 2002 UTC revision 1125, Thu Mar 7 21:04:13 2002 UTC
# Line 1  Line 1 
1  (*  (* ppcFreqProps.sml
2     *
3     * COPYRIGHT (c) 2002 Bell Labs, Lucent Technologies
4     *
5   * Extract frequency information from the PowerPC architecture   * Extract frequency information from the PowerPC architecture
6   *   *
7   * -- Allen   * -- Allen
# Line 9  Line 12 
12    
13     structure I = PPCInstr     structure I = PPCInstr
14    
15     fun ppcBranchProb(I.BC _) = 50     val p10 = Probability.percent 10
16       | ppcBranchProb(I.BCLR{labels=[],bo=I.ALWAYS,...}) = 100     val p50 = Probability.percent 50
17       | ppcBranchProb(I.BCLR{labels,bo=I.ALWAYS,...}) = 100 div length labels     val p90 = Probability.percent 90
18       | ppcBranchProb(I.BCLR{labels=[],bo,...}) = 50     val p100 = Probability.always
19       | ppcBranchProb(I.BCLR{labels,bo,...}) = 100 div length labels  
20       | ppcBranchProb _ = 0 (* non-branch *)     fun ppcBranchProb(I.BC _) = p50
21         | ppcBranchProb(I.BCLR{labels=[],bo=I.ALWAYS,...}) = p100
22         | ppcBranchProb(I.BCLR{labels,bo=I.ALWAYS,...}) =
23            Probability.prob(1, length labels)
24         | ppcBranchProb(I.BCLR{labels=[],bo,...}) = p50
25         | ppcBranchProb(I.BCLR{labels,bo,...}) =
26            Probability.prob(1, length labels)
27         | ppcBranchProb _ = Probability.never (* non-branch *)
28    
29     fun branchProb(I.ANNOTATION{a, i, ...}) =     fun branchProb(I.ANNOTATION{a, i, ...}) =
30          (case #peek MLRiscAnnotations.BRANCH_PROB a of          (case #peek MLRiscAnnotations.BRANCH_PROB a of
31             SOME b => b             SOME b => b
32           | NONE => branchProb i           | NONE => branchProb i
33          )          )
34       | branchProb(I.INSTR(i)) = Probability.percent (ppcBranchProb i)       | branchProb(I.INSTR(i)) = ppcBranchProb(i)
35       | branchProb _ = Probability.never       | branchProb _ = Probability.never
36    
37  end  end

Legend:
Removed from v.1124  
changed lines
  Added in v.1125

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