DSP Core Reference Manual

Static Programming Rules
SC140 DSP Core Reference Manual 7-9
Rule G.G.4
Instructions grouped in a VLES cannot write to the same register or affect the same status bit.
For mutually exclusive IFc subgroups in a VLES, this rule applies independently to each subgroup unless
explicitly stated.
The less obvious cases are:
Multiple COF instructions that implicitly write the PC register cannot be grouped in a VLES. This
case applies to the whole VLES, independent of the T bit state.
Example 7-5 Duplicate PC Destinations
jmp _lbl3 bsr _lbl6 ;not allowed
bt _label1 bf _label2 ;not allowed
btd _label1 bfd _label2 ;not allowed
jt r1 jf r2 ;not allowed
jtd r1 jfd r2 ;not allowed
ift bra _label1 iff bra _label2 ;not allowed
ift brad _label1 iff brad _label2 ;not allowed
ift jmp r1 iff jmp r2 ;not allowed
ift jmpd r1 iff jmpd r2 ;not allowed
ift jmp r0 iff rts ;not allowed
ift bra _label1 iff rts ;not allowed
ift bra _label1 iff break ;not allowed
ift jmp r1 ifa jf r2 ;not allowed
ift bra _label1 iff brad _label2 ;not allowed
ift jmpd r1 iff jmp r2 ;not allowed
Multiple writes of the same address pointer register Rn cannot be grouped in a VLES. The no update
addressing mode (Rn) is not considered an address register write.
Example 7-6 Duplicate Address Pointer Register Destinations
move.w (r0)+,d0 move.w d1,(r0)+ ;not allowed
move.w (r0)+,r0 ;not allowed
move.l d0,r0 move.l (r0)+,d1 ;not allowed
move.l d0,r8 move.l d1,b0 ;not allowed - B register alias
pop r0 move.l (r0)+,d0 ;not allowed
move.w (r0+$6),r0 ;allowed - no update mode
move.w (r0+n0),r0 ;allowed - no update mode
move.w (r0),r0 ;allowed - no update mode
move.w (r0),d0 move.w (r0)+,d1 ;allowed - no update mode
Multiple writes of the ESP or NSP stack pointer registers (implicitly using SP and OSP) cannot be
grouped in a VLES. This rule applies independent of the EXP status bit.
Example 7-7 Duplicate Stack Pointer Destinations
pop d2 rts ;not allowed
pushn d0 tfra r1,osp ;not allowed
pop d1 tfra r0,sp ;not allowed
tfra r0,sp tfra r1,osp ;allowed - writes different regs.
Multiple instructions that write different portions of the same register cannot be grouped in a VLES.