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/ppc/instructions/ppcFreqProps.sml
ViewVC logotype

View of /sml/trunk/src/MLRISC/ppc/instructions/ppcFreqProps.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1121 - (download) (annotate)
Wed Mar 6 19:58:56 2002 UTC (19 years, 6 months ago) by blume
File size: 806 byte(s)
fixed downstream problems caused by those Freq type change in MLRISC
(*
 * Extract frequency information from the PowerPC architecture
 *
 * -- Allen
 *)

functor PPCFreqProps(PPCInstr : PPCINSTR) : FREQUENCY_PROPERTIES =
struct

   structure I = PPCInstr

   fun ppcBranchProb(I.BC _) = 50
     | ppcBranchProb(I.BCLR{labels=[],bo=I.ALWAYS,...}) = 100
     | ppcBranchProb(I.BCLR{labels,bo=I.ALWAYS,...}) = 100 div length labels
     | ppcBranchProb(I.BCLR{labels=[],bo,...}) = 50
     | ppcBranchProb(I.BCLR{labels,bo,...}) = 100 div length labels
     | ppcBranchProb _ = 0 (* non-branch *)

   fun branchProb(I.ANNOTATION{a, i, ...}) =
        (case #peek MLRiscAnnotations.BRANCH_PROB a of
           SOME b => b
         | NONE => branchProb i
        )
     | branchProb(I.INSTR(i)) = Probability.percent (ppcBranchProb i)
     | branchProb _ = Probability.never

end

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