This instruction block has the format
choice case ... case ... ... end choice
It consists of a
choice instruction, at least one
case instruction, and an
end choice instruction.
end choice must not have location labels assigned.
case instruction must have one of the following forms:
case number, loc_label case var_name, loc_label
case instructions specify control transfer to a location label loc_label with probability number or with profile probability stored in a variable var_name.
The parameter number must be in the range 0 to 1 inclusive.
The assembler supports fixed-point and exponential notations for number.
choice instruction has a location label assigned, then you must not use this location label as the second argument of
case instructions in the
choice instruction block.
choice instruction block effectively sets profile probabilities in the action emission matrix or state transition matrix.
stt instruction precedes a particular
choice instruction block, this instruction block sets profile probabilities in the action emission matrix.
stt instruction does not precede a particular
choice instruction block, this instruction block sets profile probabilities in the state transition matrix.
See stt Instruction, for more information.
If the assembler expects a user instruction at a particular location but encounters a
choice instruction block at this location, the assembler implicitly inserts a
nop instruction before the
choice instruction block and treats it as possible transitions to states made after the invocation of this
In contrast to a contiguous block of
jprob instructions, a
choice instruction block allows you to specify jump probabilities in a direct way.
Let us consider a
choice instruction block like this:
choice case prob1, L1 case prob2, L2 case prob3, L3 end choice
The probabilities of jumps to various destinations are the following:
|Jump destination||Probability value|
|The location label ||prob1|
|The location label ||prob2|
|The location label ||prob3|
|An instruction following the ||1-prob1-prob2-prob3|
Compare this example to the example with a block of
jprob instructions in jprob Instruction.