Next: , Previous: , Up: Assembler Instructions   [Contents][Index]


5.3.2 jprob Instruction

This instruction has the following forms:

        jprob   number, loc_label
        jprob   var_name, loc_label

It specifies 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.

The jprob instruction effectively sets a profile probability in the action emission matrix or at least one profile probability in the state transition matrix. If an stt instruction precedes a contiguous block of jprob instructions, these jprob instructions set profile probabilities in the action emission matrix. If an stt instruction does not precede a contiguous block of jprob instructions, these jprob instructions set 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 contiguous block of jprob instructions at this location, the assembler implicitly inserts a nop instruction before the contiguous block and treats it as possible transitions to states made after the invocation of this nop instruction.

Let us consider a block of jprob instructions like this:

        jprob   prob1, L1
        jprob   prob2, L2
        jprob   prob3, L3

The probabilities of jumps to various destinations are the following:

Jump destinationProbability value
The location label L1prob1
The second jprob instruction1-prob1
The location label L2(1-prob1)*prob2
The third jprob instruction(1-prob1)*(1-prob2)
The location label L3(1-prob1)*(1-prob2)*prob3
An instruction following the third jprob instruction(1-prob1)*(1-prob2)*(1-prob3)