popcnt

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 Popcnt32

func Popcnt32(a int) int

Popcnt32: Count the number of bits set to 1 in 32-bit integer 'a', and return that count in 'dst'.

dst := 0
FOR i := 0 to 31
	IF a[i]
		dst := dst + 1
	FI
ENDFOR

Instruction: 'POPCNT'. Intrinsic: '_popcnt32'. Requires POPCNT.

func Popcnt64

func Popcnt64(a int64) int

Popcnt64: Count the number of bits set to 1 in 64-bit integer 'a', and return that count in 'dst'.

dst := 0
FOR i := 0 to 63
	IF a[i]
		dst := dst + 1
	FI
ENDFOR

Instruction: 'POPCNT'. Intrinsic: '_popcnt64'. Requires POPCNT.

func PopcntU32

func PopcntU32(a uint32) int

PopcntU32: Count the number of bits set to 1 in unsigned 32-bit integer 'a', and return that count in 'dst'.

dst := 0
FOR i := 0 to 31
	IF a[i]
		dst := dst + 1
	FI
ENDFOR

Instruction: 'POPCNT'. Intrinsic: '_mm_popcnt_u32'. Requires POPCNT.

func PopcntU64

func PopcntU64(a uint64) int64

PopcntU64: Count the number of bits set to 1 in unsigned 64-bit integer 'a', and return that count in 'dst'.

dst := 0
FOR i := 0 to 63
	IF a[i]
		dst := dst + 1
	FI
ENDFOR

Instruction: 'POPCNT'. Intrinsic: '_mm_popcnt_u64'. Requires POPCNT.

Types

This section is empty.

Jump to

Keyboard shortcuts

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