Developer Guide and Reference

Contents

Integer Arithmetic Intrinsics

The following table lists and describes integer arithmetic intrinsics that you can use across Intel® architectures.
Intrinsic Syntax
Description
Intrinsics for all Supported Intel® Architectures
int abs(int)
Returns the absolute value of an integer.
long labs(long)
Returns the absolute value of a long integer.
unsigned long _lrotl(unsigned long
value
, int
shift
)
Implements 64-bit left rotate of
value
by
shift
positions.
unsigned long _lrotr(unsigned long
value
, int
shift
)
Implements 64-bit right rotate of
value
by
shift
positions.
unsigned int _rotl(unsigned int
value
, int
shift
)
Implements 32-bit left rotate of
value
by
shift
positions.
unsigned int _rotr(unsigned int
value
, int
shift
)
Implements 32-bit right rotate of
value
by
shift
positions.
Intrinsics for IA-32 and Intel® 64 Architectures
unsigned short _rotwl(unsigned short
value
, int
shift
)
Implements 16-bit left rotate of
value
by
shift
positions.
unsigned short _rotwr(unsigned short
value
, int
shift
)
Implements 16-bit right rotate of
value
by
shift
positions.
Passing a constant
shift
value in the rotate intrinsics results in higher performance.

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804