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 /MLRISC/releases/release-110.60/instructions/freqProps.sml
ViewVC logotype

View of /MLRISC/releases/release-110.60/instructions/freqProps.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1110 - (download) (annotate)
Fri Mar 1 14:07:58 2002 UTC (17 years, 7 months ago) by jhr
Original Path: sml/trunk/src/MLRISC/instructions/freqProps.sml
File size: 510 byte(s)
  Switch to using probabilities (instead of ints) for BRANCH_PROB annotation.
(* freqProps.sml
 *
 * COPYRIGHT (c) 2002 Bell Labs, Lucent Technologies
 *
 * Generic module for extracting the frequency information.
 *)

functor FreqProps (Props : INSN_PROPERTIES) : FREQUENCY_PROPERTIES =
  struct

    structure I = Props.I

    val fifty_fifty = Probability.prob(1, 2)
    val get = #get MLRiscAnnotations.BRANCH_PROB

  (* Branch probability *)
    fun branchProb instr = (case get(#2(Props.getAnnotations instr))
	   of SOME b => b
	    | NONE => fifty_fifty
	  (* end case *))

  end

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