VI_shlVBI_shlVSI_shlVLI_shlVQI_shl
VU_shlVUB_shlVUS_shlVUL_shlVUI_shl
Function"Shift to the left", i.e. multiply by integer powers of 2.
Syntax C/C++#include <VImath.h>
void VI_shl( iVector Y, iVector X, ui size, unsigned C );
void VUL_shl( ulVector Y, ulVector X, ui size, unsigned C );

    (similarly all other functions of this family)
C++ VecObj#include <OptiVec.h>
void vector<T>::shl( const vector<T>& X, unsigned C );
Pascal/Delphiuses VImath;
procedure VI_shl( Y, X:iVector; size:UIntSize; C:UInt );
procedure VUL_shl( Y, X:ulVector; size:UIntSize; C:UInt );

    (similarly all other functions of this family)
DescriptionYi = Xi << C
All bits of Xi are shifted to the left by as many positions as indicated in the parameter C. This corresponds to a multiplication by 2C, neglecting possible overflow (in all versions) and loss of the sign bit (for signed numbers, i.e. in the VI_,   VBI_,   VSI_,   VLI_, and VQI_ versions).
Note that by shifting 8-bit numbers (VBI_,   VUB_ versions) by more than 7 positions, any non-zero bit present in the original number is lost and the result is 0. The same is true for 16-bit numbers (VSI_,   VUS_ versions) shifted by more than 15 positions, and for 32-bit numbers (VLI_, VUL_) shifted by more than 31 positions.
C is always of the data type unsigned. Shifting by negative numbers C is, therefore, not possible. To perform a right-shift, the appropriate function of the VI_shr family has to be used.
Error handlingnone
Return valuenone
See alsoVI_mulC,   VI_shr

VectorLib Table of Contents  OptiVec home