clang 17.0.0git
Macros | Functions
ia32intrin.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define __DEFAULT_FN_ATTRS   __attribute__((__always_inline__, __nodebug__))
 
#define __DEFAULT_FN_ATTRS_CRC32   __attribute__((__always_inline__, __nodebug__, __target__("crc32")))
 
#define __DEFAULT_FN_ATTRS_CAST   __attribute__((__always_inline__))
 
#define __DEFAULT_FN_ATTRS_CONSTEXPR   __DEFAULT_FN_ATTRS
 
#define _bit_scan_forward(A)   __bsfd((A))
 
#define _bit_scan_reverse(A)   __bsrd((A))
 
#define _popcnt32(A)   __popcntd((A))
 
#define _rdtsc()   __rdtsc()
 
#define _rdpmc(A)   __rdpmc(A)
 
#define _lrotl(a, b)   __rold((a), (b))
 
#define _lrotr(a, b)   __rord((a), (b))
 
#define _rotl(a, b)   __rold((a), (b))
 
#define _rotr(a, b)   __rord((a), (b))
 
#define _rotwl(a, b)   __rolw((a), (b))
 
#define _rotwr(a, b)   __rorw((a), (b))
 

Functions

static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR __bsfd (int __A)
 Find the first set bit starting from the lsb.
 
static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR __bsrd (int __A)
 Find the first set bit starting from the msb.
 
static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR __bswapd (int __A)
 Swaps the bytes in the input.
 
static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR _bswap (int __A)
 
static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR __popcntd (unsigned int __A)
 Counts the number of bits in the source operand having a value of 1.
 
static __inline__ unsigned int __DEFAULT_FN_ATTRS __readeflags (void)
 
static __inline__ void __DEFAULT_FN_ATTRS __writeeflags (unsigned int __f)
 
static __inline__ unsigned int __DEFAULT_FN_ATTRS_CAST _castf32_u32 (float __A)
 Cast a 32-bit float value to a 32-bit unsigned integer value.
 
static __inline__ unsigned long long __DEFAULT_FN_ATTRS_CAST _castf64_u64 (double __A)
 Cast a 64-bit float value to a 64-bit unsigned integer value.
 
static __inline__ float __DEFAULT_FN_ATTRS_CAST _castu32_f32 (unsigned int __A)
 Cast a 32-bit unsigned integer value to a 32-bit float value.
 
static __inline__ double __DEFAULT_FN_ATTRS_CAST _castu64_f64 (unsigned long long __A)
 Cast a 64-bit unsigned integer value to a 64-bit float value.
 
static __inline__ unsigned int __DEFAULT_FN_ATTRS_CRC32 __crc32b (unsigned int __C, unsigned char __D)
 Adds the unsigned integer operand to the CRC-32C checksum of the unsigned char operand.
 
static __inline__ unsigned int __DEFAULT_FN_ATTRS_CRC32 __crc32w (unsigned int __C, unsigned short __D)
 Adds the unsigned integer operand to the CRC-32C checksum of the unsigned short operand.
 
static __inline__ unsigned int __DEFAULT_FN_ATTRS_CRC32 __crc32d (unsigned int __C, unsigned int __D)
 Adds the unsigned integer operand to the CRC-32C checksum of the second unsigned integer operand.
 
static __inline__ unsigned long long __DEFAULT_FN_ATTRS __rdpmc (int __A)
 
static __inline__ unsigned long long __DEFAULT_FN_ATTRS __rdtscp (unsigned int *__A)
 
static __inline__ void __DEFAULT_FN_ATTRS _wbinvd (void)
 
static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR __rolb (unsigned char __X, int __C)
 
static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR __rorb (unsigned char __X, int __C)
 
static __inline__ unsigned short __DEFAULT_FN_ATTRS_CONSTEXPR __rolw (unsigned short __X, int __C)
 
static __inline__ unsigned short __DEFAULT_FN_ATTRS_CONSTEXPR __rorw (unsigned short __X, int __C)
 
static __inline__ unsigned int __DEFAULT_FN_ATTRS_CONSTEXPR __rold (unsigned int __X, int __C)
 
static __inline__ unsigned int __DEFAULT_FN_ATTRS_CONSTEXPR __rord (unsigned int __X, int __C)
 

Macro Definition Documentation

◆ __DEFAULT_FN_ATTRS

#define __DEFAULT_FN_ATTRS   __attribute__((__always_inline__, __nodebug__))

Definition at line 18 of file ia32intrin.h.

◆ __DEFAULT_FN_ATTRS_CAST

#define __DEFAULT_FN_ATTRS_CAST   __attribute__((__always_inline__))

Definition at line 25 of file ia32intrin.h.

◆ __DEFAULT_FN_ATTRS_CONSTEXPR

#define __DEFAULT_FN_ATTRS_CONSTEXPR   __DEFAULT_FN_ATTRS

