
Static Programming Rules
SC140 DSP Core Reference Manual 7-11
Example 7-12 Mutually Exclusive Register Destination Exception
ift add #1,d0 iff add #2,d0 ;allowed
movet r0,r1 movef r2,r1 ;allowed
tfrt d0,d1 tfrf d5,d1 ;allowed
ift add #1,d0 ifa tfrf d1,d0 ;allowed
ift adda #1,r0 iff adda #2,r0 ;allowed
ift move.w (r0)+,d0 iff move.w (r0)-,d0 ;allowed
[ift move.w (r0)+,d0
iff {move_special (r0)-,d0)} ] ;allowed
ift tfra r1,r0 iff tfra r2,r0 ;allowed
ift push d0 iff push d1 ;allowed
ift movet r1,r0 movef r2,r0 ;allowed
• Instructions that affect different status bits can be grouped in a VLES. These include the C, T, S,
VF0-3, DI, LF0-3, and SLF status bits in SR, and the DOVF bit in EMR. The G.G.4 rule treats
instructions that affect these status bits as writing 1-bit destinations.
Example 7-13 Mutually Exclusive Status Bit Destination Exception
cmpeq d0,d1 add d0,d1,d2 ;allowed - T and C bit updates
di moves.f d0,(r0)+ ;allowed - DI and S updates
doen0 #5 max2vit d4,d2 ;allowed - LF and VF updates
• Multiple instructions that affect the C or S status bits in SR or the DOVF status bit in EMR can be
grouped in a VLES. S and DOVF are “sticky” status bits are set by the logical OR of all executed
instructions in a VLES that affect them. C is updated by only one instruction in a VLES - the last (in
the assembly source order) carry-affecting instruction that actually executes in the VLES. This case
applies to the whole VLES.
Example 7-14 Multiple C, S and DOVF Status Bit Destination Exception
add d0,d1,d2 asrr #4,d0 ;allowed -last instruction (asrr)
;affects the C status bit in SR
[ [moves.4f d0:d1:d2:d3,(r0)+
moves.2f d4:d5,(r1)+ ] ;allowed - d0-d5
;data affects S bit
Rule G.G.5
A data register Dn can be used as a source operand up to four times in a VLES. This includes all implicit
sources, such as the accumulator source of a MAC instruction.
Example 7-15. DALU Register Use Exceeds Four Times
mac d2,d2,d2 add d2,d2,d3 ;not allowed - d2 used 5 times as a source
7.5.3 Prefix Grouping Rules
The following rules only apply to prefix-grouped VLES.
Komentarze do niniejszej Instrukcji