Documentation ¶
Index ¶
- func ABI_Call_Setup(ctx *IR_Context, args []IRExpression, returnType Type) (lib.Instructions, map[lib.Operand]lib.Operand, []lib.Operand, error)
- func PreserveRegisters(ctx *IR_Context, argTypes []Type, returnType Type) (lib.Instructions, map[lib.Operand]lib.Operand, []lib.Operand)
- func RestoreRegisters(ctx *IR_Context, clobbered []lib.Operand) lib.Instructions
- type ABI_AMDSystemV
- type X86_64
- func (x *X86_64) EncodeDataSection(stmts []IR, ctx *IR_Context) (*Segments, error)
- func (x *X86_64) EncodeExpression(expr IRExpression, ctx *IR_Context, target lib.Operand) ([]lib.Instruction, error)
- func (x *X86_64) EncodeStatement(stmt IR, ctx *IR_Context) ([]lib.Instruction, error)
- func (x *X86_64) GetAllocator() Allocator
- type X86_64_Allocator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ABI_Call_Setup ¶
func PreserveRegisters ¶
func PreserveRegisters(ctx *IR_Context, argTypes []Type, returnType Type) (lib.Instructions, map[lib.Operand]lib.Operand, []lib.Operand)
returns instructions and clobbered registers
func RestoreRegisters ¶
func RestoreRegisters(ctx *IR_Context, clobbered []lib.Operand) lib.Instructions
Types ¶
type ABI_AMDSystemV ¶
type ABI_AMDSystemV struct {
// contains filtered or unexported fields
}
The calling convention of the System V AMD64 ABI is followed on Solaris, Linux, FreeBSD, macOS, and is the de facto standard among Unix and Unix-like operating systems. The first six integer or pointer arguments are passed in registers RDI, RSI, RDX, RCX, R8, R9 (R10 is used as a static chain pointer in case of nested functions[25]:21), while XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6 and XMM7 are used for the first floating point arguments.
func NewABI_AMDSystemV ¶
func NewABI_AMDSystemV() *ABI_AMDSystemV
func (*ABI_AMDSystemV) GetRegistersForArgs ¶
func (a *ABI_AMDSystemV) GetRegistersForArgs(args []Type) []*encoding.Register
func (*ABI_AMDSystemV) ReturnTypeToOperand ¶
func (a *ABI_AMDSystemV) ReturnTypeToOperand(arg Type) lib.Operand
type X86_64 ¶
type X86_64 struct { }
func (*X86_64) EncodeDataSection ¶
func (*X86_64) EncodeExpression ¶
func (*X86_64) EncodeStatement ¶
func (x *X86_64) EncodeStatement(stmt IR, ctx *IR_Context) ([]lib.Instruction, error)
func (*X86_64) GetAllocator ¶
func (x *X86_64) GetAllocator() Allocator
type X86_64_Allocator ¶
type X86_64_Allocator struct { Registers []bool RegistersAllocated uint8 FloatRegisters []bool FloatRegistersAllocated uint8 }
func NewX86_64_Allocator ¶
func NewX86_64_Allocator() *X86_64_Allocator
func (*X86_64_Allocator) AllocateRegister ¶
func (i *X86_64_Allocator) AllocateRegister(typ Type) lib.Operand
func (*X86_64_Allocator) Copy ¶
func (i *X86_64_Allocator) Copy() Allocator
func (*X86_64_Allocator) DeallocateRegister ¶
func (i *X86_64_Allocator) DeallocateRegister(op lib.Operand)
Source Files ¶
- abi.go
- add.go
- and.go
- and_then.go
- array_assigment.go
- array_index.go
- assigment.go
- bool.go
- byte_array.go
- call.go
- cast.go
- compare.go
- conditional_jump.go
- div.go
- equals.go
- float64.go
- function.go
- function_def.go
- gt.go
- gte.go
- if.go
- int16.go
- int32.go
- int64.go
- int8.go
- lt.go
- lte.go
- mul.go
- not.go
- operator.go
- or.go
- return.go
- static_array.go
- struct.go
- struct_field.go
- sub.go
- syscall.go
- uint16.go
- uint32.go
- uint64.go
- uint8.go
- variable.go
- while.go
- x86_64.go
Click to show internal directories.
Click to hide internal directories.