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/hppa/instructions/hppaFreqProps.sml
ViewVC logotype

Annotation of /sml/branches/SMLNJ/src/MLRISC/hppa/instructions/hppaFreqProps.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 469 - (view) (download)

1 : monnier 427 (*
2 :     * Extract frequency properties from the HP architecture
3 :     *
4 :     * -- Allen
5 :     *)
6 :    
7 :     functor HppaFreqProps(HppaInstr : HPPAINSTR): FREQUENCY_PROPERTIES =
8 :     struct
9 :    
10 :     structure I = HppaInstr
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.BCOND{cmp=I.COMBT,bc=I.EQ,...}) = 10
18 :     | branchProb(I.BCOND{cmp=I.COMBF,bc=I.EQ,...}) = 90
19 :     | branchProb(I.BCOND{cmp=I.COMBT,bc=I.NE,...}) = 90
20 :     | branchProb(I.BCOND{cmp=I.COMBF,bc=I.NE,...}) = 10
21 :     | branchProb(I.BCONDI{cmpi=I.COMIBT,bc=I.EQ,...}) = 10
22 :     | branchProb(I.BCONDI{cmpi=I.COMIBF,bc=I.EQ,...}) = 90
23 :     | branchProb(I.BCONDI{cmpi=I.COMIBT,bc=I.NE,...}) = 90
24 :     | branchProb(I.BCONDI{cmpi=I.COMIBF,bc=I.NE,...}) = 10
25 :     | branchProb(I.BCOND _) = 50 (* default *)
26 :     | branchProb(I.BCONDI _) = 50 (* default *)
27 :     | branchProb(I.FBRANCH _) = 50 (* default *)
28 :     | branchProb(I.BB _) = 50 (* branch on bit *)
29 :     | branchProb(I.B _) = 100 (* unconditional *)
30 :     | branchProb(I.BE{labs=[], ...}) = 100 (* escapes *)
31 :     | branchProb(I.BE{labs,...}) = 100 div length labs (* assume equal prob *)
32 :     | branchProb(I.BV{labs=[],...}) = 100 (* escapes *)
33 :     | branchProb(I.BV{labs,...}) = 100 div length labs (* assume equal prob *)
34 :     | branchProb(I.BLR{labs,...}) = 100 div length labs (* assume equal prob *)
35 :     | branchProb _ = 0 (* non-branch *)
36 :    
37 :     end

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