v0.0.0-...-3f1fa26 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2022 License: MIT Imports: 8 Imported by: 1




This section is empty.


This section is empty.


func ABI_Call_Setup

func ABI_Call_Setup(ctx *IR_Context, args []IRExpression, returnType Type) (lib.Instructions, map[lib.Operand]lib.Operand, []lib.Operand, error)

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


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 (x *X86_64) EncodeDataSection(stmts []IR, ctx *IR_Context) (*Segments, error)

func (*X86_64) EncodeExpression

func (x *X86_64) EncodeExpression(expr IRExpression, ctx *IR_Context, target lib.Operand) ([]lib.Instruction, error)

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL