amd64

package
v0.0.0-...-4cc5765 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2022 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MMAP_SUPPORTED = common.MMAP_SUPPORTED
	SUPPORTED      = MMAP_SUPPORTED
	NAME           = "amd64"

	// ArchId
	NOARCH = common.NOARCH
	AMD64  = common.AMD64

	// SaveSlot
	InvalidSlot = common.InvalidSlot

	// Kind
	Invalid = common.Invalid
	Bool    = common.Bool
	Int     = common.Int
	Int8    = common.Int8
	Int16   = common.Int16
	Int32   = common.Int32
	Int64   = common.Int64
	Uint    = common.Uint
	Uint8   = common.Uint8
	Uint16  = common.Uint16
	Uint32  = common.Uint32
	Uint64  = common.Uint64
	Uintptr = common.Uintptr
	Float32 = common.Float32
	Float64 = common.Float64
	Ptr     = common.Ptr
	KLo     = common.KLo
	KHi     = common.KHi

	// RegId
	NoRegId = common.NoRegId

	// SoftRegId
	FirstSoftRegId = common.FirstSoftRegId
	LastSoftRegId  = common.LastSoftRegId
	FirstTempRegId = common.FirstTempRegId
	LastTempRegId  = common.LastTempRegId

	// Op0
	BAD = common.BAD
	NOP = common.NOP
	RET = common.RET

	// Op1
	ZERO = common.ZERO
	INC  = common.INC
	DEC  = common.DEC
	NOT1 = common.NOT1
	NEG1 = common.NEG1
	JMP  = common.JMP

	// Op2
	ADD2     = common.ADD2
	SUB2     = common.SUB2
	ADC2     = common.ADC2
	SBB2     = common.SBB2
	MUL2     = common.MUL2
	DIV2     = common.DIV2
	REM2     = common.REM2
	AND2     = common.AND2
	OR2      = common.OR2
	XOR2     = common.XOR2
	SHL2     = common.SHL2
	SHR2     = common.SHR2
	AND_NOT2 = common.AND_NOT2
	LAND2    = common.LAND2
	LOR2     = common.LOR2
	MOV      = common.MOV
	CAST     = common.CAST
	LEA2     = common.LEA2
	// CMP  = common.CMP
	// XCHG = common.XCHG
	NEG2  = common.NEG2
	NOT2  = common.NOT2
	JMPIF = common.JMPIF

	// Op2Misc
	ALLOC = common.ALLOC
	FREE  = common.FREE
	PUSH  = common.PUSH
	POP   = common.POP

	// Op3
	ADD3     = common.ADD3
	SUB3     = common.SUB3
	ADC3     = common.ADC3
	SBB3     = common.SBB3
	MUL3     = common.MUL3
	DIV3     = common.DIV3
	REM3     = common.REM3
	AND3     = common.AND3
	OR3      = common.OR3
	XOR3     = common.XOR3
	SHL3     = common.SHL3
	SHR3     = common.SHR3
	AND_NOT3 = common.AND_NOT3
	LAND3    = common.LAND3
	LOR3     = common.LOR3
	GETIDX   = common.GETIDX
	SETIDX   = common.SETIDX

	// Op4
	LEA4 = common.LEA4
)
View Source
const (
	RAX
	RCX
	RDX
	RBX
	RSP
	RBP
	RSI
	RDI
	R8
	R9
	R10
	R11
	R12
	R13
	R14
	R15
	RLo RegId = RAX
	RHi RegId = R15
	// suggested register to point to local variables
	RVAR = RSI
)

============================================================================ register

Variables

This section is empty.

Functions

This section is empty.

Types

type Amd64

type Amd64 struct {
}

func (Amd64) CodeString

func (Amd64) CodeString(code MachineCode) string

func (Amd64) Epilogue

func (Amd64) Epilogue(asm *Asm) *Asm

func (Amd64) Id

func (Amd64) Id() ArchId

implement Arch interface

func (Amd64) Init

func (Amd64) Init(asm *Asm, start SaveSlot, end SaveSlot) *Asm

func (Amd64) MemString

func (arch Amd64) MemString(m Mem) string

func (Amd64) Op0

func (arch Amd64) Op0(asm *Asm, op Op0) *Asm

