3-11
INSTRUCTION SET REFERENCE
The operation
float a[4] = { 1.0, 2.0, 3.0, 4.0 };
__m128 t = _mm_load_ps(a);
produces the same result as follows:
__m128 t = _mm_set_ps(4.0, 3.0, 2.0, 1.0);
In other words,
t = [ 4.0, 3.0, 2.0, 1.0 ]
where the scalar element is 1.0.
Some intrinsics are composites because they require more than one instruction to implement
them. You should be familiar with the hardware features provided by the Streaming SIMD
Extensions and MMX technology when writing programs with the intrinsics.
Keep the following three important issues in mind:
Certain intrinsics, such as _mm_loadr_ps and _mm_cmpgt_ss, are not directly
supported by the instruction set. While these intrinsics are convenient programming
aids, be mindful of their implementation cost.
Floating-point data loaded or stored as __m128 objects must generally be 16-byte-
aligned.
Some intrinsics require that their argument be immediates, that is, constant integers
(literals), due to the nature of the instruction.
The result of arithmetic operations acting on two NaN (Not a Number) arguments is
undefined. Therefore, FP operations using NaN arguments will not match the expected
behavior of the corresponding assembly instructions.
For a more detailed description of each intrinsic and additional information related to its usage,
refer to the
Intel C/C++ Compiler Users Guide for Win32* Systems With Streaming SIMD Extension
Support (Order Number 718195-00B). Refer to Appendix C, Compiler Intrinsics and Functional Equiva-
lents for more information on using intrinsics.
3.1.4.Flags Affected
The Flags Affected section lists the flags in the EFLAGS register that are affected by the
instruction. When a flag is cleared, it is equal to 0; when it is set, it is equal to 1. The arithmetic
and logical instructions usually assign values to the status flags in a uniform manner. For more
information, refer to Appendix A, EFLAGS Cross-Reference, of the Intel Architecture Software
Developers Manual, Volume 1. Non-conventional assignments are described in the Operation
section. The values of flags listed as undefined may be changed by the instruction in an inde-
terminate manner. Flags that are not listed are unchanged by the instruction.