Platform SDK: Files and I/O

Int64ShrlMod32

The Int64ShrlMod32 function performs a right logical shift operation on an unsigned 64-bit integer value. The function provides improved shifting code for right logical shifts where the shift count is in the range 0 – 31.

ULONGLONG Int64ShrlMod32(
  ULONGLONG Value,  // unsigned 64-bit integer
  DWORD ShiftCount  // shift count
);

Parameters

Value
[in] Specifies the unsigned 64-bit integer to be shifted.
ShiftCount
[in] Specifies a shift count in the range 0 – 31.

Return Values

The return value is the unsigned 64-bit integer result of the right logical shift operation.

Remarks

The shift count is the number of bit positions that the value's bits move.

In a right logical shift operation on an unsigned value, the value's bits move to the right, and vacated bits on the left side of the value are set to zero.

A compiler can generate optimal code for a right logical shift operation when the shift count is a constant. However, if the shift count is a variable whose range of values is unknown, the compiler must assume the worst case, leading to non-optimal code: code that calls a subroutine, or code that is inline but branches. By restricting the shift count to the range 0 – 31, the Int64ShrlMod32 function lets the compiler generate optimal or near-optimal code.

Note  The Int64ShrlMod32 function's Value parameter and return value are 64-bit values, not LARGE_INTEGER structures.

Requirements

  Windows NT/2000: Requires Windows NT 3.1 or later.
  Windows 95/98: Requires Windows 95 or later.
  Header: Declared in Winnt.h; include Windows.h.

See Also

File I/O Overview, File I/O Functions, Int64ShllMod32, Int64ShraMod32