Instruction
VMOVSHDUP
Duplicates each odd-numbered single into the even position below it.
VMOVSHDUP is the VEX and EVEX form of MOVSHDUP: each odd single is copied over the even one below it, giving elements 1, 1, 3, 3 and so on across the register. MOVSHDUP’s page covers its uses, and VMOVSLDUP is the twin for the even singles. The VEX forms need AVX, ymm included; the EVEX forms need AVX-512F (with AVX512VL below 512 bits) or AVX10.1 and add a write mask per single, but no broadcast. There is still only one source, as VEX.vvvv and EVEX.vvvv must be 1111b; what changes is that memory needs no alignment and the register is cleared above the vector length. Since every pair stays where it is, the wider forms need no lanes: the ymm form is the xmm one twice.
Recorded on Zen 5
vmovshdup ymm7, ymm11gave elements 1, 1, 3, 3, 5, 5, 7, 7 of YMM11.vmovshdup zmm7{k6}, zmm12, the low 16 bits of K6 43A4h, wrote elements 2, 5, 7, 8, 9 and 14 (elements 3, 5, 7, 9, 9 and 15 of ZMM12) and kept the other ten.vmovshdup xmm9{k6}{z}, xmmword ptr [mem]kept only element 2, the fourth single from memory, and zeroed the rest.
In compiled code
In our builds at -O2 with -march=x86-64-v3 and -v4, the shuffle
__builtin_shufflevector(v, v, 1, 1, 3, 3, 5, 5, 7, 7) on eight floats
is vmovshdup ymm0, ymm0 in Clang 23 but
vpermilps ymm0, ymm0, 0xf5 in GCC 14, which uses the immediate
form of VPERMILPS instead. GCC does the same in a
float complex product with -fcx-limited-range, spreading the
imaginary parts with F5h before a
VFMADDSUB231PS.
AMD’s latency spreadsheet for Zen 5 gives VMOVSHDUP, in its VEX and EVEX rows alike, and that form of VPERMILPS the same figures: one macro-op with a latency of 1 cycle on any of the four vector pipes.
Forms
| Instruction | Encoding | Requires |
|---|---|---|
VMOVSHDUP xmm, m128
VMOVSHDUP_XMMdq_MEMdq | VEX.128.F3.0F.WIG 16 /r | AVX |
VMOVSHDUP xmm, xmm
VMOVSHDUP_XMMdq_XMMdq | VEX.128.F3.0F.WIG 16 /r | AVX |
VMOVSHDUP ymm, m256
VMOVSHDUP_YMMqq_MEMqq | VEX.256.F3.0F.WIG 16 /r | AVX |
VMOVSHDUP ymm, ymm
VMOVSHDUP_YMMqq_YMMqq | VEX.256.F3.0F.WIG 16 /r | AVX |
VMOVSHDUP zmm {k}{z}, zmm
VMOVSHDUP_ZMMf32_MASKmskw_ZMMf32_AVX512 | EVEX.512.F3.0F.W0 16 /r | AVX10.1 or AVX512F |
VMOVSHDUP zmm {k}{z}, m512
VMOVSHDUP_ZMMf32_MASKmskw_MEMf32_AVX512 | EVEX.512.F3.0F.W0 16 /r | AVX10.1 or AVX512F |
VMOVSHDUP xmm {k}{z}, xmm
VMOVSHDUP_XMMf32_MASKmskw_XMMf32_AVX512 | EVEX.128.F3.0F.W0 16 /r | AVX10.1 or AVX512F + AVX512VL |
VMOVSHDUP xmm {k}{z}, m128
VMOVSHDUP_XMMf32_MASKmskw_MEMf32_AVX512 | EVEX.128.F3.0F.W0 16 /r | AVX10.1 or AVX512F + AVX512VL |
VMOVSHDUP ymm {k}{z}, ymm
VMOVSHDUP_YMMf32_MASKmskw_YMMf32_AVX512 | EVEX.256.F3.0F.W0 16 /r | AVX10.1 or AVX512F + AVX512VL |
VMOVSHDUP ymm {k}{z}, m256
VMOVSHDUP_YMMf32_MASKmskw_MEMf32_AVX512 | EVEX.256.F3.0F.W0 16 /r | AVX10.1 or AVX512F + AVX512VL |
Latency and throughput
| Model | xmm, m128 | xmm, xmmxmm {k}{z}, xmmymm {k}{z}, ymm | ymm, m256 | ymm, ymm | zmm {k}{z}, zmm | zmm {k}{z}, m512no mask | zmm {k}{z}, m512with a mask, zeroing | xmm {k}{z}, m128no mask | xmm {k}{z}, m128with a mask, zeroing | ymm {k}{z}, m256no mask | ymm {k}{z}, m256with a mask, zeroing |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Sandy Bridge, Haswell, Skylake | 6 / 0.5p23 | 1 / 1p5 | 7 / 0.5p23 | 1 / 1p5 | |||||||
| Broadwell | 5 / 0.5p23 | 1 / 1p5 | 6 / 0.5p23 | 1 / 1p5 | |||||||
| Skylake-SP | 6 / 0.5p23 | 1 / 1p5 | 7 / 0.5p23 | 1 / 1p5 | 1 / 1p5 | 8 / 0.5p015 | 8 / 0.5p015 | 7 / 0.5p015 | 7 / 0.5p015 | 8 / 0.5p015 | 8 / 0.5p015 |
| Ice Lake | 6 / 0.5p23 | 1 / 0.5p15 | 7 / 0.5p23 | 1 / 0.5p15 | 1 / 1p5 | 8 / 0.5p015 | 8 / 0.5p015 | 7 / 0.5p015 | 7 / 0.5p015 | 8 / 0.5p015 | 8 / 0.5p015 |
| Alder Lake | 7 / 0.33p2 p3 p10 | 1 / 0.5p15 | 8 / 0.33p2 p3 p10 | 1 / 0.5p15 | |||||||
| Sapphire Rapids | 7 / 0.33p2 p3 p10 | 1 / 0.5p15 | 8 / 0.33p2 p3 p10 | 1 / 0.5p15 | 1 / 1p5 | 8 / 0.33p2 p3 p10 | 9 / 0.5p05 | 7 / 0.33p2 p3 p10 | 8 / 0.33p015 | 8 / 0.33p2 p3 p10 | 9 / 0.33p015 |
| Lunar Lake | 6 / 2p20 p21 p22 | 1 / 0.5V2 V3 | 7 / 2.33p20 p21 p22 | 1 / 0.5V2 V3 | |||||||
| Piledriver | 7 / 1.5FPFMA FPU0 FPU1 | 2 / 1FPFMA FPU0 FPU1 | 7 / 2FPFMA FPU0 FPU1 | 2 / 2FPFMA FPU0 FPU1 | |||||||
| Zen | 8 / 0.5FPU1 FPU2 | 1 / 0.5FPU1 FPU2 | 8 / 1FPU1 FPU2 | 1 / 1FPU1 FPU2 | |||||||
| Zen 2 | 8 / 0.5FPU1 FPU2 | 1 / 0.5FPU1 FPU2 | 8 / 0.5FPU1 FPU2 | 1 / 0.5FPU1 FPU2 | |||||||
| Zen 3 | 8 / 0.5FP1 FP2 | 1 / 0.5FP1 FP2 | 8 / 0.5FP1 FP2 | 1 / 0.5FP1 FP2 | |||||||
| Zen 4 | 8 / 0.5FP1 FP2 | 1 / 0.5FP1 FP2 | 8 / 0.5FP1 FP2 | 1 / 0.5FP1 FP2 | 1 / 1FP1 FP2 | 8 / 1FP1 FP2 | 8 / 1FP1 FP2 | 8 / 0.5FP1 FP2 | 8 / 0.5FP1 FP2 | 8 / 0.5FP1 FP2 | 8 / 0.5FP1 FP2 |
| Jaguar | 6 / 1FPA FPM FPU0 FPU1 | 1 / 0.5FPA FPM FPU0 FPU1 | 6 / 2FPA FPM FPU0 FPU1 | 1 / 1FPA 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.
The ymm and zmm forms repeat this in each 128-bit lane. The EVEX forms write under a mask: where its bit is 0, the element keeps its old value, or zeroes it with {z}.
Result singles 3 to 0: a3, unchanged (bit 2 of k1 is 0), a1, a1.
Operation
What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.
for i in range(VL // 32):
j = i - i % 2 + 1
if k1[i]: # 1 without a write mask
zmm1.d[i] = src2.d[j]
elif zeroing:
zmm1.d[i] = 0
# else: zmm1.d[i] keeps its value
# zmm1 is zeroed from bit VL upRun on AMD Zen 5 (EPYC 9645): 10 cases.
Operands
| Operand | Kind | Action |
|---|---|---|
VMOVSHDUP xmm, xmm/m128 VMOVSHDUP ymm, ymm/m256 | ||
xmm, ymm | explicit | write |
xmm/m128, ymm/m256 | explicit | read |
VMOVSHDUP xmm {k}{z}, xmm/m128 VMOVSHDUP ymm {k}{z}, ymm/m256 VMOVSHDUP zmm {k}{z}, zmm/m512 | ||
xmm, ymm, zmm | explicit | write (masked) |
{k} | explicit | read (write mask) |
xmm/m128, ymm/m256, zmm/m512 | 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-4- EVEX forms
AVX512-E4NF
Attributes
What else XED records about the forms. How to read.
- EVEX forms
- write masking
Intrinsics
The C intrinsics of Clang 23.1.2 that compile to VMOVSHDUP, 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.
| Intrinsic | Compiles to |
|---|---|
_mm_movehdup_ps
__m128 _mm_movehdup_ps(__m128 __a) |
|
_mm_mask_movehdup_ps
__m128 _mm_mask_movehdup_ps(__m128 __W, __mmask8 __U, __m128 __A) |
|
_mm_maskz_movehdup_ps
__m128 _mm_maskz_movehdup_ps(__mmask8 __U, __m128 __A) |
|
_mm256_movehdup_ps
__m256 _mm256_movehdup_ps(__m256 __a) |
|
_mm256_mask_movehdup_ps
__m256 _mm256_mask_movehdup_ps(__m256 __W, __mmask8 __U, __m256 __A) |
|
_mm256_maskz_movehdup_ps
__m256 _mm256_maskz_movehdup_ps(__mmask8 __U, __m256 __A) |
|
_mm512_movehdup_ps
__m512 _mm512_movehdup_ps(__m512 __A) |
|
_mm512_mask_movehdup_ps
__m512 _mm512_mask_movehdup_ps(__m512 __W, __mmask16 __U, __m512 __A) |
|
_mm512_maskz_movehdup_ps
__m512 _mm512_maskz_movehdup_ps(__mmask16 __U, __m512 __A) |
|
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.
More AVX instructions
- VMOVAPD
- VMOVAPS
- VMOVD
- VMOVDDUP
- VMOVDQA
- VMOVDQU
- VMOVHLPS
- VMOVHPD
- VMOVHPS
- VMOVLHPS
- VMOVLPD
- VMOVLPS
- VMOVMSKPD
- VMOVMSKPS
- VMOVNTDQ
- VMOVNTDQA
- VMOVNTPD
- VMOVNTPS
- VMOVQ
- VMOVSD
- VMOVSLDUP
- VMOVSS
- VMOVUPD
- VMOVUPS
- VMPSADBW
- VMULPD
- VMULPS
- VMULSD
- VMULSS
- VORPD
- VORPS
- VPABSB
- VPABSD
- VPABSW
- VPACKSSDW
- VPACKSSWB
- VPACKUSDW
- VPACKUSWB
- VPADDB
- VPADDD
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. - 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. - 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-111 (MOVSHDUP)
- 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 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.