Skip to content

VPOPCNT

Operation

Counts the set bits in each active element.

Assembler Syntax

VPOPCNT.{B|W|L|Q}(z) Pn(p), Vn(v)

VPOPCNT.{B|W|L|Q}(z) Pn(p), <ea>(e), Vn(v)

VPOPCNT.{B|W|L|Q}(z) Pn(p), Vn(v), <ea>(e)

Privilege

Unprivileged

Required CPUID flags

VECTOR

The register form replaces each active destination lane with the population count: the number of one bits in its old selected-width value. The memory-source form counts the set bits in each active memory element and writes the result to the corresponding destination lane. An inactive destination lane retains its previous value.

The memory-destination form counts the set bits in each active source-register lane and writes the result to the corresponding memory element. An inactive memory element remains unchanged. The count covers exactly the bits in the selected element width.

2.75in

Encodings

VPOPCNT.{B|W|L|Q}(z) Pn(p), Vn(v)

Format: Instruction format for VPOPCNT.{B|W|L|Q}(z) Pn(p), Vn(v)

Format: Instruction format for VPOPCNT.{B|W|L|Q}(z) Pn(p), Vn(v)

2.75in VPOPCNT.{B|W|L|Q}(z) Pn(p), <ea>(e), Vn(v)

Format: Instruction format for VPOPCNT.{B|W|L|Q}(z) Pn(p), <ea>(e), Vn(v)

Format: Instruction format for VPOPCNT.{B|W|L|Q}(z) Pn(p), <ea>(e), Vn(v)

2.75in VPOPCNT.{B|W|L|Q}(z) Pn(p), Vn(v), <ea>(e)

Format: Instruction format for VPOPCNT.{B|W|L|Q}(z) Pn(p), Vn(v), <ea>(e)

Format: Instruction format for VPOPCNT.{B|W|L|Q}(z) Pn(p), Vn(v), <ea>(e)

dstexcluded: immediate [invalid_destination]