共用方式為


_mm_cvtepu8_epi32

Microsoft Specific

Emits the Streaming SIMD Extensions 4 (SSE4) instruction pmovzxbd. This instruction performs a conversion of unsigned integers from 8-bit to 32-bit.

__m128i _mm_cvtepu8_epi32( 
   __m128i a
);

Parameters

  • [in] a
    A 128-bit parameter that contains four unsigned 8-bit integers in the lower 32 bits.

Return value

A 128-bit parameter that contains four 32-bit integers. These integers are zero-extended representations of the 8-bit integers that are supplied by a.

The result can be defined with the following equations:

r0 := a0
r1 := 0
r2 := 0
r3 := 0

r4 := a1
r5 := 0
r6 := 0
r7 := 0

r8 := a2
r9 := 0
r10 := 0
r11 := 0

r12 := a3
r13 := 0
r14 := 0
r15 := 0

Requirements

Intrinsic

Architecture

_mm_cvtepu8_epi32

x86, x64

Header file <smmintrin.h>

Remarks

r0-r15 and a0-a15 are the sequentially ordered 8-bit components of return value r and parameter a, respectively. r0 and a0 are the least significant 8 bits.

Before you use this intrinsic, software must ensure that the processor supports the instruction.

Example

#include <stdio.h>
#include <smmintrin.h>

int main ()
{
    __m128i a;

    a.m128i_u8[0] = 0;
    a.m128i_u8[1] = 255;
    a.m128i_u8[2] = 1;
    a.m128i_u8[3] = 15;

    __m128i res = _mm_cvtepu8_epi32(a);

    printf_s("Original lowest 8 bit integers:\n%u,\t%u\n%u,\t%u\n\n",
        a.m128i_u8[3], a.m128i_u8[2], a.m128i_u8[1], a.m128i_u8[0]);

    printf_s("Resulting 32 bit integers:\n%i,\t%i\n%i,\t%i\n",
        res.m128i_i32[3], res.m128i_i32[2], res.m128i_i32[1], res.m128i_i32[0]);

    return 0;
}
Original lowest 8 bit integers:
15,     1
255,    0

Resulting 32 bit integers:
15,     1
255,    0

See Also

Reference

Compiler Intrinsics