Intel® C++ Compiler Classic Developer Guide and Reference

ID 767249
Date 3/31/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Visible to Intel only — GUID: GUID-FDE58736-5605-42E8-B890-64CF0DFAC8E6

Document Table of 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.

Intrinsics for IA-32 and Intel® 64 Architectures

NOTE:

Passing a constant shift value in the rotate intrinsics results in higher performance.