Documentation ¶
Overview ¶
Package ir defines an intermediate representation for multi-precision arithmetic.
Index ¶
- Variables
- func FormatInstruction(i Instruction) string
- type ADD
- type CMOV
- type Constant
- type Constants
- type Flag
- type Function
- type Instruction
- type Int
- type Integer
- type MOV
- type MUL
- type Module
- type Operand
- type Operands
- type Program
- type Register
- type Registers
- type SHL
- type SHR
- type SUB
- type Section
- type Signature
- type Type
- type Var
Constants ¶
This section is empty.
Variables ¶
var Discard = Register("_")
Discard is a special register to ignore an output of an instruction.
var Zero = Constant(0)
Zero is the zero constant.
Functions ¶
func FormatInstruction ¶
func FormatInstruction(i Instruction) string
FormatInstruction returns a string representation of the instruction.
Types ¶
type Constants ¶
type Constants []Constant
Constants is a multi-precision integer formed of constants.
func NewConstantsFromInt ¶
NewConstantsFromInt represents x as s-bit integers.
type Instruction ¶
type Instruction interface { Operands() []Operand // contains filtered or unexported methods }
Instruction in the intermediate representation.
type Integer ¶
type Integer struct {
K uint // number of limbs
}
Integer is a multi-precision integer type.
type Operands ¶
type Operands []Operand
Operands is a multi-precision integer formed of operands.
type Program ¶
type Program struct {
Instructions []Instruction
}
Program is a sequence of instructions.
type Register ¶
type Register string
Register is a machine word operand.
func SelectRegisters ¶
SelectRegisters selects the registers from the list of operands.
type Registers ¶
type Registers []Register
Registers is a multi-precision integer formed of registers.