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/sparc/instructions/sparcFreqProps.sml
ViewVC logotype

Annotation of /sml/trunk/src/MLRISC/sparc/instructions/sparcFreqProps.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1003 - (view) (download)

1 : monnier 427 (*
2 :     * Extract frequency information from the sparc architecture
3 :     *
4 :     * -- Allen
5 :     *)
6 :    
7 :     functor SparcFreqProps(SparcInstr : SPARCINSTR) : FREQUENCY_PROPERTIES =
8 :     struct
9 :    
10 :     structure I = SparcInstr
11 :    
12 :     fun cond I.BA = 100
13 :     | cond I.BE = 10
14 :     | cond I.BNE = 90
15 :     | cond _ = 50
16 :    
17 :     fun fcond I.FBA = 100
18 :     | fcond I.FBE = 10
19 :     | fcond I.FBNE = 90
20 :     | fcond _ = 50
21 :    
22 : george 1003 fun sparcBranchProb(I.Bicc{b,...}) = cond b
23 :     | sparcBranchProb(I.FBfcc{b,...}) = fcond b
24 :     | sparcBranchProb(I.BP{b,...}) = cond b
25 :     | sparcBranchProb(I.BR _) = 50
26 :     | sparcBranchProb(I.JMP _) = 100
27 :     | sparcBranchProb(I.RET _) = 100
28 :     | sparcBranchProb _ = 0 (* non-branch *)
29 :    
30 : monnier 469 fun branchProb(I.ANNOTATION{a, i, ...}) =
31 : monnier 498 (case #peek MLRiscAnnotations.BRANCH_PROB a of
32 : monnier 469 SOME b => b
33 :     | NONE => branchProb i
34 :     )
35 : george 1003 | branchProb(I.INSTR(i)) = sparcBranchProb(i)
36 :     | branchProb _ = 0
37 : monnier 427
38 :     end

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