Instruction
VMOVLHPS
Moves the low two singles of the second source into the high half of the result, the low half coming from the first source.
VMOVLHPS is the VEX and EVEX form of MOVLHPS, whose page explains why Clang uses it for doubles as a shorter UNPCKLPD. The three-operand form keeps the low quadword of the first source, puts the low quadword of the last operand above it and clears bits 128 and up, where the legacy form kept the destination’s own low half. VMOVHLPS covers what the encodings share: a 128-bit register form only, #UD for VEX.L or EVEX.L’L set, AVX for VEX and AVX-512F or AVX10.1 for EVEX, without a write mask. With a memory operand the opcode is VMOVHPS.
On Zen 5, vmovlhps xmm0, xmm13, xmm9 kept the low quadword of XMM13,
placed the low quadword of XMM9 above it and cleared bits 511:128 of
ZMM0, and {evex} vmovlhps xmm5, xmm5, xmm5 copied the low quadword of
XMM5 into both halves.
The same length as VUNPCKLPD
On xmm registers the result is that of VUNPCKLPD,
and in VEX the byte that MOVLHPS saves is gone: the 66 prefix of
UNPCKLPD becomes two bits of the VEX prefix, so both instructions have
the same length. Clang 23 keeps its habit anyway. In our builds at -O2
with -march=x86-64-v3 and x86-64-v4, it compiles _mm_movelh_ps,
_mm_unpacklo_pd(a, b) and _mm_set_pd(b, a) all to vmovlhps xmm0, xmm0, xmm1, while GCC 14 emits VMOVLHPS for the first and VUNPCKLPD for
the other two. For _mm_set1_pd(x) both now use
VMOVDDUP on the register rather than a move of the
register into its own high half. Only the xmm form exists, so for
_mm256_unpacklo_pd both compilers emit VUNPCKLPD.
AMD’s latency spreadsheet for Zen 5 gives the VEX and the EVEX rows one macro-op on pipes FP0 to FP3, a latency of 1 cycle and four per cycle, as for VMOVHLPS.
Forms
| Instruction | Encoding | Requires |
|---|---|---|
VMOVLHPS xmm, xmm, xmm
VMOVLHPS_XMMdq_XMMq_XMMq | VEX.128.NP.0F.WIG 16 /r | AVX |
VMOVLHPS xmm, xmm, xmm
VMOVLHPS_XMMf32_XMMf32_XMMf32_AVX512 | EVEX.128.NP.0F.W0 16 /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: b0, a0.
Operation
What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.
xmm1.q[0] = xmm2.q[0]
xmm1.q[1] = xmm3.q[0]
# xmm1 is zeroed from bit 128 upRun on AMD Zen 5 (EPYC 9645): 2 cases.
Operands
| Operand | Kind | Action |
|---|---|---|
VMOVLHPS 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
- VMASKMOVDQU
- VMASKMOVPD
- VMASKMOVPS
- VMAXPD
- VMAXPS
- VMAXSD
- VMAXSS
- VMINPD
- VMINPS
- VMINSD
- VMINSS
- VMOVAPD
- VMOVAPS
- VMOVD
- VMOVDDUP
- VMOVDQA
- VMOVDQU
- VMOVHLPS
- VMOVHPD
- VMOVHPS
- VMOVLPD
- VMOVLPS
- VMOVMSKPD
- VMOVMSKPS
- VMOVNTDQ
- VMOVNTDQA
- VMOVNTPD
- VMOVNTPS
- VMOVQ
- VMOVSD
- VMOVSHDUP
- VMOVSLDUP
- VMOVSS
- VMOVUPD
- VMOVUPS
- VMPSADBW
- VMULPD
- VMULPS
- VMULSD
- VMULSS
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-78 (MOVLHPS)
- 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.