10 loop cof rules, Loop cof rules -36, Cof destination to loop delay slots -36 – Freescale Semiconductor StarCore SC140 User Manual

Page 286: Cof instructions at la-2 of a long loop -36, Bc/jc at sa-1 of a short loop -36

Advertising
background image

7-36

SC140 DSP Core Reference Manual

Static Programming Rules

7.5.10 Loop COF Rules

Rule L.C.1

A COF instruction cannot have a COF destination that is LA-1 or LA of a long loop, or LA of a 2-VLES
short loop. This rule does not apply to loop COF instructions (BREAK, CONT, CONTD and SKIPLS) in a
nested loop having a COF destination that is LA-1 or LA of an enveloping loop.

Example 7-65. COF Destination to Loop Delay Slots

doensh1 #5
...
cmpeq.w #3,d0
jf _dest

;not allowed

inc d0
loopstart1
inc d0

_dest

add d1,d2,d3
loopend1

Rule L.C.2

COF instructions, WAIT and STOP are not allowed at LA-2 of a long loop.

Example 7-66. COF Instructions at LA-2 of a Long Loop

dosetup1 label1
doen1 #n2
move.l #mem_l1,r1
move.l #mem_l2,r0
loopstart1

label1 inc d1

jsr r1

;LA-2, not allowed

add d1,d2,d3

;LA-1

move.w d3,(r0)

;LA

loopend1
bra label2

Rule L.C.3

A Bc or Jc instruction is not allowed at SA-1 of a short loop.

Example 7-67. Bc/Jc at SA-1 of a Short Loop

cmpgt d4,d3
nop
iff doensh3 #count2
bt _dest

;SA-1, not allowed

loopstart3
inc d2
loopend3
...

_dest

inc d2

Advertising