Intel® C++ Compiler Classic Developer Guide and Reference

ID 767249
Date 12/16/2022
Public

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

Document Table of Contents

Naming and Usage Syntax

Most intrinsic names use the following notational convention:

_mm_<intrin_op>_<suffix>

The following table explains each item in the syntax.

<intrin_op>

Indicates the basic operation of the intrinsic; for example, add for addition and sub for subtraction.

<suffix>

Denotes the type of data the instruction operates on. The first one or two letters of each suffix denote whether the data is packed (p), extended packed (ep), or scalar (s). The remaining letters and numbers denote the type, with notation as follows:

  • s single-precision floating point

  • d double-precision floating point

  • i128 signed 128-bit integer

  • i64 signed 64-bit integer

  • u64 unsigned 64-bit integer

  • i32 signed 32-bit integer

  • u32 unsigned 32-bit integer

  • i16 signed 16-bit integer

  • u16 unsigned 16-bit integer

  • i8 signed 8-bit integer

  • u8 unsigned 8-bit integer

A number appended to a variable name indicates the element of a packed object. For example, r0 is the lowest word of r. Some intrinsics are "composites" because they require more than one instruction to implement them.

The packed values are represented in right-to-left order, with the lowest value being used for scalar operations. Consider the following example operation:

double a[2] = {1.0, 2.0};
__m128d t = _mm_load_pd(a);

The result is the same as either of the following:

__m128d t = _mm_set_pd(2.0, 1.0);
__m128d t = _mm_setr_pd(1.0, 2.0);

In other words, the xmm register that holds the value t appears as follows:

The "scalar" element is 1.0. Due to the nature of the instruction, some intrinsics require their arguments to be immediates (constant integer literals).