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 651 - (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 : monnier 469 fun branchProb(I.ANNOTATION{a, i, ...}) =
12 : monnier 498 (case #peek MLRiscAnnotations.BRANCH_PROB a of
13 : monnier 469 SOME b => b
14 :     | NONE => branchProb i
15 :     )
16 : monnier 427 | branchProb(I.JCC{cond=I.EQ,...}) = 10
17 :     | branchProb(I.JCC{cond=I.O,...}) = 0 (* overflow *)
18 :     | branchProb(I.JCC{cond=I.NE,...}) = 90
19 :     | branchProb(I.JCC{cond=I.NO,...}) = 100
20 :     | branchProb(I.JCC _) = 50 (* default *)
21 :     | branchProb(I.JMP _) = 100
22 :     | branchProb _ = 0 (* non-branch *)
23 :    
24 :     end
25 :    

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