VSHL : Integer Byte/Short Shift Left

Format

SPA 5.0:
        {@{!}Pg}   VSHL{.dfmt}{.safmt.sbfmt}{.mode}{.SAT}{.op2}   Rd{.CC}, Ra{.partselA}, Rb{.partselB}, Rc   {&req_6}   {?sched}   ;   
        {@{!}Pg}   VSHL{.dfmt}{.safmt.ifmt}{.mode}{.SAT}{.op2}    Rd{.CC}, Ra{.partselA}, #imm16,        Rc   {&req_6}   {?sched}   ;   

 .dfmt:       { .UD, .SD* }
              Destination format (unsigned or signed)

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

 .mode:       { .C*, .W }
              .C (Clamp): Rb/#imm16 is treated as an unsigned integer and is clamped to (0-32).  // Default mode.
              .W (Wrap):  Rb/#imm16 is treated as an unsigned integer and is masked by 0x001f

 .op2:        { .PASS*, .MRG_16H, .MRG_16L, MRG_8B0, .MRG_8B2, .ACC, .MIN, .MAX}

 .CC:         Write condition codes

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

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

Description

Shift Ra Left by contents of Rb (or #imm16) with optional second stage operation and optional saturate.

Basic math operation:

The Ra input is first promoted to S34 (based on the .S or .U input format) followed by a shift left Ra << Rb or #imm16 giving an S34 result. Only the 34 lsbs of the shift left result are retained, discarding any overflows. The lsb insertion is always 0.

Note:

Examples:

VSHL.W          R0, R1, R7,  RZ;
VSHL.UD.U32.U16 R0, R1, 0x9, RZ;

Back to Index of Instructions