Extensions
Forms
5 (2 Legacy, 3 EVEX)
Data
Intel XED v2026.08.23

MOVBE is a load or a store that reverses the byte order on the way, for data kept big-endian: network headers, many file formats, hash outputs such as SHA-256’s. It replaces a plain move followed or preceded by BSWAP, and the store form leaves its source register untouched, which a BSWAP in place would not. One operand must be memory: there is no register-to-register form outside APX, and BSWAP covers that case. Flags are unchanged.

Compilers find it

Nobody needs an intrinsic. With -mmovbe or an -march that has it (x86-64-v3, haswell, znver1 and later), GCC 14 and Clang 23 at -O2 turn __builtin_bswap32 of a value loaded with memcpy into a single movbe eax, dword ptr [rdi], and a 64-bit byte-swapped store into movbe qword ptr [rdi], rsi. They even recognize the portable expression p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3] and emit the same single MOVBE. Without the flag they load and BSWAP, or for 16 bits load and rol ax, 8. A swap of a value already in a register stays a BSWAP.

Register widths

As for other 16-bit writes, MOVBE to a 16-bit register keeps bits 63:16, and to a 32-bit one clears bits 63:32: on Zen 5, movbe cx, word ptr [...] replaced only CX, and movbe ecx, dword ptr [...] left 0 in the upper half of RCX. This is the 16-bit byte swap that BSWAP lacks, whose 16-bit form is undefined. Zen 5 ran every size of both forms with distinct byte patterns, and each came out reversed.

Encoding

MOVBE is 0F 38 F0 (load) and 0F 38 F1 (store); the same bytes with an F2 prefix are CRC32. APX’s EVEX forms add the register-to-register move. The CPUID bit is leaf 1, ECX bit 22. Intel’s Atom had MOVBE before Intel’s big cores, which gained it with Haswell; AMD’s processors have it from Zen on, and Excavator before. AMD’s Zen 5 guide lists MOVBE as a single macro-op.

In the optimization guide

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

Silvermont to Goldmont Plus

Tremont

  • Integer execution: LLVM’s tuning prefers movbe to a load and bswap, or to bswap and a store, on this core.

Forms

Every encoding of MOVBE that Intel XED knows, one row per XED instruction form (iform). How to read the notation.
InstructionEncodingRequires
MOVBE r16/32/64, m16/32/64 MOVBE_GPRv_MEMv0F 38 F0 /rMOVBE
MOVBE m16/32/64, r16/32/64 MOVBE_MEMv_GPRv0F 38 F1 /rMOVBE
MOVBE r16/32/64, r16/32/64 MOVBE_GPRv_GPRv_APXEVEX.LLZ.NP.MAP4.SCALABLE 60 /r
EVEX.LLZ.NP.MAP4.SCALABLE 61 /r
APX_F + MOVBE
MOVBE r16/32/64, m16/32/64 MOVBE_GPRv_MEMv_APXEVEX.LLZ.NP.MAP4.SCALABLE 60 /rAPX_F + MOVBE
MOVBE m16/32/64, r16/32/64 MOVBE_MEMv_GPRv_APXEVEX.LLZ.NP.MAP4.SCALABLE 61 /rAPX_F + MOVBE

Latency and throughput

