Home

BMI2

BMI2, short for Bit Manipulation Instruction Set 2, is an extension to the x86-64 instruction set architecture that provides additional instructions for manipulating bits and bitfields. The extension was designed to enable faster implementations of routines that work with binary data, such as bit-field extraction, packing and unpacking, multi-precision arithmetic, and certain cryptographic operations. It follows BMI1 as part of the broader effort to accelerate low-level data handling on modern processors.

Availability and hardware support: BMI2 was introduced by Intel with the Haswell generation and later adopted

Key instructions and capabilities: The extension includes instructions such as PEXT (parallel bits extract) and PDEP

Impact and usage: In practice, BMI2 enables compilers and libraries to implement high-performance bit-twiddling routines with

See also: x86 instruction set extensions, BMI1, CPUID feature flags, bit manipulation.

by
AMD
in
subsequent
microarchitectures.
Most
modern
desktop,
mobile,
and
server
CPUs
from
Intel
and
AMD
support
BMI2,
making
software-implemented
bit
manipulation
faster
on
current
hardware.
The
presence
of
BMI2
is
exposed
by
the
processor
via
the
CPUID
feature
flags,
allowing
software
to
enable
optimized
code
paths
conditionally.
(parallel
bits
deposit),
which
allow
selective
extraction
or
placement
of
bits
based
on
a
mask,
as
well
as
MULX,
which
performs
multiplication
with
explicit
destination
operands.
These
enable
more
efficient
algorithms
for
bit
packing,
compression,
cryptographic
primitives,
and
big-integer
arithmetic
by
reducing
the
number
of
instructions
and
avoiding
temporary
registers.
smaller
code
size
and
lower
latency
on
supporting
processors.
Software
that
relies
on
bit-level
manipulation,
large
integer
arithmetic,
or
performance-critical
data
processing
can
benefit
from
BMI2-enabled
builds.