Instruction Modifiers 29
© 2006 Advanced Micro Devices, Inc.
ATI CTM Guide v. 1.01
OP_ALPHA_RCP
• 1 / A
• Use OP_RGB_SOP to get result into RGB.
OP_ALPHA_RSQ
• 1 / squareRoot(A)
• Use OP_RGB_SOP to get result into RGB.
Note:
The SM3 specification defines reciprocal square root as
1 / squareRoot(abs(A))
—this can be
achieved by using the input modifier for A.
OP_ALPHA_SIN
• sin(A * 2pi)
• Use OP_RGB_SOP to get result into RGB.
OP_ALPHA_COS
• cos(A * 2pi)
• Use OP_RGB_SOP to get result into RGB.
3.3.5
Instruction Modifiers
Each instruction can have an output modifier applied to its result:
• OMOD_U1 - Multiply by 1
• OMOD_U2 - Multiply by 2
• OMOD_U4 - Multiply by 4
• OMOD_U8 - Multiply by 8
• OMOD_D2 - Divide by 2
• OMOD_D4 - Divide by 4
• OMOD_D8 - Divide by 8
• OMOD_DISABLED - No modification
Each instruction can also be optionally clamped to the range 0 to 1. This happens after the above output modifier.
Disabling the Output Modifier
The multiply/divide output modifiers all convert NaN values into a standardized NaN (0x7fffffff) and squash any
denormal values to plus or minus zero. For most ALU operations this is acceptable, however a MOV instruction
needs to preserve the source exactly. For this, you can disable the output modifier for the MIN, MAX, CMP and CND
instructions. With OMOD_DISABLED, the result is not modified at all; the value is neither multipled nor divided,
and clamping is not applied.
This allows a MOV to be implemented using any of the following instructions, with OMOD_DISABLED set:
• MIN(src, src)
• MAX(src, src)
• CND(src, src, 0)
• CMP(src, src, 0)
OMOD_DISABLED is not valid with any other ALU operation.
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...