This instruction block has the format
choice case ... case ... ... end choice
It consists of the
choice instruction, at least one
case instruction, and the
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 location label loc_label with probability number or with a probability stored in variable var_name.
Probability number must be in the range 0 to 1 inclusive.
The assembler supports fixed-point and exponential notations for number.
choice instruction block has a location label assigned, then you must not use the location label as the second argument of
case instructions within the block.
choice instruction block effectively sets profile probabilities in the action emission matrix or the state transition matrix.
If a particular
choice instruction block is prepended with an
stt instruction, then the instruction block will set profile probabilities in the action emission matrix.
If a particular
choice instruction block is not prepended with an
stt instruction, then the instruction block will set profile probabilities in the state transition matrix.
See stt Instruction, for more information.
If the assembler considers it should assemble a user instruction at a particular place but encounters a
choice instruction block at that place, then the assembler will assemble the
nop instruction and treat the
choice instruction block as possible transitions to states made after invocation of this
As opposed 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
Probabilities of jumps to various destinations are below:
|Jump destination||Probability value|
|Location label ||prob1|
|Location label ||prob2|
|Location label ||prob3|
|An instruction that follows the ||1-prob1-prob2-prob3|
Compare this example to the corresponding example with a block of
jprob instructions in the previous subsection.