arm64

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           = "arm64"

	// ArchId
	NOARCH = common.NOARCH
	ARM64  = common.ARM64

	// 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

	// Op1Misc
	ALLOC = common.ALLOC
	FREE  = common.FREE

	// Op2Misc
	PUSH = common.PUSH
	POP  = common.POP

	// 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
	// CMP  = common.CMP
	// XCHG = common.XCHG
	NEG2  = common.NEG2
	NOT2  = common.NOT2
	JMPIF = common.JMPIF

	// 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
)
View Source
const (

	// integer registers
	X0
	X1
	X2
	X3
	X4
	X5
	X6
	X7
	X8
	X9
	X10
	X11
	X12
	X13
	X14
	X15
	X16
	X17
	X18
	X19
	X20
	X21
	X22
	X23
	X24
	X25
	X26
	X27
	X28
	X29
	X30
	// depending on context, zero register or stack pointer
	XZR, XSP = RegId(ARM64-1)<<8 + iota, RegId(ARM64-1)<<8 + iota
	// floating-point registers
	D0 = RegId(ARM64-1)<<8 + iota
	D1
	D2
	D3
	D4
	D5
	D6
	D7
	D8
	D9
	D10
	D11
	D12
	D13
	D14
	D15
	D16
	D17
	D18
	D19
	D20
	D21
	D22
	D23
	D24
	D25
	D26
	D27
	D28
	D29
	D30
	D31
	RLo = X0
	RHi = D31
	// stack pointer
	RSP = XSP
	// suggested register to point to local variables
	RVAR = X29
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Arch

type Arch = common.Arch

type ArchId

type ArchId = common.ArchId

type Arg

type Arg = common.Arg

type Arm64

type Arm64 struct {
}

func (Arm64) Cast

func (arch Arm64) Cast(asm *Asm, src Arg, dst Arg)

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

func (Arm64) CodeString

func (Arm64) CodeString(code MachineCode) string

print arm64 machine code as sequence of 4-byte instructions

func (Arm64) Epilogue

func (arch Arm64) Epilogue(asm *Asm) *Asm

func (Arm64) Id

func (Arm64) Id() ArchId

implement Arch interface

func (Arm64) Init

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

func (Arm64) MemString

func (arch Arm64) MemString(m Mem) string

func (Arm64) Op0

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

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

func (Arm64) Op1

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

func (Arm64) Op2

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

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

func (Arm64) Op3

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

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

func (Arm64) Op4

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

func (Arm64) Prologue

func (Arm64) 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:

ldr x29, [sp, #8]

equivalent to: asm.Asm(MOV, MakeMem(8, XSP, Uint64), MakeReg(X29, Uint64))

func (Arm64) RegIdConfig

func (Arm64) RegIdConfig() RegIdConfig

func (Arm64) RegIdKind

func (Arm64) RegIdKind(id RegId) Kind

func (Arm64) RegIdString

func (Arm64) RegIdString(id RegId) string

func (Arm64) RegIdValid

func (Arm64) RegIdValid(id RegId) bool

func (Arm64) RegString

func (Arm64) RegString(r Reg) string

func (Arm64) RegValid

func (Arm64) RegValid(r Reg) bool

func (Arm64) String

func (Arm64) String() string

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 Immediate3

type Immediate3 uint8

style of immediate constants embeddable in a single Op3 instruction

const (
	Imm3None    Immediate3 = iota
	Imm3AddSub             // 12 bits wide, possibly shifted left by 12 bits
	Imm3Bitwise            // complicated
	Imm3Shift              // 0..63 for 64 bit registers; 0..31 for 32 bit registers
	Imm3Index              // 0..4095 index for GETIDX or SETIDX
)

func (Immediate3) Encode64

func (imm Immediate3) Encode64(val uint64, kind Kind) (e uint32, ok bool)

return false if val cannot be encoded using imm style

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
_go

Jump to

Keyboard shortcuts

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