Extensions
Forms
2 (2 Legacy)
Data
Intel XED v2026.08.23

XORPS computes the bitwise exclusive OR of two 128-bit values. Despite its name it does not treat them as singles: it neither reads nor writes MXCSR and raises no floating-point exception. Compiled code uses it for two things.

Zeroing a register

XORPS of a register with itself gives zero, whatever the register held, and processors know it. Intel’s optimization guide lists it among the zero idioms, which do not wait for the old value and, in the Sandy Bridge microarchitecture, need no execution unit (Section 3.5.1.7); AMD’s guide for Zen 5 lists VXORPS of a register with itself as a zeroing idiom that takes no cycles (Section 2.9.2).

Clang 23 at -O2 zeroes float and double scalars this way, and _mm_setzero_si128 too, but the accumulators of a vectorized integer sum with PXOR, which GCC 14 uses for all of them. The vendors’ guides advise matching the instruction to the data: Intel’s, for its Core microarchitecture, XORPS for floating-point data and PXOR for integers, because mixing the two on one register can cost time (Section 3.5.1.10); AMD’s, one data type for all the operations on a value (Section 2.11.2).

With AVX, vxorps xmm0, xmm0, xmm0 clears the whole YMM or ZMM register, since a VEX instruction zeroes the bits above its result, and both compilers zero 256- and 512-bit vectors that way. The EVEX form of VXORPS needs AVX512DQ; VPXORD is the AVX512F one.

Flipping signs

An XOR with a constant whose only set bits are the sign bits negates each element, and that is how GCC 14 and Clang 23 compile -x for a float: XORPS with a 16-byte constant of 80000000H (GCC uses XORPD for a double, Clang XORPS again). Unlike a subtraction from zero, it turns +0 into -0, changes the sign of a NaN and raises no exception. ANDPS with 7FFFFFFFH clears the sign bits for fabsf, and copysignf takes two ANDPS and an ORPS. The constant is a memory operand of the legacy form, so it must be aligned to 16 bytes, as the compilers’ constant pools are.

In the optimization guide

What the optimization guide says about XORPS, a line per claim. Each links to the claim in the guide, with its sources and where they differ.

Out of order

  • Zeroing and dependency-breaking idioms: The vector registers have idioms of their own: pxor, xorps, xorpd, pandn, andnps, the integer subtractions psub and the comparisons pcmpgt of a register with itself, with their VEX and EVEX forms, which Intel counts for 512-bit registers only unmasked. sources differ

Silvermont to Goldmont Plus

Skylake to Cooper Lake

  • Integer execution: xor, sub and the vector pxor, xorps, pandn, psub and pcmpgt of a register with itself zero it without an execution unit, four a cycle, for 32-bit and 64-bit and all vector registers.

Forms

Every encoding of XORPS that Intel XED knows, one row per XED instruction form (iform). How to read the notation.
InstructionEncodingRequires
XORPS xmm, m128 XORPS_XMMxud_MEMxudNP 0F 57 /rSSE
XORPS xmm, xmm XORPS_XMMxud_XMMxudNP 0F 57 /rSSE

Data flow

Where the elements of the sources go, element 0 on the right; results that depend on a control value are drawn for an example. How to read.

Element-wise: each doubleword of the result comes from the doubleword in the same place in each source.
XORPS: element by elementResult doubleword i comes from doubleword i of xmm1 and xmm2. Result doublewords 3 to 0: a3^b3, a2^b2, a1^b1, a0^b0.0123xmm1aa0^b0a1^b1a2^b2a3^b3xmm10123xmm2or m128b

Result doubleword i comes from doubleword i of xmm1 and xmm2. Result doublewords 3 to 0: a3^b3, a2^b2, a1^b1, a0^b0.

Operation

What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.

for i in range(4):
    xmm1.d[i] = xmm1.d[i] ^ src2.d[i]
# bits 128 and up of the register are unchanged

Run on AMD Zen 5 (EPYC 9645): 2 cases.

Operands

What each form reads and writes, as Intel XED records it: the operands of its syntax, in order, and the implicit ones that the syntax does not name. How to read.
OperandKindAction
XORPS xmm, xmm/m128
xmmexplicitread, write
xmm/m128explicitread

Flags

None: XED records no flag that the forms test or change.

Exceptions

The exception class is XED's name for the set of exception conditions that a form follows. How to read.

All forms
SSE_TYPE_4

Attributes

What else XED records about the forms. How to read.

Memory forms
aligned memory operand

Intrinsics

The C intrinsics of Clang 23.1.2 that compile to XORPS, each with the form it compiles to and the Clang options it needs. The forms come from compiling every intrinsic and decoding the result with Intel XED; all intrinsics A–Z explains the method.

IntrinsicCompiles to
_mm_setzero_pd __m128d _mm_setzero_pd(void)

XORPS xmm, xmm Legacy -msse2

_mm_setzero_ps __m128 _mm_setzero_ps(void)

XORPS xmm, xmm Legacy -msse

_mm_setzero_si128 __m128i _mm_setzero_si128(void)

XORPS xmm, xmm Legacy -msse2

CPUID and processors

Each form belongs to an XED ISA set. A form can be used when the processor reports every CPUID bit of one of its ISA set's alternatives.

CPUID requirements and processors of the XED ISA sets above. Alternatives are separated by “or”; processors follow XED’s chip model, whose AMD processors end with Zen 2, and the CPU data of this site for Zen 3 to Zen 6.
ISA setCPUIDProcessors
SSE

SSE
CPUID.01H:EDX[25] SSE

Every x86-64 processor in XED’s model and Zen 3 to Zen 6

More SSE instructions

All 65 SSE instructions

Sources

  1. Intel XED v2026.08.23 (commit 0bcb6237345c): forms, encodings, operands, flags, exception classes, attributes, ISA sets, CPUID bits and chip model.
  2. The CPU data of x86-64.net: Zen 3 to Zen 6, from GCC’s -march feature sets and AMD’s Processor Programming References, which the page of each processor cites.
  3. Clang's x86 intrinsic headers, LLVM 23.1.2 (commit 85ac56026243): the intrinsics, their signatures and doc comments, and the Clang of that release, which compiled each of them.
  4. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026): Volume 2D, page 6-45 (XORPS)
  5. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 1 (253665-093, September 2026)
  6. Intel 64 and IA-32 Architectures Optimization Reference Manual, Volume 1 (248966-051, October 2026)
  7. Software Optimization Guide for the AMD Zen5 Microarchitecture (58455, rev. 1.00, August 2024), Wayback Machine copy of AMD's ZIP

The tables are derived from Intel XED, Copyright Intel Corporation, licensed under the Apache License 2.0; x86-64.net converted and reformatted them. The intrinsics and their signatures come from Clang, part of the LLVM Project, licensed under the Apache License 2.0 with LLVM Exceptions. The text is our own.