bmi

package
v17.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2024 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 7 more Imports: 3 Imported by: 0

Documentation

Overview

Package bmi contains helpers for manipulating bitmaps via BMI2 extensions properly falling back to pure go implementations if the CPU doesn't support BMI2.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractBits

func ExtractBits(bitmap, selectBitmap uint64) uint64

ExtractBits performs a Parallel Bit extract as per the PEXT instruction for x86/x86-64 cpus to use the second parameter as a mask to extract the bits from the first argument into a new bitmap.

For each bit Set in selectBitmap, the corresponding bits are extracted from bitmap and written to contiguous lower bits of the result, the remaining upper bits are zeroed.

func GreaterThanBitmap

func GreaterThanBitmap(levels []int16, rhs int16) uint64

GreaterThanBitmap builds a bitmap where each bit corresponds to whether or not the level in that index is greater than the value of rhs.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL