amd64

package
v0.0.0-...-68aa4a9 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package amd64 contains syntactic sugar to generate amd64 assembly code

Index

Constants

View Source
const (
	ElementASMFileName = "element_%dw_amd64.s"
)
View Source
const SmallModulus = 6

Variables

This section is empty.

Functions

func GenerateCommonASM

func GenerateCommonASM(w io.Writer, nbWords int, hasVector bool) error

GenerateCommonASM generates assembly code for the base field provided to goff see internal/templates/ops*

func GenerateFieldWrapper

func GenerateFieldWrapper(w io.Writer, F *config.FieldConfig, asmDirBuildPath, asmDirIncludePath string) error

Types

type FFAmd64

type FFAmd64 struct {
	// *config.FieldConfig
	*amd64.Amd64

	NbWords              int
	NbWordsLastIndex     int
	NbWordsIndexesFull   []int
	NbWordsIndexesNoZero []int
	// contains filtered or unexported fields
}

func NewFFAmd64

func NewFFAmd64(w io.Writer, nbWords int) *FFAmd64

func (*FFAmd64) Add

func (f *FFAmd64) Add(i1, i2 interface{}, offsets ...int)

func (*FFAmd64) AssertCleanStack

func (f *FFAmd64) AssertCleanStack(reservedStackSize, minStackSize int)

func (*FFAmd64) Define

func (f *FFAmd64) Define(name string, nbInputs int, fn defineFn) defineFn

func (*FFAmd64) DefineFn

func (f *FFAmd64) DefineFn(name string) (fn defineFn, err error)

func (*FFAmd64) GenerateReduceDefine

func (f *FFAmd64) GenerateReduceDefine()

func (*FFAmd64) LabelRegisters

func (f *FFAmd64) LabelRegisters(name string, r ...amd64.Register)

LabelRegisters write comment with friendler name to registers

func (*FFAmd64) Mov

func (f *FFAmd64) Mov(i1, i2 interface{}, offsets ...int)

func (*FFAmd64) MulADX

func (f *FFAmd64) MulADX(registers *amd64.Registers, x, y func(int) string, t []amd64.Register) []amd64.Register

MulADX uses AX, DX and BP sets x * y into t, without modular reduction x() will have more accesses than y() (caller should store x in registers, if possible) if no (tmp) register is available, this uses one PUSH/POP on the stack in the hot loop.

func (*FFAmd64) Pop

func (f *FFAmd64) Pop(registers *amd64.Registers, forceStack ...bool) amd64.Register

func (*FFAmd64) PopN

func (f *FFAmd64) PopN(registers *amd64.Registers, forceStack ...bool) []amd64.Register

func (*FFAmd64) Push

func (f *FFAmd64) Push(registers *amd64.Registers, rIn ...amd64.Register)

func (*FFAmd64) Reduce

func (f *FFAmd64) Reduce(registers *amd64.Registers, t []amd64.Register)

Reduce scratch can be on the stack or a set of registers.

func (*FFAmd64) ReduceElement

func (f *FFAmd64) ReduceElement(t, scratch []amd64.Register)

func (*FFAmd64) StackSize

func (f *FFAmd64) StackSize(maxNbRegistersNeeded, nbRegistersReserved, minStackSize int) int

func (*FFAmd64) Sub

func (f *FFAmd64) Sub(i1, i2 interface{}, offsets ...int)

Jump to

Keyboard shortcuts

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