ATI CTM Guide v. 1.01
© 2006 Advanced Micro Devices, Inc.
36 Flow Control
Since only conditional (if, else) and loop statements maintain active processor masks, to call a function based on a
condition requires the program to use the branch counters on CALL and RETURN so the processor active mask will
be updated on the conditional call. If you know ahead of time that *all* calls to a particular subroutine will be
unconditional calls, you can omit the branch counter manipulation on that subroutine's return and on any calls to that
subroutine. The benefit of this is unclear, unless you are nearing the upper limit on the branch counter.
Returns within dynamic branches and/or loops (nested in the subroutine) are not supported. A return can be made
conditional (by incremeneting the branch stack counter on stay), but the hardware does not support returning within
other conditional blocks that might partially mask it. If a branch is entirely static (based on a constant boolean), you
may put a return within a branch (just get the branch counter decrement right). This cannot be done inside loops,
however.
3.5.3
Fields
Fields Controlling Conditions on the Jump
JUMP_FUNC - 2x2x2 table indicating when to jump.
• Bit 0 = Jump when (!alu_result && !predicate && !boolean).
• Bit 1 = Jump when (!alu_result && !predicate && boolean).
• Bit 2 = Jump when (!alu_result && predicate && !boolean).
• Bit 3 = Jump when (!alu_result && predicate && boolean).
• Bit 4 = Jump when ( alu_result && !predicate && !boolean).
• Bit 5 = Jump when ( alu_result && !predicate && boolean).
• Bit 6 = Jump when ( alu_result && predicate && !boolean).
• Bit 7 = Jump when ( alu_result && predicate && boolean).
Common JUMP_FUNC values:
• 0x00 = Never jump
• 0x0f = Jump iff alu_result is false.
• 0x33 = Jump iff predicate is false.
• 0x55 = Jump iff boolean is false.
• 0xaa = Jump iff boolean is true.
• 0xcc = Jump iff predicate is true.
• 0xf0 = Jump iff alu_result is true.
• 0xff = Always jump
JUMP_ANY - How to treat partially passing groups of processors.
• false = Don't jump unless all processors want to jump
• true = Jump if at least one active processor wants to jump
When JUMP_ANY is false, the instruction behaves like a universal quantifier, and will decide to jump if there are no
active processors. When JUMP_ANY is true, the instruction behaves like an existential quantifier, and will never
decide to jump if there are no active processors. Looping statements may override the jump decision made by the
processors based on the loop counter.
Fields Controlling Optional Stack Operation
OP - Loop Stack Operations.
• FC_OP_JUMP = None
• FC_OP_LOOP = Initialize counter and aL, and push loop stack if stay
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...