This documentation is archived and is not being maintained.


Microsoft Specific

Shifts a 64-bit value specified by the first parameter to the left by a number of bits specified by the second parameter.

unsigned __int64 __ll_lshift(
   unsigned __int64 Mask,
   int nBit


[in] Mask

The 64-bit integer value to shift left.

[in] nBit

The number of bits to shift, modulo 64.

The mask shifted left by nBit bits.

Intrinsic Architecture


x86, x64

Header file <intrin.h>

If the second parameter is greater than 64, that number is taken modulo 64 to determine the number of bits to shift. The ll in the name indicates that this is an operation on long long (__int64).

// ll_lshift.cpp
// compile with: /EHsc
// processor: x86, x64
#include <iostream>
#include <intrin.h>
using namespace std;

#pragma intrinsic(__ll_lshift)

int main()
   unsigned __int64 Mask = 0x100;
   int nBit = 8;
   Mask = __ll_lshift(Mask, nBit);
   cout << hex << Mask << endl;


Note   There is no unsigned version of the left shift operation. Unlike the right shift, there is no sign dependence for the left shift, because the least significant bit in the result is always set to zero regardless of the sign of the value shifted.

END Microsoft Specific