Intel® C++ Compiler Classic Developer Guide and Reference

ID 767249
Date 7/13/2023
Public
Document Table of Contents

Miscellaneous Intrinsics

The following tables list and describe intrinsics that you can use across all Intel® architectures, except where noted. These intrinsics are available for both Intel® and non-Intel microprocessors but they may perform additional optimizations for Intel® microprocessors than they perform for non-Intel microprocessors.

NOTE:

Casting functions for various INT and FP types for use in intrinsic functions across Intel® architectures only change the type; they do not convert between integer and floating point values.

Intrinsic

Description

Intrinsics for all Supported Intel® Architectures

__cpuid

Queries the processor for information about processor type and supported features. The Intel® C++ Compiler Classic supports the Microsoft* implementation of this intrinsic. See the Microsoft documentation for details.

void *_alloca(int)

Allocates memory in the local stack frame. The memory is automatically freed upon return from the function.

int _bit_scan_forward(int x)

Returns the bit index of the least significant set bit of x. If x is 0, the result is undefined.

int _bit_scan_reverse(int)

Returns the bit index of the most significant set bit of x. If xis 0, the result is undefined.

unsigned char _BitScanForward(unsigned __int32 *p, unsigned __int32 b);

and for Intel® 64 architecture only:

unsigned char _BitScanForward64(unsigned __int32 *p, unsigned __int64 b);

Sets *p to the bit index of the least significant set bit of b or leaves it unchanged if b is zero. The function returns a non-zero result when b is non-zero and returns zero when b is zero.

Intrinsics for IA-32 and Intel® 64 Architectures