Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/src/MLRISC/x86/instructions/x86FreqProps.sml
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 651 - (download) (annotate)
Thu Jun 1 18:34:03 2000 UTC (19 years, 4 months ago) by monnier
File size: 669 byte(s)
bring revisions from the vendor branch to the trunk
(*
 * Extract frequency information from the X86 architecture
 *
 * -- Allen
 *)
functor X86FreqProps(X86Instr : X86INSTR) : FREQUENCY_PROPERTIES =
struct

   structure I = X86Instr

   fun branchProb(I.ANNOTATION{a, i, ...}) =
        (case #peek MLRiscAnnotations.BRANCH_PROB a of
           SOME b => b
         | NONE => branchProb i
        )
     | branchProb(I.JCC{cond=I.EQ,...}) = 10
     | branchProb(I.JCC{cond=I.O,...}) = 0 (* overflow *)
     | branchProb(I.JCC{cond=I.NE,...}) = 90
     | branchProb(I.JCC{cond=I.NO,...}) = 100
     | branchProb(I.JCC _) = 50 (* default *)
     | branchProb(I.JMP _) = 100 
     | branchProb _ = 0 (* non-branch *)

end


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