Intel® C++ Compiler Classic Developer Guide and Reference

ID 767249
Date 3/31/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Compare Intrinsics (MMX™ technology)

This topic summarizes the MMX™ technology compare intrinsics.

To use these intrinsics, include the immintrin.h file as follows:

#include <immintrin.h>

Intrinsic
Name

Operation

Corresponding
MMX™ Instruction

_mm_cmpeq_pi8

Equal

PCMPEQB

_mm_cmpeq_pi16

Equal

PCMPEQW

_mm_cmpeq_pi32

Equal

PCMPEQD

_mm_cmpgt_pi8

Greater Than

PCMPGTB

_mm_cmpgt_pi16

Greater Than

PCMPGTW

_mm_cmpgt_pi32

Greater Than

PCMPGTD

_mm_ cmpeq_pi8

__m64 _mm_ cmpeq_pi8(__m64 m1, __m64 m2);

Sets the corresponding 8-bit resulting values to all ones if the 8-bit values in m1 are equal to the corresponding 8-bit values in m2; otherwise sets them to all zeros.

_mm_ cmpeq_pi16

__m64 _mm_ cmpeq_pi16(__m64 m1, __m64 m2);

Sets the corresponding 16-bit resulting values to all ones if the 16-bit values in m1 are equal to the corresponding 16-bit values in m2; otherwise set them to all zeros.

_mm_ cmpeq_pi32

__m64 _mm_ cmpeq_pi32(__m64 m1, __m64 m2);

Sets the corresponding 32-bit resulting values to all ones if the 32-bit values in m1 are equal to the corresponding 32-bit values in m2; otherwise set them to all zeros.

_mm_ cmpgt_pi8

__m64 _mm_ cmpgt_pi8(__m64 m1, __m64 m2);

Sets the corresponding 8-bit resulting values to all ones if the 8-bit signed values in m1 are greater than the corresponding 8-bit signed values in m2; otherwise set them to all zeros.

_mm_ cmpgt_pi16

__m64 _mm_ cmpgt_pi16(__m64 m1, __m64 m2);

Sets the corresponding 16-bit resulting values to all ones if the 16-bit signed values in m1 are greater than the corresponding 16-bit signed values in m2; otherwise set them to all zeros.

_mm_ cmpgt_pi32

__m64 _mm_ cmpgt_pi32(__m64 m1, __m64 m2);

Sets the corresponding 32-bit resulting values to all ones, if the 32-bit signed values in m1 are greater than the corresponding 32-bit signed values in m2; otherwise set them all to zeros.