Documentation ¶
Overview ¶
Package mp provides multi-precision operations for arithmetic programs.
Index ¶
- func Add(ctx *build.Context, x, y ir.Int) ir.Int
- func AddFull(ctx *build.Context, x, y ir.Int) ir.Int
- func AddInto(ctx *build.Context, z, x, y ir.Int, c ir.Register)
- func ConditionalMove(ctx *build.Context, dst, src ir.Int, f ir.Operand, eq ir.Flag)
- func MulInto(ctx *build.Context, z, x, y ir.Int)
- func SubInto(ctx *build.Context, z, x, y ir.Int, b ir.Register)
- type Accumulator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFull ¶
AddFull adds x and y, returning an integer with one more limb than the larger of x and y.
func ConditionalMove ¶
ConditionalMove moves src to dst if f≡eq.
Types ¶
type Accumulator ¶
type Accumulator struct {
// contains filtered or unexported fields
}
func NewAccumulator ¶
func NewAccumulator(ctx *build.Context, dst ir.Int) *Accumulator
func (*Accumulator) AddAt ¶
func (a *Accumulator) AddAt(y ir.Int, i int)
AddAt adds a into the accumulator starting at limb i. Assumes the maximum possible value of y.
func (*Accumulator) AddAtMax ¶
AddAtMax adds a into the accumulator starting at limb i, assuming that the registers have maximum value max.
func (*Accumulator) AddProduct ¶
func (a *Accumulator) AddProduct(hi, lo ir.Operand, i int)
AddProduct is a convenience for adding the high and low parts of a product into the accumulator.
func (*Accumulator) Flush ¶
func (a *Accumulator) Flush()
func (*Accumulator) Int ¶
func (a *Accumulator) Int() ir.Int
Int returns the value in the accumulator.
Click to show internal directories.
Click to hide internal directories.