VSETP : Integer Byte/Short Compare And Set Predicate

Format

SPA 5.0:
        {@{!}Pg}   VSETP.cmp{.safmt.sbfmt}       Pu,     Ra{.partselA}, Rb{.partselB}          {&req_6}   {?sched}   ;   
        {@{!}Pg}   VSETP.cmp{.safmt.sbfmt}.bop   Pu, Pv, Ra{.partselA}, Rb{.partselB}, {!}Pp   {&req_6}   {?sched}   ;   
        {@{!}Pg}   VSETP.cmp{.safmt.ifmt}        Pu,     Ra{.partselA}, #imm16                 {&req_6}   {?sched}   ;   
        {@{!}Pg}   VSETP.cmp{.safmt.ifmt}.bop    Pu, Pv, Ra{.partselA}, #imm16,        {!}Pp   {&req_6}   {?sched}   ;   


 .cmp:        { .F, .LT, .EQ, .LE, .GT, .NE, .GE, .T }   Unsigned and signed comparisons

 .safmt:      { .U32, .S32*, .U16, .S16, .U8, .S8} 
 .sbfmt:      { .U32, .S32*, .U16, .S16, .U8, .S8} 
 .ifmt:       {              .U16, .S16*         }
              Source formats

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

 .partselA:   if (.U8|.S8)   { .B0*, .B1, .B2, .B3} 
              if (.U16|.S16) { .H0*, .H1}

 .partselB:   if (.U8|.S8)   { .B0*, .B1, .B2, .B3} 
              if (.U16|.S16) { .H0*, .H1}

Description

VSETP.cmp.bop compares register Ra.partselA and source operand Rb.partselB or #imm16 with comparison operation .cmp, combines the Boolean comparison result with predicate operand {!}Pp using Boolean operation .bop, and sets two predicate registers Pu and Pv to Boolean values based on the comparison. The Boolean operation .bop may be .AND, .OR, or .XOR, corresponding to C Boolean operations &, |, and ^.

    Pu =  (Ra .cmp Sb) .bop {!}Pp;     
    Pv = !(Ra .cmp Sb) .bop {!}Pp; 

Use .bop {!}Pp for nested predication, with an inner comparison of Ra vs. Sb, conditioned on outer predicate Pp.

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

    Pu =  (Ra .cmp Rb);         // Set predicate to 1 if comparison is true, else to 0
 or Pu =  (Ra .cmp #imm16);     // Set predicate to 1 if comparison is true, else to 0

The result of a comparison test .cmp is a Boolean true/false value.

Basic math operation:

The boolean result of the comparison is then operated by boolean operator .bop along with the predicate Pp.

Sign and saturation:

There is no output sign rule (output is boolean); no saturation.

Second stage operation:

There is no second stage operation (unlike the other V* instructions that do byte/short extraction.

Examples:

VSETP.GT.U32.U16    P1,     R1, 255;
VSETP.NE.U32.S32.OR P1, P4, R1, R2, !P3;

Back to Index of Instructions