PCMPEQB

/ VPCMPEQB

Compare bytes for equality

Compare corresponding bytes and produce an all-ones byte for each equal pair.

SSE28-bit unsigned elements

Instruction forms

3 in this sample
FormBitsRequiresEncoding
PCMPEQB xmm1, xmm2128SSE266 0F 74 /r
VPCMPEQB xmm1, xmm2, xmm3128AVXVEX.L0.66.0F.WIG 74 /r
VPCMPEQB ymm1, ymm2, ymm3256AVX2VEX.L1.66.0F.WIG 74 /r
128 bits · 16 × 8-bit elements

Explore the operation

The interactive explorer is loading. The operation and reference details are available below.

Operation

Pseudo-C · selected form
dst[i] = a[i] == b[i] ? 255 : 0

Simplified pseudocode for the selected form.

Exact upstream semantics

Standard variant

let elements := register_size / element_size;
var result := Zero(register_size);
for i := 0 to elements-1 do
let op1 := src1[i *: element_size];
let op2 := src2[i *: element_size];
let r := if op1 == op2 then All_Ones(element_size) else Zero(element_size);
result[i *: element_size] := r;
endfor;

Parameterized by register and element size; from the pinned upstream definition.

What to watch for

  • Each result is 0xff or 0x00, rather than the integer 1 or 0.

Corresponding intrinsics

C / C++ · selected form
_mm_cmpeq_epi8
__m128i _mm_cmpeq_epi8(__m128i a, __m128i b)
#include <emmintrin.h>SSE2

Documented instruction mapping; a compiler may use an equivalent encoding or optimize the operation away.

Documented mapping

PCMPEQB xmm, xmm

Architectural details

Flags
Arithmetic flags unchanged.
Destination
Writes the low 128 bits; upper vector-register bits are preserved.
Encoding
66 0F 74 /r
Operands
  • xmm1read / write
  • xmm2read
Coverage
Selected register-only 128/256-bit forms. Memory operands, MMX, and EVEX/AVX-512 forms are outside this sample.
Exception information & execution requirements
  • #NM
  • #UD

Feature availability alone does not guarantee execution: OS state and execution-level controls also apply. Use the linked architecture documentation for the full exception conditions.

Performance measurements are not included in this preview. Latency and throughput depend on the exact form and microarchitecture. Measured data on uops.info ↗

Sources & provenance

Technical fields are imported from pinned upstream files. Explanations and explorer behavior are maintained separately.

Intel · PCMPEQB-PCMPEQW-PCMPEQD-Compare-Packed-Data-for-Equal.xml
Revision
4ebe7f0ac1bd00f46244c49bb72c503ce368def7
SHA-256
59d53ee27d2e755500261f64d760c8b748299d2e55b0298e78e1777197f83b64
Terms
Intel SDM terms; see License.md
View pinned upstream file ↗
Intel · intrinsics.xml
Revision
4ebe7f0ac1bd00f46244c49bb72c503ce368def7
SHA-256
6762a50652a35ef663fd532ed83b789d19bbc2ac7e94b1771f19d666d96c2c30
Terms
Intel SDM terms; see License.md
View pinned upstream file ↗

Intel sources are a documentation preview. Arm ACLE mappings are adapted under CC BY-SA 4.0 with an additional patent license. Arm MRS encoding data is distributed under BSD-3-Clause. © Arm Limited and contributors. Coverage and attribution.