Definition at line 26 of file ia32intrin.h.

◆ __DEFAULT_FN_ATTRS_CRC32

#define __DEFAULT_FN_ATTRS_CRC32   __attribute__((__always_inline__, __nodebug__, __target__("crc32")))

Definition at line 19 of file ia32intrin.h.

◆ _bit_scan_forward

#define _bit_scan_forward (   A)    __bsfd((A))

Definition at line 84 of file ia32intrin.h.

◆ _bit_scan_reverse

#define _bit_scan_reverse (   A)    __bsrd((A))

Definition at line 85 of file ia32intrin.h.

◆ _lrotl

#define _lrotl (   a,
  b 
)    __rold((a), (b))

Definition at line 425 of file ia32intrin.h.

◆ _lrotr

#define _lrotr (   a,
  b 
)    __rord((a), (b))

Definition at line 426 of file ia32intrin.h.

◆ _popcnt32

#define _popcnt32 (   A)    __popcntd((A))

Definition at line 159 of file ia32intrin.h.

◆ _rdpmc

#define _rdpmc (   A)    __rdpmc(A)

Definition at line 369 of file ia32intrin.h.

◆ _rdtsc

#define _rdtsc ( )    __rdtsc()

Definition at line 367 of file ia32intrin.h.

◆ _rotl

#define _rotl (   a,
  b 
)    __rold((a), (b))

Definition at line 428 of file ia32intrin.h.

◆ _rotr

#define _rotr (   a,
  b 
)    __rord((a), (b))

Definition at line 429 of file ia32intrin.h.

◆ _rotwl

#define _rotwl (   a,
  b 
)    __rolw((a), (b))

Definition at line 433 of file ia32intrin.h.

◆ _rotwr

#define _rotwr (   a,
  b 
)    __rorw((a), (b))

Definition at line 434 of file ia32intrin.h.

Function Documentation

◆ __bsfd()

static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR __bsfd ( int  __A)
static

Find the first set bit starting from the lsb.

Result is undefined if input is 0.

This intrinsic corresponds to the BSF instruction or the TZCNT instruction.

Parameters
__AA 32-bit integer operand.
Returns
A 32-bit integer containing the bit number.

Definition at line 42 of file ia32intrin.h.

◆ __bsrd()

static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR __bsrd ( int  __A)
static

Find the first set bit starting from the msb.

Result is undefined if input is 0.

This intrinsic corresponds to the BSR instruction or the LZCNT instruction and an XOR .

Parameters
__AA 32-bit integer operand.
Returns
A 32-bit integer containing the bit number.

Definition at line 59 of file ia32intrin.h.

◆ __bswapd()

static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR __bswapd ( int  __A)
static

Swaps the bytes in the input.

Converting little endian to big endian or vice versa.

This intrinsic corresponds to the BSWAP instruction.

Parameters
__AA 32-bit integer operand.
Returns
A 32-bit integer containing the swapped bytes.

Definition at line 75 of file ia32intrin.h.

◆ __crc32b()

static __inline__ unsigned int __DEFAULT_FN_ATTRS_CRC32 __crc32b ( unsigned int  __C,
unsigned char  __D 
)
static

Adds the unsigned integer operand to the CRC-32C checksum of the unsigned char operand.

This intrinsic corresponds to the CRC32B instruction.

Parameters
__CAn unsigned integer operand to add to the CRC-32C checksum of operand __D.
__DAn unsigned 8-bit integer operand used to compute the CRC-32C checksum.
Returns
The result of adding operand __C to the CRC-32C checksum of operand __D.

Definition at line 286 of file ia32intrin.h.

References __D.

◆ __crc32d()

static __inline__ unsigned int __DEFAULT_FN_ATTRS_CRC32 __crc32d ( unsigned int  __C,
unsigned int  __D 
)
static

Adds the unsigned integer operand to the CRC-32C checksum of the second unsigned integer operand.

This intrinsic corresponds to the CRC32D instruction.

Parameters
__CAn unsigned integer operand to add to the CRC-32C checksum of operand __D.
__DAn unsigned 32-bit integer operand used to compute the CRC-32C checksum.
Returns
The result of adding operand __C to the CRC-32C checksum of operand __D.

Definition at line 328 of file ia32intrin.h.

References __D.

◆ __crc32w()

static __inline__ unsigned int __DEFAULT_FN_ATTRS_CRC32 __crc32w ( unsigned int  __C,
unsigned short  __D 
)
static

Adds the unsigned integer operand to the CRC-32C checksum of the unsigned short operand.

This intrinsic corresponds to the CRC32W instruction.

Parameters
__CAn unsigned integer operand to add to the CRC-32C checksum of operand __D.
__DAn unsigned 16-bit integer operand used to compute the CRC-32C checksum.
Returns
The result of adding operand __C to the CRC-32C checksum of operand __D.

Definition at line 307 of file ia32intrin.h.

References __D.

