Debian Codegraph @

lib/mlrisc-lib/MLRISC/instructions/freqProps.sml

raw
1 (* freqProps.sml
2 *
3 * COPYRIGHT (c) 2002 Bell Labs, Lucent Technologies
4 *
5 * Generic module for extracting the frequency information.
6 *)
7
8 functor FreqProps (Props : INSN_PROPERTIES) : FREQUENCY_PROPERTIES =
9 struct
10
11 structure I = Props.I
12
13 val fifty_fifty = Probability.prob(1, 2)
14 val get = #get MLRiscAnnotations.BRANCH_PROB
15
16 (* Branch probability *)
17 fun branchProb instr = (case get(#2(Props.getAnnotations instr))
18 of SOME b => b
19 | NONE => fifty_fifty
20 (* end case *))
21
22 end