Replacing Jumps With Conditional Execution; Instructions - Motorola DSP56600 Manual

Application optimization for digital signal processors
Table of Contents

Advertisement

Compact Opcode Use
Cycle Count of an Instruction
7-2
Optimizing DSP56300/DSP56600 Applications
move
move
do
...
move
rep
mac
move
move
move
...
_loop
The cycle count of this loop is increased by the number of cycles it
takes to decode the REP instruction, which is 5. The code may be
optimized by replacing the REP with in-line assembly and
restructuring some instructions to have parallel moves, saving 8N
cycles:
move
move
do
...
move
DUP
mac
ENDM
mac
mac
...
_loop
7.1.2

Replacing Jumps with Conditional Execution

Instructions

The various JUMP and BRANCH instructions are a multi-cycle
instructions that needs several cycles to decode before actually
branching to the target. When a code needs to branch to certain
locations based upon various conditions, the Conditional Execution
Instructions can be used, thus reducing the number of cycles
required by the JUMP instructions. In the following example, the
IFcc instruction is used in parallel of arithmetic opcodes to replace a
conditional branch, saving 3 to 8 cycles.
r4,n4
r0,n0
#N,_loop
x:(r0)+,x0
#10
x0
y0
a
x
(r0)
x0
,
,
:
+,
n0,r0
n4,r4
x(r1)+,x1
#-9,n0
#-9,n4
#N,_loop
x:(r0)+,x0
8
x0,y0,a
x:(r0)+,x0
x0
,
y0
,
a
x
:(
r0
)+
n0
,
x0,y0,a
x(r1)+,x1
y:(r4)+,y0
y
r4
y0
:(
)+,
y:(r4)+,y0
y:(r4)+,y0
x0
y
:(
r4
)+
n4
,
MOTOROLA
y0

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dsp56300

Table of Contents