PSET : Combine Predicates and Set

Format:

SPA 5.0:
        {@{!}Pg}   PSET{.bval}.bop0        Rd{.CC}, {!}Pp, {!}Pq          {&req_6}   {?sched}   ;   
        {@{!}Pg}   PSET{.bval}.bop0.bop1   Rd{.CC}, {!}Pp, {!}Pq, {!}Pr   {&req_6}   {?sched}   ;   

 .bval:  { .BM*, .BF }
         Specifies value used for logical TRUE result
         .BM   Boolean mask (0xffff_ffff)
         .BF   Boolean float (0x3f80_0000)

 .bop0:      { .AND, .OR, .XOR } 
 .bop1:      { .AND, .OR, .XOR } 
    
 .CC:      Write condition codes

Description:

PSET sets register Rd to Boolean value ~0x0 (all 1s) or 0x3F80_0000 (FP32 1.0f) if the Boolean combination of source predicate operands {!}Pp, {!}Pq, and {!}Pr is true, otherwise it sets Rd to 0.

    bool = ( {!}Pp .bop0 {!}Pq ) .bop1 {!}Pr;       // Boolean combination of Pp, Pq, Pr

    if (.BM) Rd =  (bool)? 0xFFFF_FFFF: 0;          // Set Boolean mask all 1s or all 0s
    if (.BF) Rd =  (bool)? 0x3F80_0000: 0;          // Set Boolean float FP32 1.0f or 0.0f

The simple instruction format without .bop1 {!}Pr assembles as .AND PT.

Examples:

PSET.BF.AND.OR R0, P4, P3, !P1;       // (P4 & P3) | !P1 

Back to Index of Instructions