SPRUII0F May 2019 – June 2024 TMS320F28384D , TMS320F28384D-Q1 , TMS320F28384S , TMS320F28384S-Q1 , TMS320F28386D , TMS320F28386D-Q1 , TMS320F28386S , TMS320F28386S-Q1 , TMS320F28388D , TMS320F28388S
Return Conditional Delayed
CNDF | Optional condition |
LSW: 0000 0000 0000 0000
MSW: 0111 1001 1010 cndf
If the specified condition is true, then the RPC field of MSTF is loaded into MPC and fetching continues from that location. Otherwise, program fetches continue without the return.
Refer to the Pipeline section for important information regarding this instruction.
if (CNDF == TRUE) MPC = RPC;
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 |
This instruction does not modify flags in the MSTF register.
Flag | TF | ZF | NF | LUF | LVF |
---|---|---|---|---|---|
Modified | No | No | No | No | No |
The MRCNDD instruction is a single-cycle instruction. As shown in Table 8-19, 6 instruction slots are executed for each return; 3 slots before the return instruction (d5-d7) and 3 slots after the return instruction (d8-d10). The total number of cycles for a return 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 return can, therefore, range from 1 to 7 cycles. The number of cycles for a return taken cannot be the same as for a return not taken.
Referring to the following code fragment and the pipeline diagrams in Table 8-19 and Table 8-20, the instructions before and after MRCNDD 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
<Instruction 10> ; I10
....
....
_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 NEQ ; Return to <Instruction 8> if not equal to zero
; 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
<Destination 12> ; d12
....
....
MSTOP
....
Instruction | F1 | F2 | D1 | D2 | R1 | R2 | E | W |
---|---|---|---|---|---|---|---|---|
d4 | d4 | d3 | d2 | d1 | I7 | I6 | I5 | |
d5 | d5 | d4 | d3 | d2 | d1 | I7 | I6 | |
d6 | d6 | d5 | d4 | d3 | d2 | d1 | i7 | |
d7 | d7 | d6 | d5 | d4 | d3 | d2 | d1 | |
MRCNDD | MRCNDD | d7 | d6 | d5 | d4 | d3 | d2 | |
d8 | d8 | MRCNDD | d7 | d6 | d5 | d4 | d3 | |
d9 | d9 | d8 | MRCNDD | d7 | d6 | d5 | d4 | |
d10 | d10 | d9 | d8 | MRCNDD | d7 | d6 | d5 | |
d11 | d11 | d10 | d9 | d8 | - | d7 | d6 | |
d12 | d12 | d11 | d10 | d9 | d8 | - | d7 | |
etc.... | .... | d12 | d11 | d10 | d9 | d8 | - | |
.... | .... | .... | d12 | d11 | d10 | d9 | d8 | |
.... | .... | .... | .... | d12 | d11 | d10 | d9 | |
d12 | d11 | d10 | ||||||
d12 | d11 | |||||||
d12 |
Instruction | F1 | F2 | D1 | D2 | R1 | R2 | E | W |
---|---|---|---|---|---|---|---|---|
d4 | d4 | d3 | d2 | d1 | I7 | I6 | I5 | |
d5 | d5 | d4 | d3 | d2 | d1 | I7 | I6 | |
d6 | d6 | d5 | d4 | d3 | d2 | d1 | i7 | |
d7 | d7 | d6 | d5 | d4 | d3 | d2 | d1 | |
MRCNDD | MRCNDD | d7 | d6 | d5 | d4 | d3 | d2 | |
d8 | d8 | MRCNDD | d7 | d6 | d5 | d4 | d3 | |
d9 | d9 | d8 | MRCNDD | d7 | d6 | d5 | d4 | |
d10 | d10 | d9 | d8 | MRCNDD | d7 | d6 | d5 | |
I8 | I8 | d10 | d9 | d8 | - | d7 | d6 | |
I9 | I9 | I8 | d10 | d9 | d8 | - | d7 | |
I10 | I10 | I9 | I8 | d10 | d9 | d8 | - | |
etc.... | .... | I10 | I9 | I8 | d10 | d9 | d8 | |
.... | .... | I10 | I9 | I8 | d10 | d9 | ||
.... | .... | I10 | I9 | I8 | d10 | |||
I10 | I9 | I8 | ||||||
I10 | I9 | |||||||
I10 |