...

Package bmi

import "github.com/apache/arrow/go/v15/parquet/internal/bmi"
Overview
Index

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.

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.