
6-6
SC140 DSP Core Reference Manual
Instruction Set Overview
6.2.5 Assembly Reordering Restrictions
The SC140 can execute up to six instructions concurrently: up to four DALU instructions and up to two
AGU instructions. These instructions are grouped together in an execution set and dispatched in parallel to
the execution units by the PDU. Since the execution units of each type are identical (in principle), any
ALU can receive any DALU instruction. As well, either AGU can receive any AGU instruction. The
hardware takes advantage of this fact to reduce internal routing from the PDU to execution units. As a
result of this reduction, some restrictions are necessary concerning instruction positions within an
execution set.
In general, restrictions are transparent to application developers. The assembler is aware of these
restrictions and appropriately reorders the instruction encoding in an execution set. However, the
assembler’s behavior may become apparent upon disassembly of the object code when the order of
instructions in the set may be different from the source code. In some rare cases, the assembler may need to
add a NOP instruction in order to conform with the restrictions.
An execution set can include up to eight instruction words, occupying positions 0 through 7 within the set.
The position of a multi-word instruction is defined as the position of its first word. Example 6-3 shows the
positions occupied by three one-word (1w) instructions and two two-word (2w) instructions grouped with
a one-word prefix:
Example 6-3. Execution Set with Three One-word and Two Two-word Instructions
Position 0
1
2w - - ext
2
3
1w
4
2w - - ext
5
6
1w
7
1w
1w prefix
The assembly reordering restrictions are as follows:
Instruction words of an execution set must be placed contiguously. No gaps are permitted.
Up to two AGU instructions may appear in an execution set. One must occupy an even position. The
other must occupy an odd position. If there is only one AGU instruction, it can be placed anywhere.
Up to four DALU instructions may appear in an execution set. These DALU instructions must
occupy different positions in modulo 4 arithmetic. For example, two DALU instructions in the same
set must not be placed in positions 4 and 0, positions 1 and 5, and so on.
An execution set with a prefix can contain up to two two-word instructions. One two-word
instruction must occupy an even position and the other an odd position. Thus, the two two-word
instructions of an execution set must be separated by an odd number of instruction words.
Some execution sets contain two subgroups using IFT/IFF/IFA instructions (for example:
IFT ADD D0,D1,D2 RND D2,D3 IFF SUB D0,D1,D2 ADDA R0,R1
). In this case, instructions
of one subgroup must occupy even positions while the other subgroup occupies odd positions. The
assembly syntax completely hides this interleaving from the programmer.
In cases where more than one instruction in the execution set can update the C-bit (by definition),
the last instruction (as written in the assembly code) executes the update while the other instructions
do not affect the C-bit. This definition requires that the assembler keeps the last carry-updating
instruction as the last (highest position) carry-updating instruction after the reordering process.