Floating-point Arithmetic Operations for Streaming SIMD Extensions 2

The arithmetic operations for the Streaming SIMD Extensions 2 are listed in the following table and are followed by descriptions of each intrinsic.

Intrinsic Name Corresponding Instruction Operation R0 Value R1 Value

_mm_add_sd

ADDSD

Addition

a0 [op] b0

a1

_mm_add_pd

ADDPD

Addition

a0 [op] b0

a1 [op] b1

_mm_sub_sd

SUBSD

Subtraction

a0 [op] b0

a1

_mm_sub_pd

SUBPD

Subtraction

a0 [op] b0

a1 [op] b1

_mm_mul_sd

MULSD

Multiplication

a0 [op] b0

a1

_mm_mul_pd

MULPD

Multiplication

a0 [op] b0

a1 [op] b1

_mm_div_sd

DIVSD

Division

a0 [op] b0

a1

_mm_div_pd

DIVPD

Division

a0 [op] b0

a1 [op] b1

_mm_sqrt_sd

SQRTSD

Computes Square Root

a0 [op] b0

a1

_mm_sqrt_pd

SQRTPD

Computes Square Root

a0 [op] b0

a1 [op] b1

_mm_min_sd

MINSD

Computes Minimum

a0 [op] b0

a1

_mm_min_pd

MINPD

Computes Minimum

a0 [op] b0

a1 [op] b1

_mm_max_sd

MAXSD

Computes Maximum

a0 [op] b0

a1

_mm_max_pd

MAXPD

Computes Maximum

a0 [op] b0

a1 [op] b1

 

__m128d _mm_add_sd( __m128d a, __m128d b)

Adds the lower DP FP (double-precision, floating-point) values of a and b ; the upper DP FP value is passed through from a.

r0 := a0 + b0

r1 := a1

 

__m128d _mm_add_pd( __m128d a, __m128d b)

Adds the two DP FP values of a and b.

r0 := a0 + b0

r1 := a1 + b1

 

__m128d _mm_sub_sd ( __m128d a, __m128d b)

Subtracts the lower DP FP value of b from a. The upper DP FP value is passed through from a.

r0 := a0 - b0

r1 := a1

 

__m128d _mm_sub_pd ( __m128d a, __m128d b)

Subtracts the two DP FP values of b from a.

r0 := a0 - b0

r1 := a1 - b1

 

__m128d _mm_mul_sd ( __m128d a, __m128d b)

Multiplies the lower DP FP values of a and b. The upper DP FP is passed through from a.

r0 := a0 * b0

r1 := a1

 

__m128d _mm_mul_pd ( __m128d a, __m128d b)

Multiplies the two DP FP values of a and b.

r0 := a0 * b0

r1 := a1 * b1

 

__m128d _mm_div_sd ( __m128d a, __m128d b)

Divides the lower DP FP values of a and b. The upper DP FP value is passed through from a.

r0 := a0 / b0

r1 := a1

 

__m128d _mm_div_pd ( __m128d a, __m128d b)

Divides the two DP FP values of a and b.

r0 := a0 / b0

r1 := a1 / b1

 

__m128d _mm_sqrt_sd ( __m128d a, __m128d b)

Computes the square root of the lower DP FP value of b. The upper DP FP value is passed through from a.

r0 := sqrt(b0)

r1 := a1

 

__m128d _mm_sqrt_pd ( __m128d a)

Computes the square roots of the two DP FP values of a.

r0 := sqrt(a0)

r1 := sqrt(a1)

 

__m128d _mm_min_sd ( __m128d a, __m128d b)

Computes the minimum of the lower DP FP values of a and b. The upper DP FP value is passed through from a.

r0 := min (a0, b0)

r1 := a1

 

__m128d _mm_min_pd ( __m128d a, __m128d b)

Computes the minima of the two DP FP values of a and b.

r0 := min(a0, b0)

r1 := min(a1, b1)

 

__m128d _mm_max_sd ( __m128d a, __m128d b)

Computes the maximum of the lower DP FP values of a and b. The upper DP FP value is passed through from a.

r0 := max (a0, b0)

r1 := a1

 

__m128d _mm_max_pd ( __m128d a, __m128d b)

Computes the maxima of the two DP FP values of a and b.

r0 := max(a0, b0)

r1 := max(a1, b1)