Developer Guide and Reference

Contents

Arithmetic Intrinsics

The prototypes for Intel® Streaming SIMD Extensions (Intel® SSE) intrinsics for arithmetic operations are in the
xmmintrin.h
header file.
To use these intrinsics, include the
immintrin.h
file as follows:
#include <immintrin.h>
The results of each intrinsic operation are placed in a register. This register is illustrated for each intrinsic with R0-R3. R0, R1, R2, and R3 each represent one of the four 32-bit pieces of the result register.
Intrinsic Name
Operation
Corresponding
Intel® SSE Instruction
_mm_add_ss
Addition
ADDSS
_mm_add_ps
Addition
ADDPS
_mm_sub_ss
Subtraction
SUBSS
_mm_sub_ps
Subtraction
SUBPS
_mm_mul_ss
Multiplication
MULSS
_mm_mul_ps
Multiplication
MULPS
_mm_div_ss
Division
DIVSS
_mm_div_ps
Division
DIVPS
_mm_sqrt_ss
Squared Root
SQRTSS
_mm_sqrt_ps
Squared Root
SQRTPS
_mm_rcp_ss
Reciprocal
RCPSS
_mm_rcp_ps
Reciprocal
RCPPS
_mm_rsqrt_ss
Reciprocal Squared Root
RSQRTSS
_mm_rsqrt_ps
Reciprocal Squared Root
RSQRTPS
_mm_min_ss
Computes Minimum
MINSS
_mm_min_ps
Computes Minimum
MINPS
_mm_max_ss
Computes Maximum
MAXSS
_mm_max_ps
Computes Maximum
MAXPS

_mm_add_ss

__m128 _mm_add_ss(__m128 a, __m128 b);
Adds the lower single-precision, floating-point (FP) values of
a
and
b
; the upper three single-precision FP values are passed through from
a
.
R0
R1
R2
R3
a0 + b0
a1
a2
a3

_mm_add_ps

__m128 _mm_add_ps(__m128 a, __m128 b);
Adds the four single-precision FP values of
a
and
b
.
R0
R1
R2
R3
a0 +b0
a1 + b1
a2 + b2
a3 + b3

_mm_sub_ss

__m128 _mm_sub_ss(__m128 a, __m128 b);
Subtracts the lower single-precision FP values of
a
and
b
. The upper three single-precision FP values are passed through from
a
.