Patent ID: 7877585

Claim:
A method for managing divergent threads in a SIMD (single-instruction multiple-data) architecture when processing control instructions, the method comprising: receiving a first control instruction that includes a target address of another instruction in a program; determining that the first control instruction is a set-synchronization instruction, a prebreak instruction, or a prereturn instruction; pushing a token onto an execution stack, the token including a token type, the target address, and an active mask indicating active threads in a SIMD thread group that should be processed in parallel when the token is popped from the execution stack and execution of the program continues at the target address; updating an active program counter to specify an instruction in the program that is immediately after the first control instruction; receiving a second control instruction in the program; and determining that none of the threads in the SIMD thread group diverge in response to a condition test specified by the second control instruction.