bmi1

package
v0.0.0-...-3878f85 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2017 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

THESE PACKAGES ARE FOR DEMONSTRATION PURPOSES ONLY!

THEY DO NOT NOT CONTAIN WORKING INTRINSICS!

See https://github.com/klauspost/intrinsics

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BextrU32

func BextrU32(a uint32, start uint32, len uint32) uint32

BextrU32: Extract contiguous bits from unsigned 32-bit integer 'a', and store the result in 'dst'. Extract the number of bits specified by 'len', starting at the bit specified by 'start'.

tmp := ZERO_EXTEND_TO_512(a)
dst := ZERO_EXTEND(tmp[start+len-1:start])

Instruction: 'BEXTR'. Intrinsic: '_bextr_u32'. Requires BMI1.

func BextrU64

func BextrU64(a uint64, start uint32, len uint32) uint64

BextrU64: Extract contiguous bits from unsigned 64-bit integer 'a', and store the result in 'dst'. Extract the number of bits specified by 'len', starting at the bit specified by 'start'.

tmp := ZERO_EXTEND_TO_512(a)
dst := ZERO_EXTEND(tmp[start+len-1:start])

Instruction: 'BEXTR'. Intrinsic: '_bextr_u64'. Requires BMI1.

func BlsiU32

func BlsiU32(a uint32) uint32

BlsiU32: Extract the lowest set bit from unsigned 32-bit integer 'a' and set the corresponding bit in 'dst'. All other bits in 'dst' are zeroed, and all bits are zeroed if no bits are set in 'a'.

dst := (-a) BITWISE AND a

Instruction: 'BLSI'. Intrinsic: '_blsi_u32'. Requires BMI1.

func BlsiU64

func BlsiU64(a uint64) uint64

BlsiU64: Extract the lowest set bit from unsigned 64-bit integer 'a' and set the corresponding bit in 'dst'. All other bits in 'dst' are zeroed, and all bits are zeroed if no bits are set in 'a'.

dst := (-a) BITWISE AND a

Instruction: 'BLSI'. Intrinsic: '_blsi_u64'. Requires BMI1.

func BlsmskU32

func BlsmskU32(a uint32) uint32

BlsmskU32: Set all the lower bits of 'dst' up to and including the lowest set bit in unsigned 32-bit integer 'a'.

dst := (a - 1) XOR a

Instruction: 'BLSMSK'. Intrinsic: '_blsmsk_u32'. Requires BMI1.

func BlsmskU64

func BlsmskU64(a uint64) uint64

BlsmskU64: Set all the lower bits of 'dst' up to and including the lowest set bit in unsigned 64-bit integer 'a'.

dst := (a - 1) XOR a

Instruction: 'BLSMSK'. Intrinsic: '_blsmsk_u64'. Requires BMI1.

func BlsrU32

func BlsrU32(a uint32) uint32

BlsrU32: Copy all bits from unsigned 32-bit integer 'a' to 'dst', and reset (set to 0) the bit in 'dst' that corresponds to the lowest set bit in 'a'.

dst := (a - 1) BITWISE AND a

Instruction: 'BLSR'. Intrinsic: '_blsr_u32'. Requires BMI1.

func BlsrU64

func BlsrU64(a uint64) uint64

BlsrU64: Copy all bits from unsigned 64-bit integer 'a' to 'dst', and reset (set to 0) the bit in 'dst' that corresponds to the lowest set bit in 'a'.

dst := (a - 1) BITWISE AND a

Instruction: 'BLSR'. Intrinsic: '_blsr_u64'. Requires BMI1.

func Tzcnt32

func Tzcnt32(a uint32) int

Tzcnt32: Count the number of trailing zero bits in unsigned 32-bit integer 'a', and return that count in 'dst'.

tmp := 0
dst := 0
DO WHILE ((tmp < 32) AND a[tmp] = 0)
	tmp := tmp + 1
	dst := dst + 1
OD

Instruction: 'TZCNT'. Intrinsic: '_mm_tzcnt_32'. Requires BMI1.

func Tzcnt64

func Tzcnt64(a uint64) int64

Tzcnt64: Count the number of trailing zero bits in unsigned 64-bit integer 'a', and return that count in 'dst'.

tmp := 0
dst := 0
DO WHILE ((tmp < 64) AND a[tmp] = 0)
	tmp := tmp + 1
	dst := dst + 1
OD

Instruction: 'TZCNT'. Intrinsic: '_mm_tzcnt_64'. Requires BMI1.

func TzcntU32

func TzcntU32(a uint32) uint32

TzcntU32: Count the number of trailing zero bits in unsigned 32-bit integer 'a', and return that count in 'dst'.

tmp := 0
dst := 0
DO WHILE ((tmp < 32) AND a[tmp] = 0)
	tmp := tmp + 1
	dst := dst + 1
OD

Instruction: 'TZCNT'. Intrinsic: '_tzcnt_u32'. Requires BMI1.

func TzcntU64

func TzcntU64(a uint64) uint64

TzcntU64: Count the number of trailing zero bits in unsigned 64-bit integer 'a', and return that count in 'dst'.

tmp := 0
dst := 0
DO WHILE ((tmp < 64) AND a[tmp] = 0)
	tmp := tmp + 1
	dst := dst + 1
OD

Instruction: 'TZCNT'. Intrinsic: '_tzcnt_u64'. Requires BMI1.

Types

This section is empty.

Jump to

Keyboard shortcuts

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