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/x86/instructions/x86FreqProps.sml
ViewVC logotype

Annotation of /sml/trunk/src/MLRISC/x86/instructions/x86FreqProps.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1121 - (view) (download)

1 : monnier 427 (*
2 :     * Extract frequency information from the X86 architecture
3 :     *
4 :     * -- Allen
5 :     *)
6 :     functor X86FreqProps(X86Instr : X86INSTR) : FREQUENCY_PROPERTIES =
7 :     struct
8 :    
9 :     structure I = X86Instr
10 :    
11 : george 1003 fun x86BranchProb(I.JCC{cond=I.EQ,...}) = 10
12 :     | x86BranchProb(I.JCC{cond=I.O,...}) = 0 (* overflow *)
13 :     | x86BranchProb(I.JCC{cond=I.NE,...}) = 90
14 :     | x86BranchProb(I.JCC{cond=I.NO,...}) = 100
15 :     | x86BranchProb(I.JCC _) = 50 (* default *)
16 :     | x86BranchProb(I.JMP _) = 100
17 :     | x86BranchProb _ = 0 (* non-branch *)
18 :    
19 :     and branchProb(I.ANNOTATION{a, i, ...}) =
20 : monnier 498 (case #peek MLRiscAnnotations.BRANCH_PROB a of
21 : monnier 469 SOME b => b
22 :     | NONE => branchProb i
23 :     )
24 : blume 1121 | branchProb (I.INSTR i) = Probability.percent (x86BranchProb i)
25 :     | branchProb _ = Probability.never
26 : monnier 427 end
27 :    

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