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 469 - (download) (annotate)
Wed Nov 10 22:42:52 1999 UTC (20 years, 1 month ago) by monnier
Original Path: sml/branches/SMLNJ/src/MLRISC/x86/instructions/x86FreqProps.sml
File size: 668 byte(s)
version 110.23
(*
 * 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 BasicAnnotations.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