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

Annotation of /sml/trunk/src/MLRISC/hppa/instructions/hppaFreqProps.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 657 - (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 : monnier 498 (case #peek MLRiscAnnotations.BRANCH_PROB a of
14 : monnier 469 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 : leunga 657 (*| branchProb(I.BB{bc=I.BCLR, p=31, ...}) = 10
29 :     | branchProb(I.BB{bc=I.BSET, p=31, ...}) = 90 *)
30 : monnier 427 | branchProb(I.BB _) = 50 (* branch on bit *)
31 :     | branchProb(I.B _) = 100 (* unconditional *)
32 :     | branchProb(I.BE{labs=[], ...}) = 100 (* escapes *)
33 :     | branchProb(I.BE{labs,...}) = 100 div length labs (* assume equal prob *)
34 :     | branchProb(I.BV{labs=[],...}) = 100 (* escapes *)
35 :     | branchProb(I.BV{labs,...}) = 100 div length labs (* assume equal prob *)
36 :     | branchProb(I.BLR{labs,...}) = 100 div length labs (* assume equal prob *)
37 :     | branchProb _ = 0 (* non-branch *)
38 :    
39 :     end

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