gen

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2018 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Masks are 16-byte aligned for x86-64 SSE.
	ROMask7fAddr32 = iota * 16
	ROMask7fAddr64
	ROMask80Addr32
	ROMask80Addr64
	ROMask5f00Addr32 // 01011111000000000000000000000000
	ROMask43e0Addr64 // 0100001111100000000000000000000000000000000000000000000000000000
	ROTableAddr
)
View Source
const (
	WordSize     = 8              // stack entry size
	StackReserve = WordSize + 128 // trap/import call return address + red zone
)
View Source
const (
	Mask7fBase    = MaskBaseAddr(ROMask7fAddr32)
	Mask80Base    = MaskBaseAddr(ROMask80Addr32)
	MaskTruncBase = MaskBaseAddr(ROMask5f00Addr32)
)
View Source
const (
	RegCategoryInt   = RegCategory(0)
	RegCategoryFloat = RegCategory(1)
)

Variables

This section is empty.

Functions

func MaskAddr

func MaskAddr(roDataAddr int32, maskBaseAddr MaskBaseAddr, t abi.Type) int32

MaskAddr calculates the absolute read-only data address for reading a mask for the given type size. maskBaseAddr should be one of the Mask*Base constants.

func PutInt16 added in v0.3.0

func PutInt16(code Buffer, value int16)

func PutInt32 added in v0.3.0

func PutInt32(code Buffer, value int32)

func PutInt64 added in v0.3.0

func PutInt64(code Buffer, value int64)

func PutInt8 added in v0.3.0

func PutInt8(code Buffer, value int8)

func RegCategoryInvalid

func RegCategoryInvalid(cat RegCategory) bool

func RegCategoryMask

func RegCategoryMask(cat RegCategory, callRegs *[]regs.R, available ...bool) (mask uint64)

func RegMask

func RegMask(intMask, floatMask uint64) uint64

Types

type Buffer added in v0.3.0

type Buffer interface {
	Bytes() []byte
	Pos() int32
	Extend(n int) []byte
	PutByte(byte)
	PutBytes([]byte)
}

type Coder

type Coder interface {
	Buffer

	MinMemorySize() int
	RODataAddr() int32
	TrapTrampolineAddr(id trap.Id) int32
	OpTrapCall(id trap.Id)

	Discard(values.Operand)
	Consumed(values.Operand)
	RegAllocated(abi.Type, regs.R) bool
	FreeReg(abi.Type, regs.R)
}

type MaskBaseAddr

type MaskBaseAddr int32

type RegCategory

type RegCategory uint8

func TypeRegCategory

func TypeRegCategory(t abi.Type) RegCategory

func (RegCategory) String

func (cat RegCategory) String() string

type RegCoder

type RegCoder interface {
	Coder

	TryAllocReg(t abi.Type) (reg regs.R, ok bool)
	AllocSpecificReg(t abi.Type, reg regs.R)
}

Jump to

Keyboard shortcuts

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