SPRUIZ1B July 2023 – August 2024 TMS320F28P650DH , TMS320F28P650DK , TMS320F28P650SH , TMS320F28P650SK , TMS320F28P659DH-Q1 , TMS320F28P659DK-Q1 , TMS320F28P659SH-Q1
Call Conditional Delayed
16BitDest | 16-bit destination if condition is true |
CNDF | Optional condition to be tested |
LSW: dest dest dest dest
MSW: 0111 1001 1001 cndf
If the specified condition is true, then store the return address in the RPC field of MSTF and make the call by adding the signed 16BitDest value to the MPC value. Otherwise, continue code execution without making the call. If the address overflows, the address wraps around. Therefore a value of "0xFFFE" puts the MPC back to the MCCNDD instruction.
Refer to the Pipeline section for important information regarding this instruction.
if (CNDF == TRUE)
{
RPC = return address;
MPC += 16BitDest;
};
CNDF is one of the following conditions:
Encode(1) | CNDF | Description | MSTF Flags Tested |
---|---|---|---|
0000 | NEQ | Not equal to zero | ZF == 0 |
0001 | EQ | Equal to zero | ZF == 1 |
0010 | GT | Greater than zero | ZF == 0 AND NF == 0 |
0011 | GEQ | Greater than or equal to zero | NF == 0 |
0100 | LT | Less than zero | NF == 1 |
0101 | LEQ | Less than or equal to zero | ZF == 1 OR NF == 1 |
1010 | TF | Test flag set | TF == 1 |
1011 | NTF | Test flag not set | TF == 0 |
1100 | LU | Latched underflow | LUF == 1 |
1101 | LV | Latched overflow | LVF == 1 |
1110 | UNC | Unconditional | None |
1111 | UNCF(2) | Unconditional with flag modification | None |
The MCCNDD instruction is not allowed three instructions before or after a MBCNDD, MCCNDD, or MRCNDD instruction. Refer to the Pipeline section for more details.
This instruction does not modify flags in the MSTF register.
Flag | TF | ZF | NF | LUF | LVF |
---|---|---|---|---|---|
Modified | No | No | No | No | No |
The MCCNDD instruction alone is a single-cycle instruction. As shown in Table 7-14, 6 instruction slots are executed for each call; 3 before the call instruction (I2-I4) and 3 after the call instruction (I5-I7). The total number of cycles for a call taken or not taken depends on the usage of these slots. That is, the number of cycles depends on how many slots are filled with a MNOP as well as which slots are filled. The effective number of cycles for a call can, therefore, range from 1 to 7 cycles. The number of cycles for a call taken cannot be the same as for a call not taken.
Referring to the following code fragment and the pipeline diagrams in Table 7-14 and Table 7-15, the instructions before and after MCCNDD have the following properties:
<Instruction 1> ; I1 Last instruction that can affect flags for
; the MCCNDD operation
<Instruction 2> ; I2 Cannot be stop, branch, call or return
<Instruction 3> ; I3 Cannot be stop, branch, call or return
<Instruction 4> ; I4 Cannot be stop, branch, call or return
MCCNDD _func, NEQ ; Call to func if not eqal to zero
; Three instructions after MCCNDD are always
; executed whether the call is taken or not
<Instruction 5> ; I5 Cannot be stop, branch, call or return
<Instruction 6> ; I6 Cannot be stop, branch, call or return
<Instruction 7> ; I7 Cannot be stop, branch, call or return
<Instruction 8> ; I8 The address of this instruction is saved
; in the RPC field of the MSTF register.
; Upon return this value is loaded into MPC
; and fetching continues from this point.
<Instruction 9> ; I9
....
_func:
<Destination 1> ; d1 Can be any instruction
<Destination 2> ; d2
<Destination 3> ; d3
<Destination 4> ; d4 Last instruction that can affect flags for
; the MRCNDD operation
<Destination 5> ; d5 Cannot be stop, branch, call or return
<Destination 6> ; d6 Cannot be stop, branch, call or return
<Destination 7> ; d7 Cannot be stop, branch, call or return
MRCNDD UNC ; Return to <Instruction 8>, unconditional
; Three instructions after MRCNDD are always
; executed whether the return is taken or not
<Destination 8> ; d8 Cannot be stop, branch, call or return
<Destination 9> ; d9 Cannot be stop, branch, call or return
<Destination 10> ; d10 Cannot be stop, branch, call or return
<Destination 11> ; d11
....
MSTOP
Instruction | F1 | F2 | D1 | D2 | R1 | R2 | E | W |
---|---|---|---|---|---|---|---|---|
I1 | I1 | |||||||
I2 | I2 | I1 | ||||||
I3 | I3 | I2 | I1 | |||||
I4 | I4 | I3 | I2 | I1 | ||||
MCCNDD | MCCNDD | I4 | I3 | I2 | I1 | |||
I5 | I5 | MCCNDD | I4 | I3 | I2 | I1 | ||
I6 | I6 | I5 | MCCNDD | I4 | I3 | I2 | I1 | |
I7 | I7 | I6 | I5 | MCCNDD | I4 | I3 | I2 | |
I8 | I8 | I7 | I6 | I5 | - | I4 | I3 | |
I9 | I9 | I8 | I7 | I6 | I5 | - | I4 | |
I10 | I10 | I9 | I8 | I7 | I6 | I5 | - | |
etc .... | I10 | I9 | I8 | I7 | I6 | I5 | ||
.... | I10 | I9 | I8 | I7 | I6 | |||
.... | I10 | I9 | I8 | I7 | ||||
.... | I10 | I9 | I8 | |||||
I10 | I9 | |||||||
I10 |
Instruction | F1 | F2 | D1 | D2 | R1 | R2 | E | W |
---|---|---|---|---|---|---|---|---|
I1 | I1 | |||||||
I2 | I2 | I1 | ||||||
I3 | I3 | I2 | I1 | |||||
I4 | I4 | I3 | I2 | I1 | ||||
MCCNDD | MCCNDD | I4 | I3 | I2 | I1 | |||
I5 | I5 | MCCNDD | I4 | I3 | I2 | I1 | ||
I6 | I6 | I5 | MCCNDD | I4 | I3 | I2 | I1 | |
I7 (1) | I7 | I6 | I5 | MCCNDD | I4 | I3 | I2 | |
d1 | d1 | I7 | I6 | I5 | - | I4 | I3 | |
d2 | d2 | d1 | I7 | I6 | I5 | - | I4 | |
d3 | d3 | d2 | d1 | I7 | I6 | I5 | - | |
etc .... | d3 | d2 | d1 | I7 | I6 | I5 | ||
.... | d3 | d2 | d1 | I7 | I6 | |||
.... | d3 | d2 | d1 | I7 | ||||
.... | d3 | d2 | d1 | |||||
d3 | d2 | |||||||
d3 |