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/mips/instructions/mipsFreqProps.sml
ViewVC logotype

View of /sml/trunk/src/MLRISC/mips/instructions/mipsFreqProps.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1326 - (download) (annotate)
Wed May 14 21:20:29 2003 UTC (17 years, 2 months ago) by allenleung
File size: 655 byte(s)
    Completely non-functional MIPS backend.
(*
 * Extract frequency information from the MIPS architecture
 * 
 * -- Allen
 *)

functor MIPSFreqProps(MIPSInstr : MIPSINSTR) : FREQUENCY_PROPERTIES =
struct

   structure I = MIPSInstr

   fun branchProb(I.ANNOTATION{a, i, ...}) =
        (case #peek MLRiscAnnotations.BRANCH_PROB a of
           SOME b => b
         | NONE => branchProb i
        )
     | branchProb(I.BRANCH{likely,...}) = 50 (* default *)
     | branchProb(I.FBRANCH{likely,...}) = 50 (* default *)
     | branchProb(I.J _) = 100 (* unconditional *)
     | branchProb(I.JR{labels,...}) = 100 div length labels (* assume equal prob *)
     | branchProb _ = 0 (* non-branch *)

end

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