ATI CTM Guide v. 1.01
© 2006 Advanced Micro Devices, Inc.
26 ALU Instructions
Each source is specified with three fields. Valid encodings of these fields are shown below (for source 0, in this
example):
Note that inline constants set the MSB of ADDR0 and clear ADDR0_CONST.
3.3.2
Presubtract
Each RGB and Alpha instruction has a presubtract operation, which does some extra math on incoming data from the
first or from the first and second sources. The available operations are:
• SRCP_OP_BIAS - 1-2*src0
• SRCP_OP_SUB - src1-src0
• SRCP_OP_ADD - src1+src0
• SRCP_OP_INV - 1-src0
The RGB presubtract happens on all three components in parallel. The Alpha presubtract is scalar.
If any presubtract result is used in the instruction, and one of the sources being used in a presubtract is written in the
previous instruction, and the previous instruction is an ALU or output instruction, a NOP needs to be inserted between
the two instructions. Do this by setting the NOP flag in the previous instruction, so the NOP does not consume an
instruction slot. This allows the HW the extra cycle necessary to resolve the dependencies involved in doing this extra
math (there are additional cases where NOP may need to be set, noted below).
Note:
In these cases, the assembler could hide it.
NOP is never required if the previous instruction is a texture lookup.
3.3.3
Inputs
Each math operation has zero to three inputs. Each input can be configured to select a source and swizzle its channels.
There are fields to configure 6 inputs per instruction: 3 for RGB and 3 for Alpha. An instruction can read in at most
12 independent colour components (9 RGB components and 3 alpha components).
ADDR0[7]
ADDR0[6:0]
ADDR0_CONST
ADDR0_REL
register N
0
N
0
0
register N + aL
0
N
0
1
constant N
N / 128
N % 128
1
0
constant N + aL
N / 128
N % 128
1
1
inline const X
1
X
0
0
Summary of Contents for ATI CTM
Page 1: ...ATI CTM Guide Technical Reference Manual Version 1 01...
Page 6: ...ATI CTM Guide v 1 01 2006 Advanced Micro Devices Inc 2 Related Documents...
Page 48: ...ATI CTM Guide v 1 01 2006 Advanced Micro Devices Inc 44 Errata...
Page 54: ...ATI CTM Guide v 1 01 2006 Advanced Micro Devices Inc 50 Executable Files...