Bit manipulation instruction sets

from Wikipedia, the free encyclopedia

Bit Manipulation Instructions Sets ( BMI ) are instruction set extensions for microprocessors from Intel and AMD .

There are several subsets of BMI: BMI1 and BMI2 from Intel, which were introduced with the Intel Haswell microarchitecture , and ABM and TBM from AMD. ABM (Advanced Bit Manipulation) contains instructions from Intel's SSE4.2 and BMI1, TBM (Trailing Bit Manipulation) is an extension of BMI1 that was introduced with the Piledriver architecture .

New instructions

ABM

instruction description
POPCNT Population count
LZCNT Number of leading zeros

BMI1

instruction description Expression in C
ANDN AND NOT ~x & y
BEXTR bit field extract (src >> start) & ((1 << len)-1)
BLSI x & -x
BLSMSK x ^ (x - 1)
BLSR x & (x - 1)
TZCNT Number of trailing zeros -

BMI2

instruction description
BZHI
MULX Unsigned multiplication without influence on flags (for RSA )
PDEP Parallel bit deposit
PEXT Parallel bit extract
RORX Bitwise rotation to the right without affecting flags (for SHA )
SARX Arithmetic shift to the right
SHRX Logical shift to the right
SHLX Logical shift to the left

TBM

instruction Description (English) Expression in C
BEXTR Bit field extract (immediate control value) (src >> start) & ((1 << len)-1)
BLCFILL Fill from lowest clear bit x & (x + 1)
BLCI Isolate lowest clear bit x | ~(x + 1)
BLCIC Isolate lowest clear bit and complement ~x & (x + 1)
BLCMASK Mask from lowest clear bit x ^ (x + 1)
BLCS Set lowest clear bit x | (x + 1)
BLSFILL Fill from lowest set bit x | (x - 1)
BLSIC Isolate lowest set bit and complement ~x | (x - 1)
T1MSKC Inverse mask from trailing ones ~x | (x + 1)
TZMSK Mask from trailing zeros ~x & (x - 1)

Individual evidence

  1. a b AMD64 Architecture Programmer's Manual, Volume 3: General-Purpose and System Instructions (PDF) In: amd.com . AMD . October 2013. Retrieved January 2, 2014.
  2. Intel Advanced Vector Extensions Programming Reference (PDF) In: intel.com . Intel . June 2011. Retrieved January 3, 2014.
  3. bmiintrin.h from GCC 4.8 . Retrieved March 17, 2014.
  4. Chess Programming BMI1 . Retrieved April 8, 2014.
  5. ^ A b Haswell Cryptographic Performance , July 2013
  6. tbmintrin.h from GCC 4.8 . Retrieved March 17, 2014.