VI_shl | VBI_shl | VSI_shl | VLI_shl | VQI_shl | |
VU_shl | VUB_shl | VUS_shl | VUL_shl | VUQ_shl | VUI_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/Delphi | uses 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) |
|
CUDA function C/C++ | #include <cudaVImath.h>
int cudaVI_shl( iVector d_Y, iVector d_X, ui size, unsigned C );
int cudaVUL_shl( ulVector d_Y, ulVector d_X, ui size, unsigned C );
void VIcu_shl( iVector h_Y, iVector h_X, ui size, unsigned C );
void VULcu_shl( ulVector h_Y, ulVector h_X, ui size, unsigned C );
|
CUDA function Pascal/Delphi | uses VImath;
function cudaVI_shl( d_Y, d_X:iVector; size:UIntSize; C:UInt ): IntBool;
function cudaVUL_shl( d_Y, d_X:ulVector; size:UIntSize; C:UInt ): IntBool;
procedure VIcu_shl( h_Y, h_X:iVector; size:UIntSize; C:UInt );
procedure VULcu_shl( h_Y, h_X:ulVector; size:UIntSize; C:UInt );
|
|
Description | Yi = 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, for 32-bit numbers (VLI_, VUL_) shifted by more than 31 positions, and for 64-bit numbers (VQI_, VUQ_) shifted by more than 63 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. |
|
|
|
|