Instruction
VMOVHLPS
Moves the high two singles of the second source into the low half of the result, the high half coming from the first source.
VMOVHLPS is the VEX and EVEX form of MOVHLPS, whose
page covers folding a vector in half for a horizontal sum. The legacy
form moves the high quadword of its source into the low quadword of the
destination and keeps the destination’s own high quadword. The
three-operand form keeps nothing of the destination: the low quadword
comes from the high quadword of the last operand, the high quadword from
the high quadword of the first source, and bits 128 and up are cleared.
With one register as both sources, vmovhlps xmm1, xmm0, xmm0 puts the
upper pair of XMM0 in both halves of XMM1, which is all a sum needs.
Only the 128-bit register form exists: VEX.L or EVEX.L’L set raises #UD,
and with a memory operand the same opcode is VMOVLPS.
The VEX form needs AVX; the EVEX form, AVX-512F or AVX10.1, reaches
XMM16 to XMM31 but takes no write mask.
On Zen 5, vmovhlps xmm0, xmm13, xmm9 put the high quadword of XMM9
below the high quadword of XMM13 and cleared bits 511:128 of ZMM0, and
{evex} vmovhlps xmm1, xmm2, xmm3 did the same with XMM3 and XMM2.
Folding without a copy
In our builds at -O2 with -march=x86-64-v3 and x86-64-v4, GCC 14
compiles _mm_movehl_ps(a, b) to vmovhlps xmm0, xmm0, xmm1, and the
sum of four floats from MOVHLPS’s page to vmovhlps xmm1, xmm0, xmm0
and VADDPS: the MOVAPS copy that the legacy form needed is gone, since
the separate destination leaves v intact for the addition. The sum of a
__m256 first adds its two halves after
VEXTRACTF128, VEXTRACTF32X4 in GCC at -v4, and
then folds the same way. Clang 23 writes the intrinsic as vunpckhpd xmm0, xmm1, xmm0 and folds with VSHUFPD and immediate
1, which move the same 64 bits.
AMD’s latency spreadsheet for Zen 5 gives the VEX and the EVEX rows alike one macro-op on pipes FP0 to FP3, a latency of 1 cycle and four per cycle. VMOVLHPS moves the other way.
Forms
| Instruction | Encoding | Requires |
|---|---|---|
VMOVHLPS xmm, xmm, xmm
VMOVHLPS_XMMdq_XMMdq_XMMdq | VEX.128.NP.0F.WIG 12 /r | AVX |
VMOVHLPS xmm, xmm, xmm
VMOVHLPS_XMMf32_XMMf32_XMMf32_AVX512 | EVEX.128.NP.0F.W0 12 /r | AVX10.1 or AVX512F |
Latency and throughput
| Model | xmm, xmm, xmm |
|---|---|
| Sandy Bridge, Haswell, Broadwell, Skylake, Skylake-SP, Ice Lake, Alder Lake, Sapphire Rapids | 1 / 1p5 |
| Lunar Lake | 1 / 0.5V2 V3 |
| Piledriver | 2 / 1FPFMA FPU0 FPU1 |
| Zen, Zen 2 | 1 / 0.5FPU1 FPU2 |
| Zen 3, Zen 4 | 1 / 0.5FP1 FP2 |
| Jaguar | 1 / 0.5FPA FPM FPU0 FPU1 |
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.
Result quadwords 1 to 0: a1, b1.
Operation
What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.
xmm1.q[0] = xmm3.q[1]
xmm1.q[1] = xmm2.q[1]
# xmm1 is zeroed from bit 128 upRun on AMD Zen 5 (EPYC 9645): 2 cases.
Operands
| Operand | Kind | Action |
|---|---|---|
VMOVHLPS xmm, xmm, xmm | ||
xmm | explicit | write |
xmm | explicit | read |
xmm | explicit | read |
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.
- VEX forms
avx-type-7- EVEX forms
AVX512-E7NM128
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.
| ISA set | CPUID | Processors |
|---|---|---|
AVX | AVX | Sandy Bridge, Ivy Bridge, Haswell, Broadwell, Skylake, Comet Lake, Cannon Lake, Ice Lake (client), Tiger Lake, Alder Lake, Arrow Lake, Panther Lake, Nova Lake, Skylake-SP, Cascade Lake, Cooper Lake, Ice Lake (server), Sapphire Rapids, Emerald Rapids, Granite Rapids, Diamond Rapids, Sierra Forest, Clearwater Forest, Knights Landing, Knights Mill, Bulldozer, Piledriver, Zen, Zen+, Zen 2, Zen 3, Zen 4, Zen 5, Zen 6 |
AVX512F_128N | AVX10.1 or AVX512F | Cannon Lake, Ice Lake (client), Tiger Lake, Nova Lake, Skylake-SP, Cascade Lake, Cooper Lake, Ice Lake (server), Sapphire Rapids, Emerald Rapids, Granite Rapids, Diamond Rapids, Knights Landing, Knights Mill, Zen 4, Zen 5, Zen 6 |
More AVX instructions
- VINSERTPS
- VLDDQU
- VLDMXCSR
- VMASKMOVDQU
- VMASKMOVPD
- VMASKMOVPS
- VMAXPD
- VMAXPS
- VMAXSD
- VMAXSS
- VMINPD
- VMINPS
- VMINSD
- VMINSS
- VMOVAPD
- VMOVAPS
- VMOVD
- VMOVDDUP
- VMOVDQA
- VMOVDQU
- VMOVHPD
- VMOVHPS
- VMOVLHPS
- VMOVLPD
- VMOVLPS
- VMOVMSKPD
- VMOVMSKPS
- VMOVNTDQ
- VMOVNTDQA
- VMOVNTPD
- VMOVNTPS
- VMOVQ
- VMOVSD
- VMOVSHDUP
- VMOVSLDUP
- VMOVSS
- VMOVUPD
- VMOVUPS
- VMPSADBW
- VMULPD
More AVX10.1 instructions
Sources
- Intel XED v2026.08.23 (commit
0bcb6237345c): forms, encodings, operands, flags, exception classes, attributes, ISA sets, CPUID bits and chip model. - The CPU data of x86-64.net: Zen 3 to Zen 6, from GCC’s
-marchfeature sets and AMD’s Processor Programming References, which the page of each processor cites. - LLVM 23.1.2's x86 scheduling models (commit
85ac56026243): the latency, reciprocal throughput and ports of each form, as llvm-mca reports them. - Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026): Volume 2B, page 4-72 (MOVHLPS)
- Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 1 (253665-093, September 2026)
- Intel Advanced Vector Extensions 10.2 Architecture Specification, revision 7.0 (361050-007, April 2026)
- 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 timings come from LLVM's scheduling models, part of the LLVM Project, licensed under the Apache License 2.0 with LLVM Exceptions. The text is our own.