Implement SSE3 single-precision and double-precision packed ADDSUBxx instructions. ADDSUBPS has two 128-bit operands. The instruction performs single-precision addition on the second and fourth pairs of 32-bit data elements within the operands and single-precision subtraction on the first and third pairs. This instruction is effective at evaluating complex products on packed single-precision data.
ADDSUBPD has two 128-bit operands. The instruction performs double-precision addition on the second pair of quadwords and double-precision subtraction on the first pair. This instruction is useful when evaluating complex products on packed double-precision data.
Use the following guideline for packed ADDSUBxx instructions.
Double-precision and single-precision packed ADDSUBxx instructions are designed to support complex arithmetic computations. These instructions can be used with arrays of complex data types declared to be a structure of a real and imaginary numbers. The following example shows two code samples:
(A) Multiplies two pairs of single-precision, complex values
(B) Calculates the division of two pairs of single-precision, complex values
Double-precision complex multiplication and division can be calculated one pair at a time in a similar fashion. When evaluating more sophisticated expressions involving complex values, such as fractions with complex multiplications, evaluate the expression to favor multiplications and reduce the number of divisions.