func (Amd64) Op1

func (arch Amd64) Op1(asm *Asm, op Op1, a Arg) *Asm

============================================================================

func (Amd64) Op2

func (arch Amd64) Op2(asm *Asm, op Op2, src Arg, dst Arg) *Asm

============================================================================ dst OP= src

func (Amd64) Op3

func (arch Amd64) Op3(asm *Asm, op Op3, a Arg, b Arg, dst Arg) *Asm

dst = a OP b

func (Amd64) Op4

func (arch Amd64) Op4(asm *Asm, op Op4, a Arg, b Arg, c Arg, dst Arg) *Asm

============================================================================

func (Amd64) Prologue

func (Amd64) Prologue(asm *Asm) *Asm

Prologue used to add the following instruction to generated code, but now it does nothing, because adding ANY code is the user's responsibility:

movq 0x8(%rsp), %rdi

equivalent to

asm.Asm(MOV, MakeMem(8, RSP, Uint64), MakeReg(RDI, Uint64))

func (Amd64) RegIdConfig

func (Amd64) RegIdConfig() RegIdConfig

func (Amd64) RegIdKind

func (Amd64) RegIdKind(id RegId) Kind

func (Amd64) RegIdString

func (Amd64) RegIdString(id RegId) string

func (Amd64) RegIdValid

func (Amd64) RegIdValid(id RegId) bool

func (Amd64) RegString

func (Amd64) RegString(r Reg) string

func (Amd64) RegValid

func (Amd64) RegValid(r Reg) bool

func (Amd64) String

func (Amd64) String() string

type Arch

type Arch = common.Arch

type ArchId

type ArchId = common.ArchId

type Arg

type Arg = common.Arg

type Asm

type Asm = common.Asm

func New

func New() *Asm

type AsmCode

type AsmCode = common.AsmCode // symbolic assembly code

type Const

type Const = common.Const

func ConstInt

func ConstInt(val int) Const

func ConstInt16

func ConstInt16(val int16) Const

func ConstInt32

func ConstInt32(val int32) Const

func ConstInt64

func ConstInt64(val int64) Const

func ConstInt8

func ConstInt8(val int8) Const

func ConstInterface

func ConstInterface(ival interface{}, t reflect.Type) (Const, error)

func ConstPointer

func ConstPointer(val *uint8) Const

guaranteed to work only if val points to non-Go memory, as for example C/C++ memory

func ConstUint

func ConstUint(val uint) Const

func ConstUint16

func ConstUint16(val uint16) Const

func ConstUint32

func ConstUint32(val uint32) Const

func ConstUint64

func ConstUint64(val uint64) Const

func ConstUint8

func ConstUint8(val uint8) Const

func ConstUintptr

func ConstUintptr(val uintptr) Const

func MakeConst

func MakeConst(val int64, kind Kind) Const

type Expr

type Expr = common.Expr

type Kind

type Kind = common.Kind

type MachineCode

type MachineCode = common.MachineCode // assembled machine code

type Mem

type Mem = common.Mem

func MakeMem

func MakeMem(off int32, id RegId, kind Kind) Mem

type Op0

type Op0 = common.Op0

type Op1

type Op1 = common.Op1

type Op1Misc

type Op1Misc = common.Op1Misc

type Op2

type Op2 = common.Op2

type Op2Misc

type Op2Misc = common.Op2Misc

type Op3

type Op3 = common.Op3

type Op4

type Op4 = common.Op4

type Reg

type Reg = common.Reg

func MakeReg

func MakeReg(id RegId, kind Kind) Reg

type RegId

type RegId = common.RegId

type RegIdConfig

type RegIdConfig = common.RegIdConfig

type RegIds

type RegIds = common.RegIds

type Save

type Save = common.Save

type SaveSlot

type SaveSlot = common.SaveSlot

type Size

type Size = common.Size

func SizeOf

func SizeOf(e Expr) Size

type SoftReg

type SoftReg = common.SoftReg

func MakeSoftReg

func MakeSoftReg(id SoftRegId, kind Kind) SoftReg

type SoftRegId

type SoftRegId = common.SoftRegId

type SoftRegs

type SoftRegs = common.SoftRegs

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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