◆ __popcntd()

static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR __popcntd ( unsigned int  __A)
static

Counts the number of bits in the source operand having a value of 1.

This intrinsic corresponds to the POPCNT instruction or a a sequence of arithmetic and logic ops to calculate it.

Parameters
__AAn unsigned 32-bit integer operand.
Returns
A 32-bit integer containing the number of bits with value 1 in the source operand.

Definition at line 154 of file ia32intrin.h.

◆ __rdpmc()

static __inline__ unsigned long long __DEFAULT_FN_ATTRS __rdpmc ( int  __A)
static

Definition at line 357 of file ia32intrin.h.

◆ __rdtscp()

static __inline__ unsigned long long __DEFAULT_FN_ATTRS __rdtscp ( unsigned int __A)
static

Definition at line 363 of file ia32intrin.h.

◆ __readeflags()

static __inline__ unsigned int __DEFAULT_FN_ATTRS __readeflags ( void  )
static

Definition at line 198 of file ia32intrin.h.

◆ __rolb()

static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR __rolb ( unsigned char  __X,
int  __C 
)
static

Definition at line 377 of file ia32intrin.h.

◆ __rold()

static __inline__ unsigned int __DEFAULT_FN_ATTRS_CONSTEXPR __rold ( unsigned int  __X,
int  __C 
)
static

Definition at line 397 of file ia32intrin.h.

◆ __rolw()

static __inline__ unsigned short __DEFAULT_FN_ATTRS_CONSTEXPR __rolw ( unsigned short  __X,
int  __C 
)
static

Definition at line 387 of file ia32intrin.h.

◆ __rorb()

static __inline__ unsigned char __DEFAULT_FN_ATTRS_CONSTEXPR __rorb ( unsigned char  __X,
int  __C 
)
static

Definition at line 382 of file ia32intrin.h.

◆ __rord()

static __inline__ unsigned int __DEFAULT_FN_ATTRS_CONSTEXPR __rord ( unsigned int  __X,
int  __C 
)
static

Definition at line 402 of file ia32intrin.h.

◆ __rorw()

static __inline__ unsigned short __DEFAULT_FN_ATTRS_CONSTEXPR __rorw ( unsigned short  __X,
int  __C 
)
static

Definition at line 392 of file ia32intrin.h.

◆ __writeeflags()

static __inline__ void __DEFAULT_FN_ATTRS __writeeflags ( unsigned int  __f)
static

Definition at line 204 of file ia32intrin.h.

◆ _bswap()

static __inline__ int __DEFAULT_FN_ATTRS_CONSTEXPR _bswap ( int  __A)
static

Definition at line 80 of file ia32intrin.h.

◆ _castf32_u32()

static __inline__ unsigned int __DEFAULT_FN_ATTRS_CAST _castf32_u32 ( float  __A)
static

Cast a 32-bit float value to a 32-bit unsigned integer value.

This intrinsic corresponds to the VMOVD / MOVD instruction in x86_64, and corresponds to the VMOVL / MOVL instruction in ia32.

Parameters
__AA 32-bit float value.
Returns
a 32-bit unsigned integer containing the converted value.

Definition at line 221 of file ia32intrin.h.

◆ _castf64_u64()

static __inline__ unsigned long long __DEFAULT_FN_ATTRS_CAST _castf64_u64 ( double  __A)
static

Cast a 64-bit float value to a 64-bit unsigned integer value.

This intrinsic corresponds to the VMOVQ / MOVQ instruction in x86_64, and corresponds to the VMOVL / MOVL instruction in ia32.

Parameters
__AA 64-bit float value.
Returns
a 64-bit unsigned integer containing the converted value.

Definition at line 236 of file ia32intrin.h.

◆ _castu32_f32()

static __inline__ float __DEFAULT_FN_ATTRS_CAST _castu32_f32 ( unsigned int  __A)
static

Cast a 32-bit unsigned integer value to a 32-bit float value.

This intrinsic corresponds to the VMOVQ / MOVQ instruction in x86_64, and corresponds to the FLDS instruction in ia32.

Parameters
__AA 32-bit unsigned integer value.
Returns
a 32-bit float value containing the converted value.

Definition at line 251 of file ia32intrin.h.

◆ _castu64_f64()

static __inline__ double __DEFAULT_FN_ATTRS_CAST _castu64_f64 ( unsigned long long  __A)
static

Cast a 64-bit unsigned integer value to a 64-bit float value.

This intrinsic corresponds to the VMOVQ / MOVQ instruction in x86_64, and corresponds to the FLDL instruction in ia32.

Parameters
__AA 64-bit unsigned integer value.
Returns
a 64-bit float value containing the converted value.

Definition at line 266 of file ia32intrin.h.

◆ _wbinvd()

static __inline__ void __DEFAULT_FN_ATTRS _wbinvd ( void  )
static

Definition at line 372 of file ia32intrin.h.