CSETP : Test Condition Code and Set Predicate

Format:

SPA 5.0:
        {@{!}Pg}   CSETP.test       Pu,     CC          {&req_6}   {?sched>=?WAIT1}   ;   
        {@{!}Pg}   CSETP.test.bop   Pu, Pv, CC, {!}Pp   {&req_6}   {?sched>=?WAIT1}   ;   

  .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

  .bop:   { .AND, .OR, .XOR } 

Description:

CSETP.test.bop tests Condition Code register CC with CC.test, combines the Boolean result with predicate operand {!}Pp using Boolean operation .bop, and sets two predicate registers Pu and Pv to Boolean values based on the test. The Boolean operation .bop may be .AND, .OR, or .XOR, corresponding to C Boolean operations &, |, and ^.

    Pu =  CC.test  .bop {!}Pp;     
    Pv =(!CC.test) .bop {!}Pp; 

The simple instruction format without .bop {!}Pp assembles as .AND PT, and Pv is PT, resulting in the effective operation:

    Pu =  CC.test;

Examples:

CSETP.LT      P1,     CC;            // P1 = CC.LT;
CSETP.LT.AND  PT, P2, CC,  PT;       // P2 = !CC.LT;
CSETP.NEU.AND P1, P4, CC, !P3;       // P1 = CC.NEU & !P3;  P4 = !CC.NEU & !P3;  

Back to Index of Instructions