Documentation
¶
Overview ¶
Package ref is the portable Go reference implementation of every kernel.
It defines the semantics. Every generated backend is differential-tested against it, and it is also the live fallback: the dispatcher runs these functions on architectures with no backend, in builds made with the purego tag, and below the per-kernel element threshold where crossing into assembly costs more than it saves.
It is therefore not throwaway code. The loops are written for bounds-check elimination because they run in the small-n hot path.
The numerical contract these functions define is documented on package kernel. The parts that are easy to get wrong:
- Floating-point reductions use exactly kernel.SumLanes accumulators and kernel.CombineTree, so every vector width reproduces them bit for bit.
- Dot multiplies and adds with separate roundings; it does not fuse.
- Minimum, Maximum, Min and Max implement IEEE-754-2019 minimum/maximum: NaN propagates, and +0 compares greater than -0.
- Integer Abs and Neg wrap, so Abs(MinInt32) is MinInt32, matching PABSD.
Index ¶
- func AbsFloat[T Float](dst, a []T)
- func AbsInt[T Integer](dst, a []T)
- func Acos[T float](dst, a []T)
- func Acosh[T float](dst, a []T)
- func Add[T Number](dst, a, b []T)
- func Add3[T Number](dst, a, b, c []T)
- func Add4[T Number](dst, a, b, c, d []T)
- func AddScalar[T Number](dst, a []T, s T)
- func AddScaled[T Number](dst, a, b []T, s T)
- func ArgMaxFloat[T Float](a []T) int
- func ArgMaxInt[T Integer](a []T) int
- func ArgMinFloat[T Float](a []T) int
- func ArgMinInt[T Integer](a []T) int
- func Asin[T float](dst, a []T)
- func Asinh[T float](dst, a []T)
- func Atan[T float](dst, a []T)
- func Atan2[T float](dst, a, b []T)
- func Atanh[T float](dst, a []T)
- func B64Decode(dst, src []byte) int
- func B64Encode(dst, src []byte) int
- func BF16ToF32(dst []float32, a []uint16)
- func BitAnd(dst, a, b []byte)
- func BitAndNot(dst, a, b []byte)
- func BitNot(dst, a []byte)
- func BitOr(dst, a, b []byte)
- func BitPackU32(dst, a []uint32, bits int32)
- func BitUnpackU32(dst, a []uint32, bits int32)
- func BitXor(dst, a, b []byte)
- func ByteSwap[T Integer](dst, a []T)
- func CAbs64(dst []float32, a []complex64)
- func CAbs128(dst []float64, a []complex128)
- func CAdd[C complexT](dst, a, b []C)
- func CConj64(dst, a []complex64)
- func CConj128(dst, a []complex128)
- func CDiv64(dst, a, b []complex64)
- func CDiv128(dst, a, b []complex128)
- func CDot64(a, b []complex64) complex64
- func CDot128(a, b []complex128) complex128
- func CDotConj64(a, b []complex64) complex64
- func CDotConj128(a, b []complex128) complex128
- func CFromParts64(dst []complex64, re, im []float32)
- func CFromParts128(dst []complex128, re, im []float64)
- func CImag64(dst []float32, a []complex64)
- func CImag128(dst []float64, a []complex128)
- func CMul64(dst, a, b []complex64)
- func CMul128(dst, a, b []complex128)
- func CNeg[C complexT](dst, a []C)
- func CReal64(dst []float32, a []complex64)
- func CReal128(dst []float64, a []complex128)
- func CScale64(dst, a []complex64, s float32)
- func CScale128(dst, a []complex128, s float64)
- func CSub[C complexT](dst, a, b []C)
- func CSum64(a []complex64) complex64
- func CSum128(a []complex128) complex128
- func Cbrt[T float](dst, a []T)
- func Ceil[T Float](dst, a []T)
- func ClampFloat[T Float](dst, a []T, lo, hi T)
- func ClampInt[T Integer](dst, a []T, lo, hi T)
- func CommonPrefix(a, b []byte) int
- func CompareBytes(a, b []byte) int
- func Compress[T any](dst, src []T, keep []bool) int
- func CompressFloat32(dst, src []float32, keep []bool) int
- func CompressFloat64(dst, src []float64, keep []bool) int
- func CompressInt32(dst, src []int32, keep []bool) int
- func CompressInt64(dst, src []int64, keep []bool) int
- func Convolve[T Number](dst, sig, ker []T)
- func Correlate[T Number](dst, sig, ker []T)
- func Cos[T float](dst, a []T)
- func Cosh[T float](dst, a []T)
- func CountAny(b, chars []byte) int
- func CountByte(b []byte, c byte) int
- func CountSeq(haystack, needle []byte) int
- func CumMaxFloat[T Float](dst, a []T)
- func CumMaxInt[T Integer](dst, a []T)
- func CumMinFloat[T Float](dst, a []T)
- func CumMinInt[T Integer](dst, a []T)
- func CumProdInt[T Integer](dst, a []T)
- func DequantizeI8(dst []float32, a []int8, scale float32, zeroPoint int32)
- func DequantizePerChannelI8(dst []float32, a []int8, scale []float32, zeroPoint []int32, ...)
- func DequantizePerChannelU8(dst []float32, a []uint8, scale []float32, zeroPoint []int32, ...)
- func DequantizeU8(dst []float32, a []uint8, scale float32, zeroPoint int32)
- func Diff[T Number](dst, a []T)
- func DifferenceInt[T Integer](dst, a, b []T) int
- func Div[T Float](dst, a, b []T)
- func DivScalar[T Number](dst, a []T, s T)
- func DotFloat[T Float](a, b []T) T
- func DotInt[T Integer](a, b []T) T
- func EqualBytes(a, b []byte) bool
- func EqualFoldASCII(a, b []byte) bool
- func EqualMask[T number](dst []bool, a, b []T)
- func EqualScalarMask[T number](dst []bool, a []T, v T)
- func Erf[T float](dst, a []T)
- func Erfc[T float](dst, a []T)
- func Exp[T float](dst, a []T)
- func Exp2[T float](dst, a []T)
- func Expand[T any](dst, src []T, keep []bool) int
- func Expm1[T float](dst, a []T)
- func F8E4M3ToF32(dst []float32, a []byte)
- func F8E5M2ToF32(dst []float32, a []byte)
- func F16ToF32(dst []float32, a []uint16)
- func F32ToBF16(dst []uint16, a []float32)
- func F32ToF8E4M3(dst []byte, a []float32)
- func F32ToF8E5M2(dst []byte, a []float32)
- func F32ToF16(dst []uint16, a []float32)
- func FastCumProdFloat[T Float](dst, a []T)
- func FastCumSumFloat[T Float](dst, a []T)
- func Fill[T Number](dst []T, v T)
- func FillBytes(dst []byte, v byte)
- func FillFastFallbacks(s *kernel.Set)
- func Floor[T Float](dst, a []T)
- func FormatInts(dst []byte, vals []int64, sep byte) int
- func Gather[T number](dst, src []T, idx []int32)
- func GemmPackB[T Number](bp, b []T, k, n int)
- func GemvFloat[T float](dst, a, x []T, m, k int)
- func GemvInt[T integer](dst, a, x []T, m, k int)
- func Grayscale(dst, r, g, b []byte)
- func GreaterEqualMask[T number](dst []bool, a, b []T)
- func GreaterEqualScalarMask[T number](dst []bool, a []T, v T)
- func GreaterMask[T number](dst []bool, a, b []T)
- func GreaterScalarMask[T number](dst []bool, a []T, v T)
- func Hamming(a, b []byte) int
- func HammingWords(a, b []uint64) int
- func HexDecode(dst, src []byte) (int, bool)
- func HexEncode(dst, src []byte) int
- func Hypot[T float](dst, a, b []T)
- func Index(haystack, needle []byte) int
- func IndexAll(dst []int32, b []byte, c byte) int
- func IndexAny(b, chars []byte) int
- func IndexByte(b []byte, c byte) int
- func IndexNonASCII(b []byte) int
- func IndexNonASCII16(b []uint16) int
- func IndexNotAny(b, chars []byte) int
- func IntersectInt[T Integer](dst, a, b []T) int
- func IsASCII(b []byte) bool
- func L1DiffFloat[T Float](a, b []T) T
- func L1DiffInt[T Integer](a, b []T) T
- func L1NormFloat[T Float](a []T) T
- func L1NormInt[T Integer](a []T) T
- func LastIndex(haystack, needle []byte) int
- func LastIndexByte(b []byte, c byte) int
- func LastIndexNotAny(b, chars []byte) int
- func LayerNorm[T float](dst, a, gamma, beta []T, shift, denom T)
- func LeadingZeros[T Integer](dst, a []T)
- func Lerp[T Number](dst, a, b []T, t T)
- func LessEqualMask[T number](dst []bool, a, b []T)
- func LessEqualScalarMask[T number](dst []bool, a []T, v T)
- func LessMask[T number](dst []bool, a, b []T)
- func LessScalarMask[T number](dst []bool, a []T, v T)
- func Log[T float](dst, a []T)
- func Log1p[T float](dst, a []T)
- func Log2[T float](dst, a []T)
- func Log10[T float](dst, a []T)
- func LowerBoundFloat[T Float](dst []int32, a, q []T)
- func LowerBoundInt[T Integer](dst []int32, a, q []T)
- func MaskAll(m []bool) bool
- func MaskAnd(dst, a, b []bool)
- func MaskAny(m []bool) bool
- func MaskCount(m []bool) int
- func MaskNot(dst, a []bool)
- func MaskOr(dst, a, b []bool)
- func MaskXor(dst, a, b []bool)
- func MatMul[T number](dst, a, b []T, m, k, n int)
- func MatMulPk[T Number](dst, a, bp []T, m, k, n int)
- func MaxReduceFloat[T Float](a []T) T
- func MaxReduceInt[T Integer](a []T) T
- func MaximumFloat[T Float](dst, a, b []T)
- func MaximumInt[T Integer](dst, a, b []T)
- func MinMaxFloat[T Float](a []T) (T, T)
- func MinMaxInt[T Integer](a []T) (T, T)
- func MinReduceFloat[T Float](a []T) T
- func MinReduceInt[T Integer](a []T) T
- func MinimumFloat[T Float](dst, a, b []T)
- func MinimumInt[T Integer](dst, a, b []T)
- func MovingAverage[T Number](dst, a []T, width int)
- func Mul[T Number](dst, a, b []T)
- func Mul3[T Number](dst, a, b, c []T)
- func Mul4[T Number](dst, a, b, c, d []T)
- func NarrowU16U8(dst []byte, s []uint16)
- func NarrowU32U8(dst []byte, s []uint32)
- func NegFloat[T Float](dst, a []T)
- func NegInt[T Integer](dst, a []T)
- func NormFloat[T Float](a []T) T
- func NotEqualMask[T number](dst []bool, a, b []T)
- func NotEqualScalarMask[T number](dst []bool, a []T, v T)
- func OnesCount[T Integer](dst, a []T)
- func ParseInts(dst []int64, src []byte, idx []int32) (int, bool)
- func ParseUints(dst []uint64, src []byte, idx []int32) (int, bool)
- func Partition[T Number](dst, src []T, pivot T) int
- func PolyEval[T Number](dst, x, coeffs []T)
- func PopCount(b []byte) int
- func Pow[T float](dst, a, b []T)
- func ProdInt[T Integer](a []T) T
- func QMatMulI8(dst []int32, a, b []int8, m, k, n int)
- func QuantizeI8(dst []int8, a []float32, scale float32, zeroPoint int32)
- func QuantizePerChannelI8(dst []int8, a []float32, scale []float32, zeroPoint []int32, ...)
- func QuantizePerChannelU8(dst []uint8, a []float32, scale []float32, zeroPoint []int32, ...)
- func QuantizeU8(dst []uint8, a []float32, scale float32, zeroPoint int32)
- func RGBToUV(u, v, r, g, b []byte)
- func Ramp[T Number](dst []T, start, step T)
- func RandomF32(dst []float32, seed uint64)
- func RandomF64(dst []float64, seed uint64)
- func RandomU64(dst []uint64, seed uint64)
- func Reciprocal[T Float](dst, a []T)
- func ReplaceByte(dst, b []byte, old, with byte)
- func RequantizeI8(dst []int8, a []int32, scale float32, zeroPoint int32)
- func Reverse[T Number](dst, a []T)
- func ReverseBits[T Integer](dst, a []T)
- func RollingMaxFloat[T Float](dst, a []T, window int)
- func RollingMaxInt[T Integer](dst, a []T, window int)
- func RollingMinFloat[T Float](dst, a []T, window int)
- func RollingMinInt[T Integer](dst, a []T, window int)
- func Rotl[T Integer](dst, a []T, s uint64)
- func Rotr[T Integer](dst, a []T, s uint64)
- func Round[T Float](dst, a []T)
- func RoundToEven[T Float](dst, a []T)
- func RunStartsI32(dst []bool, a []int32)
- func RunStartsI64(dst []bool, a []int64)
- func RunStartsU8(dst []bool, a []byte)
- func SatAdd[T Saturating](dst, a, b []T)
- func SatSub[T Saturating](dst, a, b []T)
- func Scale[T Number](dst, a []T, s T)
- func Scatter[T number](dst []T, idx []int32, src []T)
- func Select[T number](dst []T, mask []bool, yes, no []T)
- func Set() kernel.Set
- func ShiftDiv[T float](dst, a []T, shift, denom T)
- func Shl[T Integer](dst, a []T, s uint64)
- func Shr[T Integer](dst, a []T, s uint64)
- func Sigmoid[T float](dst, a []T)
- func Sin[T float](dst, a []T)
- func Sinh[T float](dst, a []T)
- func SortOrdered[T ordered](a []T)
- func SparseDotFloat[T Float](v []T, idx []int32, x []T) T
- func Sqrt[T Float](dst, a []T)
- func Sub[T Number](dst, a, b []T)
- func SubScalar[T Number](dst, a []T, s T)
- func SumFloat[T Float](a []T) T
- func SumInt[T Integer](a []T) T
- func SumLanesFloat[T float](dst, a []T)
- func SumSqDevFloat[T Float](a []T, c T) T
- func SumSqDevInt[T Integer](a []T, c T) T
- func SumSqDiffFloat[T Float](a, b []T) T
- func SumSqDiffInt[T Integer](a, b []T) T
- func SumSquaresFloat[T Float](a []T) T
- func SumSquaresInt[T Integer](a []T) T
- func Tan[T float](dst, a []T)
- func Tanh[T float](dst, a []T)
- func Tile[T number](dst, pattern []T)
- func ToLowerASCII(dst, b []byte)
- func ToUpperASCII(dst, b []byte)
- func TrailingZeros[T Integer](dst, a []T)
- func Transpose[T Number](dst, a []T, m, n int)
- func Trunc[T Float](dst, a []T)
- func ValidUTF8(b []byte) bool
- func VarintLenU32(dst []int32, a []uint32)
- func VarintLenU64(dst []int32, a []uint64)
- func VarintSizeU32(a []uint32) int
- func VarintSizeU64(a []uint64) int
- func WidenU8U16(dst []uint16, s []byte)
- func WidenU8U32(dst []uint32, s []byte)
- func ZigzagDecodeI8(dst []int8, a []byte)
- func ZigzagDecodeI16(dst []int16, a []uint16)
- func ZigzagDecodeI32(dst []int32, a []uint32)
- func ZigzagDecodeI64(dst []int64, a []uint64)
- func ZigzagEncodeI8(dst []byte, a []int8)
- func ZigzagEncodeI16(dst []uint16, a []int16)
- func ZigzagEncodeI32(dst []uint32, a []int32)
- func ZigzagEncodeI64(dst []uint64, a []int64)
- type Float
- type Integer
- type Number
- type Saturating
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArgMaxFloat ¶
func ArgMinFloat ¶
func BitPackU32 ¶
func BitUnpackU32 ¶
func CAbs128 ¶
func CAbs128(dst []float64, a []complex128)
func CConj128 ¶
func CConj128(dst, a []complex128)
func CDiv128 ¶
func CDiv128(dst, a, b []complex128)
func CDot128 ¶
func CDot128(a, b []complex128) complex128
func CDotConj64 ¶
func CDotConj128 ¶
func CDotConj128(a, b []complex128) complex128
func CFromParts64 ¶
func CFromParts128 ¶
func CFromParts128(dst []complex128, re, im []float64)
func CImag128 ¶
func CImag128(dst []float64, a []complex128)
func CMul128 ¶
func CMul128(dst, a, b []complex128)
func CReal128 ¶
func CReal128(dst []float64, a []complex128)
func CScale128 ¶
func CScale128(dst, a []complex128, s float64)
func CSum128 ¶
func CSum128(a []complex128) complex128
func ClampFloat ¶
func ClampFloat[T Float](dst, a []T, lo, hi T)
func CommonPrefix ¶
func CompareBytes ¶
func CompressFloat32 ¶
func CompressFloat64 ¶
func CompressInt32 ¶
func CompressInt64 ¶
func CumMaxFloat ¶
func CumMaxFloat[T Float](dst, a []T)
func CumMinFloat ¶
func CumMinFloat[T Float](dst, a []T)
func CumProdInt ¶
func CumProdInt[T Integer](dst, a []T)
CumProdInt is the EXACT integer product scan. Two's-complement multiplication is associative, so the blocked grouping is bit-identical to the serial loop for every input including ones that overflow — verified over four million deliberately overflowing values. It therefore needs no Fast prefix, and this is the reference the int32 kernel falls back to.
It is written as the blocked scan rather than as the obvious serial loop so that reference and kernel have the same shape, and a change to one is visibly a change to the other.
func DequantizePerChannelI8 ¶
func DequantizePerChannelU8 ¶
func DifferenceInt ¶
func EqualBytes ¶
func EqualFoldASCII ¶
func EqualScalarMask ¶
func EqualScalarMask[T number](dst []bool, a []T, v T)
func F8E4M3ToF32 ¶
func F8E5M2ToF32 ¶
func F32ToF8E4M3 ¶
func F32ToF8E5M2 ¶
func FastCumProdFloat ¶
func FastCumProdFloat[T Float](dst, a []T)
func FastCumSumFloat ¶
func FastCumSumFloat[T Float](dst, a []T)
FastCumSum and FastCumProd are the exported references the generated backends fall back to and the differential tests compare against.
FastCumSumFloat is the blocked scan for float32 and the SERIAL loop for float64, and that asymmetry is measured rather than arbitrary. Eight doubles fill one AVX-512 register, so the shift steps become cross-lane permutes, and against a serial chain of four-cycle adds the blocked form measured 0.91x — slower. float32 has sixteen lanes to hide the same latency and wins. Since no kernel is generated for float64, this branch is what every tier runs there, so they still agree with each other.
func FillFastFallbacks ¶
FillFastFallbacks points any Fast slot with no generated kernel at the accurate one, for both float groups of a backend.
It runs after a backend is fully assembled, which is the only moment the two cases can be distinguished, and it is what lets a caller use FastExp on every architecture without asking whether that architecture has it. A target where the Fast tier did not measure faster simply computes a more accurate answer, which an upper bound on error permits.
func FormatInts ¶
FormatInts is the reference formatter: exact-fit, so it succeeds wherever success is possible, which is what makes it the safe fallback for short destinations.
func GreaterEqualMask ¶
func GreaterEqualMask[T number](dst []bool, a, b []T)
func GreaterEqualScalarMask ¶
func GreaterEqualScalarMask[T number](dst []bool, a []T, v T)
func GreaterMask ¶
func GreaterMask[T number](dst []bool, a, b []T)
func GreaterScalarMask ¶
func GreaterScalarMask[T number](dst []bool, a []T, v T)
func HammingWords ¶
func HexDecode ¶
HexDecode is exported for the generated dispatch tables, which name the reference by its exported identifier. The two results are what kept this portable before the generator could return a pair.
func IndexNonASCII ¶
func IndexNonASCII16 ¶
func IndexNotAny ¶
func IntersectInt ¶
func L1DiffFloat ¶
func L1DiffFloat[T Float](a, b []T) T
func L1NormFloat ¶
func L1NormFloat[T Float](a []T) T
func LastIndexByte ¶
func LastIndexNotAny ¶
func LeadingZeros ¶
func LeadingZeros[T Integer](dst, a []T)
func LessEqualMask ¶
func LessEqualMask[T number](dst []bool, a, b []T)
func LessEqualScalarMask ¶
func LessEqualScalarMask[T number](dst []bool, a []T, v T)
func LessScalarMask ¶
func LessScalarMask[T number](dst []bool, a []T, v T)
func LowerBoundFloat ¶
func LowerBoundInt ¶
func MaxReduceFloat ¶
func MaxReduceFloat[T Float](a []T) T
func MaxReduceInt ¶
func MaxReduceInt[T Integer](a []T) T
func MaximumFloat ¶
func MaximumFloat[T Float](dst, a, b []T)
func MaximumInt ¶
func MaximumInt[T Integer](dst, a, b []T)
func MinMaxFloat ¶
func MinMaxFloat[T Float](a []T) (T, T)
func MinReduceFloat ¶
func MinReduceFloat[T Float](a []T) T
func MinReduceInt ¶
func MinReduceInt[T Integer](a []T) T
func MinimumFloat ¶
func MinimumFloat[T Float](dst, a, b []T)
func MinimumInt ¶
func MinimumInt[T Integer](dst, a, b []T)
func MovingAverage ¶
func NarrowU16U8 ¶
func NarrowU32U8 ¶
func NotEqualMask ¶
func NotEqualMask[T number](dst []bool, a, b []T)
func NotEqualScalarMask ¶
func NotEqualScalarMask[T number](dst []bool, a []T, v T)
func ParseInts ¶
ParseInts is the reference for the integer field parser. Fields are src[start:idx[k]] with start one past the previous separator, which is the shape IndexAll produces.
func ParseUints ¶
ParseUints is ParseInts over the full uint64 range and with no sign.
A leading '+' is rejected rather than skipped, matching strconv.ParseUint with bitSize 64, which accepts no sign at all.
func QuantizePerChannelI8 ¶
func QuantizePerChannelU8 ¶
func RandomF64 ¶
RandomF64 takes the top 53 bits and scales by 2^-53, the construction that cannot produce 1.0 — the largest result is 1 - 2^-53.
func Reciprocal ¶
func Reciprocal[T Float](dst, a []T)
func ReplaceByte ¶
func ReverseBits ¶
func ReverseBits[T Integer](dst, a []T)
func RollingMaxFloat ¶
func RollingMaxInt ¶
func RollingMinFloat ¶
func RollingMinInt ¶
func RoundToEven ¶
func RoundToEven[T Float](dst, a []T)
func RunStartsI32 ¶
func RunStartsI64 ¶
func RunStartsU8 ¶
func SatAdd ¶
func SatAdd[T Saturating](dst, a, b []T)
func SatSub ¶
func SatSub[T Saturating](dst, a, b []T)
func SortOrdered ¶
func SortOrdered[T ordered](a []T)
SortOrdered sorts in place with the standard library's pdqsort.
It is here as the reference and as the small-case path, and on integers it is also the shipped implementation: see the note on the exported Sort.
func SparseDotFloat ¶
func SumLanesFloat ¶
func SumLanesFloat[T float](dst, a []T)
func SumSqDevFloat ¶
func SumSqDevFloat[T Float](a []T, c T) T
func SumSqDevInt ¶
func SumSqDevInt[T Integer](a []T, c T) T
func SumSqDiffFloat ¶
func SumSqDiffFloat[T Float](a, b []T) T
func SumSqDiffInt ¶
func SumSqDiffInt[T Integer](a, b []T) T
func SumSquaresFloat ¶
func SumSquaresFloat[T Float](a []T) T
func SumSquaresInt ¶
func SumSquaresInt[T Integer](a []T) T
func ToLowerASCII ¶
func ToLowerASCII(dst, b []byte)
func ToUpperASCII ¶
func ToUpperASCII(dst, b []byte)
func TrailingZeros ¶
func TrailingZeros[T Integer](dst, a []T)
func VarintLenU32 ¶
func VarintLenU64 ¶
func VarintSizeU32 ¶
func VarintSizeU64 ¶
func WidenU8U16 ¶
func WidenU8U32 ¶
func ZigzagDecodeI8 ¶
func ZigzagDecodeI16 ¶
func ZigzagDecodeI32 ¶
func ZigzagDecodeI64 ¶
func ZigzagEncodeI8 ¶
func ZigzagEncodeI16 ¶
func ZigzagEncodeI32 ¶
func ZigzagEncodeI64 ¶
Types ¶
type Integer ¶
type Integer = integer
Integer is the integer half of it, for the operations that are not the same on floats: integer minimum is not IEEE minimum, and integer Abs wraps where float Abs clears a sign bit.
type Number ¶
type Number interface {
~float32 | ~float64 |
~int8 | ~int16 | ~int32 | ~int64 |
~uint8 | ~uint16 | ~uint32 | ~uint64
}
Number is any element type the kernels handle.
type Saturating ¶
type Saturating = satInteger
Saturating is the integer types that have saturating add and subtract. The 64-bit ones are absent for the reason kernels.saturating gives: there is nothing wider to detect the overflow in.