Floating-point Set Operations for Streaming SIMD Extensions 2

The following set operation intrinsics and their respective instructions are functional in the Streaming SIMD Extensions 2 (SSE2).

The load and set operations are similar in that both initialize __m128d data. However, the set operations take a double argument and are intended for initialization with constants, while the load operations take a double pointer argument and are intended to mimic the instructions for loading data from memory.

For detailed information about an intrinsic, click on that intrinsic name in the following table.

The results of each intrinsic operation are placed in registers. The information about what is placed in each register appears in the tables below, in the detailed explanation of each intrinsic. R0 and R1 represent the registers in which results are placed.

The prototypes for SSE2 intrinsics are in the emmintrin.h header file.

Intrinsic
Name
Operation Corresponding SSE2
Instruction
_mm_set_sd Sets lower DP FP value to w and upper to zero Composite
_mm_set1_pd Sets two DP FP valus to w Composite
_mm_set_pd Sets lower DP FP to x and upper to w Composite
_mm_setr_pd Sets lower DP FP to w and upper to x Composite
_mm_setzero_pd Sets two DP FP values to zero XORPD
_mm_move_sd Sets  lower DP FP value to the lower DP FP value of b MOVSD

 

__m128d _mm_set_sd(double w)

Sets the lower DP FP value to w and sets the upper DP FP value to zero.

R0 R1
w 0.0

 

__m128d _mm_set1_pd(double w)

Sets the 2 DP FP values to w.

R0 R1
w w

 

__m128d _mm_set_pd(double w, double x)

Sets the lower DP FP value to x and sets the upper DP FP value to w.

R0 R1
x w

 

__m128d _mm_setr_pd(double w, double x)

Sets the lower DP FP value to w and sets the upper DP FP value to x.
r0 := w
r1 := x

R0 R1
w x

 

__m128d _mm_setzero_pd(void)

Sets the 2 DP FP values to zero.

R0 R1
0.0 0.0

 

__m128d _mm_move_sd( __m128d a, __m128d b)

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

R0 R1
b0 a1