_mm_moveldup_ps

Microsoft Specific

Generates the movsldup instruction.

__m128 _mm_moveldup_ps( 
   __m128 source
);

Parameters

  • [in] source
    The source data.

Requirements

Intrinsic

Architecture

_mm_moveldup_ps

Intel SSE3

Header file <intrin.h>

Return Value

The return value represents an XMM register containing the duplicated elements as described in the Remarks section.

Remarks

The _mm_moveldup_ps intrinsic duplicates the first and third 32-bit data elements in the source data and places the first element into the first and second elements, and the third element into the third and fourth elements of the return value. Thus, if source is { A0, A1, A2, A3 }, the return value is { A0, A0, A2, A2 }.

Example

// processor: x86 with SSE3
// Execute the movsldup instruction using the intrinsic
// _mm_moveldup_ps 

#include <stdio.h>
#include <intrin.h>

#pragma intrinsic ( _mm_moveldup_ps )

int main( )
{
    __m128 u, v;
    __declspec(align(16)) float f[4] = { 0.1, 0.2, 0.3, 0.4 };

    printf_s("Source data: %f %f %f %f\n", f[0], f[1], f[2], f[3]);

    // Load the array a into an XMM register
    u = _mm_load_ps( f );
  
    printf_s("Calling _mm_moveldup_ps to load the values.\n");
    v = _mm_moveldup_ps ( u );

    printf_s("Result: %f %f %f %f\n", v.m128_f32[0], v.m128_f32[1],
             v.m128_f32[2], v.m128_f32[3] );
}

Source data: 0.100000 0.200000 0.300000 0.400000
Calling _mm_moveldup_ps to load the values.
Result: 0.100000 0.100000 0.300000 0.300000

See Also

Concepts

Compiler Intrinsics