Source File
regmask.go
Belonging Package
github.com/klauspost/compress/internal/regmask
//go:build !386// Package regmask provides masks for variable shift counts.//// Go defines a shift by more than the width of the shifted value as producing// zero, so the compiler has to guard every variable shift against that: on// amd64 with a CMP and an SBB, on arm64 with a CMP and a CSEL, and so on. When// the count is known to be smaller than the width anyway, masking it with the// width minus one lets the compiler drop the guard. The mask itself costs// nothing on the architectures whose shift instructions already use only the// low bits of the count, which the compiler knows about.//// Each constant is named for the width of the value being shifted and the type// of the shift count, and may only be used where the count is always smaller// than that width://// x := y >> (n & regmask.Shift64ByUint) // y is 64 bits, n is a uint below 64package regmaskconst (// ShiftNByUint8 - shifting an N bit value by a uint8Shift8ByUint8 = 7Shift16ByUint8 = 15Shift32ByUint8 = 31Shift64ByUint8 = 63// ShiftNByUint16 - shifting an N bit value by a uint16Shift8ByUint16 = Shift8ByUint8Shift16ByUint16 = Shift16ByUint8Shift32ByUint16 = Shift32ByUint8Shift64ByUint16 = Shift64ByUint8// ShiftNByUint32 - shifting an N bit value by a uint32Shift8ByUint32 = Shift8ByUint8Shift16ByUint32 = Shift16ByUint8Shift32ByUint32 = Shift32ByUint8Shift64ByUint32 = Shift64ByUint8// ShiftNByUint64 - shifting an N bit value by a uint64Shift8ByUint64 = Shift8ByUint8Shift16ByUint64 = Shift16ByUint8Shift32ByUint64 = Shift32ByUint8Shift64ByUint64 = Shift64ByUint8// ShiftNByUint - shifting an N bit value by a uintShift8ByUint = Shift8ByUint8Shift16ByUint = Shift16ByUint8Shift32ByUint = Shift32ByUint8Shift64ByUint = Shift64ByUint8)
![]() |
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |