SPA 5.0:
PCNT
#OffsetS24
{&req_6}
{?sched}
;
PCNT
c[#BankU05][#AddrU16]
{&req_6}
{?sched}
;
// This form of PCNT is not patchable and is deprecated
.test: { .F, .LT, .EQ, .LE, .GT, .NE, .GE, .NUM, Signed numeric tests .NAN, .LTU, .EQU, .LEU, .GTU, .NEU, .GEU, .T*, Signed or Unordered tests .OFF, .LO, .SFF, .LS, .HI, .SFT, .HS, .OFT, Unsigned integer tests .CSM_TA, .CSM_TR, .CSM_MX, .FCSM_TA, .FCSM_TR, .FCSM_MX, .RLE, .RGT } Clip State Machine tests If no condition code test is specified, CC.TRUE is assumed.
{@{!}Pg}
CONT
{CC.test}
{&req_6}
{?sched>=?WAIT5}
;
Pre-Continue and Continue support.
This instruction is used to mark the continuation address for a loop that contains CONT (continue) instructions. It specifies the target address where execution should resume after the CONT. Since the CONT instruction pops the PCNT token off the stack, the PCNT must be placed inside the loop.
The target address is relative offset from the PC address of the next instruction following the PCNT instruction. It is specified as a signed byte offset with the two lsbs equal to 0.
The PCNT instruction results in a token being pushed onto the CallReturnStack (CRS) but does not alter the program flow, execution continues normally to the next sequential instruction.
Continue execution from the address specified by preceeding PCNT. The continue condition is based on a predicate AND condition code bits. To just continue on predicate, use CC.TRUE. To just continue on CC, use PT.
CONT should be used to replace the final looping branch in a Continue/Precontinue loop, in addition to being used for early loop continuation branches.
When all active threads have executed a CONT, the stack will be unrolled until a matching PCNT is found. The PCNT stack entry will be popped from the stack, and execution will resume at the address specified by the PCNT, with the active mask updated according to the mask in the PCNT. Thus this is a synchronizing event eliminating the need to bracket loop bodies with SSY/.S instructions if all active threads eventually exit the loop via a CONT. Loops can be continued from within arbitrarily nested if-then-else blocks.
A CONT without a matching PCNT will result in an error.
// pseudo-code example while (TRUE) { R4 *= 2.0f; if (R4 >= 1024.0f) continue; R4 -= 2.0f; } // in assembler could be: LABEL: PCNT LABEL; FMUL32I R4,R4,2.0f; FADD32I RZ.CC,R4,-1024.0f; CONT CC.GE; FADD32I R4,R4,-2.0f; CONT;