go/src/cmd/compile/internal/ssa/magic.go

// umagicOK reports whether we should strength reduce a n-bit divide by c.
func umagicOK(n uint, c int64) bool {}

// umagicOKn reports whether we should strength reduce an unsigned n-bit divide by c.
// We can strength reduce when c != 0 and c is not a power of two.
func umagicOK8(c int8) bool   {}

func umagicOK16(c int16) bool {}

func umagicOK32(c int32) bool {}

func umagicOK64(c int64) bool {}

type umagicData

// umagic computes the constants needed to strength reduce unsigned n-bit divides by the constant uint64(c).
// The return values satisfy for all 0 <= x < 2^n
//
//	floor(x / uint64(c)) = x * (m + 2^n) >> (n+s)
func umagic(n uint, c int64) umagicData {}

func umagic8(c int8) umagicData   {}

func umagic16(c int16) umagicData {}

func umagic32(c int32) umagicData {}

func umagic64(c int64) umagicData {}

func smagicOK(n uint, c int64) bool {}

// smagicOKn reports whether we should strength reduce a signed n-bit divide by c.
func smagicOK8(c int8) bool   {}

func smagicOK16(c int16) bool {}

func smagicOK32(c int32) bool {}

func smagicOK64(c int64) bool {}

type smagicData

// smagic computes the constants needed to strength reduce signed n-bit divides by the constant c.
// Must have c>0.
// The return values satisfy for all -2^(n-1) <= x < 2^(n-1)
//
//	trunc(x / c) = x * m >> (n+s) + (x < 0 ? 1 : 0)
func smagic(n uint, c int64) smagicData {}

func smagic8(c int8) smagicData   {}

func smagic16(c int16) smagicData {}

func smagic32(c int32) smagicData {}

func smagic64(c int64) smagicData {}

// udivisibleOK reports whether we should strength reduce an unsigned n-bit divisibility check by c.
func udivisibleOK(n uint, c int64) bool {}

func udivisibleOK8(c int8) bool   {}

func udivisibleOK16(c int16) bool {}

func udivisibleOK32(c int32) bool {}

func udivisibleOK64(c int64) bool {}

type udivisibleData

func udivisible(n uint, c int64) udivisibleData {}

func udivisible8(c int8) udivisibleData   {}

func udivisible16(c int16) udivisibleData {}

func udivisible32(c int32) udivisibleData {}

func udivisible64(c int64) udivisibleData {}

// sdivisibleOK reports whether we should strength reduce a signed n-bit divisibility check by c.
func sdivisibleOK(n uint, c int64) bool {}

func sdivisibleOK8(c int8) bool   {}

func sdivisibleOK16(c int16) bool {}

func sdivisibleOK32(c int32) bool {}

func sdivisibleOK64(c int64) bool {}

type sdivisibleData

func sdivisible(n uint, c int64) sdivisibleData {}

func sdivisible8(c int8) sdivisibleData   {}

func sdivisible16(c int16) sdivisibleData {}

func sdivisible32(c int32) sdivisibleData {}

func sdivisible64(c int64) sdivisibleData {}