Instruction
VPSCATTERQQ
Stores quadwords to memory at addresses formed with a vector of 64-bit indices, for the elements a mask selects.
- Extensions
- Forms
- 3 (3 EVEX)
- Data
- Intel XED v2026.08.23
VPSCATTERQQ stores the quadwords of a vector to scattered addresses: element i goes to a base plus element i of an index vector, a signed 64-bit integer, times a scale of 1, 2, 4 or 8. Index and data have the same width, so 8 quadwords of a ZMM register take 8 indices from a ZMM register, and the YMM and XMM forms 4 and 2. It is the 64-bit-index form of VPSCATTERDQ, and VPSCATTERDD’s page explains the mask that is cleared as elements are stored, the order of repeated indices and the cost. VPGATHERQQ is the load it mirrors, and VSCATTERQPD the same store under a floating-point name. It came with AVX512F.
Recorded on Zen 5
- Overlapping, unaligned stores. With a scale of 1 and indices 23, 38 and -23, five selected elements wrote eight bytes each at unaligned offsets, two of them to addresses already written by an earlier element; at both, the bytes of the later element were left.
- Below the base. In the XMM form, index -8 times 8 stored element 1 at 64 bytes below the base.
- Mask. In every case the mask register ended as 0, all 64 bits, and in the YMM form the element that K3 left out stored nothing.
In compiled code
At -O2 with -march=x86-64-v4, GCC 14 and Clang 23 compile d[ix[i]] = s[i], with int64_t data and long indices, to VPSCATTERQQ. GCC
scatters from ZMM registers, copying an all-ones mask made once by
KXNORB with KMOVB before each scatter; Clang scatters
from YMM registers with a fresh KXNORW before each, and
with -march=znver5 from ZMM registers, where GCC leaves the loop
scalar. _mm512_i64scatter_epi64 is KXNORB and VPSCATTERQQ in both,
except with GCC’s -march=znver5, which loads the all-ones byte from
memory with KMOVB instead.
AMD’s Zen 5 latency spreadsheet lists VPSCATTERQQ as microcoded, as every scatter.
In the optimization guide
What the optimization guide says about VPSCATTERQQ, a line per claim. Each links to the claim in the guide, with its sources and where they differ.
Vectors
- Gathers and scatters: Scatters store one element at a time; Intel replaces short-stride scatters by permutes and stores, and they are microcode on Zen 5.
Forms
| Instruction | Encoding | Requires |
|---|---|---|
VPSCATTERQQ vm64z {k}, zmm
VPSCATTERQQ_MEMu64_MASKmskw_ZMMu64_AVX512_VL512 | EVEX.512.66.0F38.W1 A1 /r | AVX10.1 or AVX512F |
VPSCATTERQQ vm64x {k}, xmm
VPSCATTERQQ_MEMu64_MASKmskw_XMMu64_AVX512_VL128 | EVEX.128.66.0F38.W1 A1 /r | AVX10.1 or AVX512F + AVX512VL |
VPSCATTERQQ vm64y {k}, ymm
VPSCATTERQQ_MEMu64_MASKmskw_YMMu64_AVX512_VL256 | EVEX.256.66.0F38.W1 A1 /r | AVX10.1 or AVX512F + AVX512VL |
Latency and throughput
| Model | vm64z {k}, zmm | vm64x {k}, xmm | vm64y {k}, ymm |
|---|---|---|---|
| Skylake-SP | 7 / 8p0156 | 7 / 2p0156 | 7 / 4p0156 |
| Ice Lake | 7 / 4p0156 | 7 / 1p0156 | 7 / 2p0156 |
| Sapphire Rapids | 12 / 4p0 p1 p5 p6 p11 | 12 / 1p0 p1 p5 p6 p11 | 12 / 2p0 p1 p5 p6 p11 |
| Zen 4 | 1 / 1AGU0 AGU1 AGU2 LSU Store | 1 / 1AGU0 AGU1 AGU2 LSU Store | 1 / 1AGU0 AGU1 AGU2 LSU Store |
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.
Example: indices 3, 14, 0, 7, 5, 11, 2, 5 from element 7 down, mask k1 = 0xFB; memory elements are numbered from the base address in units of the scale. The other forms scatter 2 and 4 elements, one for each index. The mask is cleared as the elements complete.
With the example indices, memory elements 15 to 0: unchanged, a6, unchanged, unchanged, unchanged, unchanged, unchanged, unchanged, a4, unchanged, a3, unchanged, a7, a1, unchanged, a5.
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 // 64):
if k1[i]:
a = mem.index.sq[i] * mem.scale
store(mem.base + a, 64, zmm2.q[i])
k1.write(0) # all of it
Run on AMD Zen 5 (EPYC 9645): 3 cases.
Operands
| Operand | Kind | Action |
|---|---|---|
VPSCATTERQQ vm64x {k}, xmm VPSCATTERQQ vm64y {k}, ymm VPSCATTERQQ vm64z {k}, zmm | ||
vm64x, vm64y, vm64z | explicit | write (masked) |
{k} | explicit | read, write (write mask) |
xmm, ymm, zmm | 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.
- All forms
AVX512-E12
Attributes
What else XED records about the forms. How to read.
- All forms
- scatter; write masking; memory fault suppression
Intrinsics
The C intrinsics of Clang 23.1.2 that compile to VPSCATTERQQ, 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_i64scatter_epi64
void _mm_i64scatter_epi64(void *addr, __m128i index, __m128i v1, const int scale) |
|
_mm_mask_i64scatter_epi64
void _mm_mask_i64scatter_epi64(void *addr, __mmask8 mask, __m128i index, __m128i v1, const int scale) |
|
_mm256_i64scatter_epi64
void _mm256_i64scatter_epi64(void *addr, __m256i index, __m256i v1, const int scale) |
|
_mm256_mask_i64scatter_epi64
void _mm256_mask_i64scatter_epi64(void *addr, __mmask8 mask, __m256i index, __m256i v1, const int scale) |
|
_mm512_i64scatter_epi64
void _mm512_i64scatter_epi64(void *addr, __m512i index, __m512i v1, const int scale) |
|
_mm512_mask_i64scatter_epi64
void _mm512_mask_i64scatter_epi64(void *addr, __mmask8 mask, __m512i index, __m512i v1, const int scale) |
|
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 |
|---|---|---|
AVX512F_512 | 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 |
AVX512F_128 | AVX10.1 or AVX512F + AVX512VL | 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, Zen 4, Zen 5, Zen 6 |
AVX512F_256 | Same as AVX512F_128 | Same as AVX512F_128 |
More AVX10.1 instructions
- VPMULTISHIFTQB
- VPMULUDQ
- VPOPCNTB
- VPOPCNTD
- VPOPCNTQ
- VPOPCNTW
- VPORD
- VPORQ
- VPROLD
- VPROLQ
- VPROLVD
- VPROLVQ
- VPRORD
- VPRORQ
- VPRORVD
- VPRORVQ
- VPSADBW
- VPSCATTERDD
- VPSCATTERDQ
- VPSCATTERQD
- VPSHLDD
- VPSHLDQ
- VPSHLDVD
- VPSHLDVQ
- VPSHLDVW
- VPSHLDW
- VPSHRDD
- VPSHRDQ
- VPSHRDVD
- VPSHRDVQ
- VPSHRDVW
- VPSHRDW
- VPSHUFB
- VPSHUFBITQMB
- VPSHUFD
- VPSHUFHW
- VPSHUFLW
- VPSLLD
- VPSLLDQ
- VPSLLQ
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 Advanced Vector Extensions 10.2 Architecture Specification, revision 7.0 (361050-007, April 2026)
- Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026): Volume 2C, page 5-618 (VPSCATTERDD/
VPSCATTERDQ/ VPSCATTERQD/ VPSCATTERQQ) - 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.