What the scheduling models of LLVM 23.1.2 give for each form, not measurements: latency / reciprocal throughput in cycles, the ports under them. A row is a model, or models that agree; a dash, a form that its processors lack. Memory forms: latency from the address, ports without the load and store units. Which processors each model covers.
Modelr16, m16r32, m32r64, m64m16, r16m32, r32m64, r64
Haswell6 / 0.5p156 / 0.5p156 / 0.5p152 / 1p062 / 1p152 / 1p15
Broadwell, Skylake, Skylake-SP6 / 0.5p156 / 0.5p156 / 0.5p152 / 1p152 / 1p152 / 1p15
Ice Lake6 / 0.5p156 / 0.5p156 / 0.5p152 / 0.5p152 / 0.5p152 / 0.5p15
Alder Lake, Sapphire Rapids7 / 0.5p0 p1 p5 p6 p116 / 1p17 / 1p01612 / 0.5p0612 / 1p112 / 1p016
Lunar Lake100 / 1.33p135100 / 1.33p135100 / 1.33p13512 / 0.5p02412 / 0.5p13512 / 0.5p012345
Bonnell1 / 1p01 / 1p01 / 1p01 / 1p01 / 1p01 / 1p0
Silvermont4 / 1IEC0 IEC1 MEC4 / 1IEC0 IEC1 MEC4 / 1IEC0 IEC1 MEC1 / 1IEC0 IEC1 MEC1 / 1IEC0 IEC1 MEC1 / 1IEC0 IEC1 MEC
Zen5 / 0.5ALU0 ALU1 ALU2 ALU35 / 0.5ALU0 ALU1 ALU2 ALU35 / 0.5ALU0 ALU1 ALU2 ALU35 / 0.5ALU0 ALU1 ALU2 ALU35 / 0.5ALU0 ALU1 ALU2 ALU35 / 0.5ALU0 ALU1 ALU2 ALU3
Zen 25 / 0.33ALU0 ALU1 ALU2 ALU35 / 0.33ALU0 ALU1 ALU2 ALU35 / 0.33ALU0 ALU1 ALU2 ALU35 / 0.33ALU0 ALU1 ALU2 ALU35 / 0.33ALU0 ALU1 ALU2 ALU35 / 0.33ALU0 ALU1 ALU2 ALU3
Zen 3, Zen 44 / 1ALU0 ALU1 ALU2 ALU35 / 0.33ALU0 ALU1 ALU2 ALU35 / 0.33ALU0 ALU1 ALU2 ALU31 / 1ALU0 ALU1 ALU2 ALU31 / 1ALU0 ALU1 ALU2 ALU31 / 1ALU0 ALU1 ALU2 ALU3
Jaguar4 / 1ALU0 ALU14 / 1ALU0 ALU14 / 1ALU0 ALU11 / 1SAGU1 / 1SAGU1 / 1SAGU

Operation

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

v = src.read()
r = 0
for i in range(OSIZE // 8):
    r = r << 8 | (v >> 8 * i & 0xFF)   # the bytes in reverse order
dest.write(r)                    # a 16-bit register keeps bits 63:16, a
                                 # 32-bit one gets bits 63:32 cleared

Run on AMD Zen 5 (EPYC 9645): 30 cases. The APX forms were not run: none of these processors has APX.

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
MOVBE m16/32/64, r16/32/64
m16/32/64explicitwrite
r16/32/64explicitread
MOVBE r16/32/64, r/m16/32/64
r16/32/64explicitwrite
r/m16/32/64explicitread

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.

Legacy forms
none in XED
EVEX forms
APX-EVEX-INT

Intrinsics

The C intrinsics of Clang 23.1.2 that compile to MOVBE, 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
_loadbe_i16 short _loadbe_i16(const void *__P)

MOVBE r16/32/64, m16/32/64 Legacy -mmovbe

_loadbe_i32 int _loadbe_i32(const void *__P)

MOVBE r16/32/64, m16/32/64 Legacy -mmovbe

_loadbe_i64 long long _loadbe_i64(const void *__P)

MOVBE r16/32/64, m16/32/64 Legacy -mmovbe

_storebe_i16 void _storebe_i16(void *__P, short __D)

MOVBE m16/32/64, r16/32/64 Legacy -mmovbe

_storebe_i32 void _storebe_i32(void *__P, int __D)

MOVBE m16/32/64, r16/32/64 Legacy -mmovbe

_storebe_i64 void _storebe_i64(void *__P, long long __D)

MOVBE m16/32/64, r16/32/64 Legacy -mmovbe

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.

More APX instructions

All 88 APX 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. LLVM 23.1.2's x86 scheduling models (commit 85ac56026243): the latency, reciprocal throughput and ports of each form, as llvm-mca reports them.
  5. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026): Volume 2B, page 4-45 (MOVBE)
  6. Intel Advanced Performance Extensions (Intel APX) Architecture Specification, revision 9.0 (355828-009, August 2026)
  7. AMD64 Architecture Programmer's Manual, Volume 3: General-Purpose and System Instructions (24594, rev. 3.39, October 2026)
  8. 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 and the timings from LLVM's scheduling models, both part of the LLVM Project, licensed under the Apache License 2.0 with LLVM Exceptions. The text is our own.