amd64

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

Package amd64 contains syntactic sugar to generate amd64 assembly code

Index

Constants

View Source
const SmallModulus = 6

Variables

This section is empty.

Functions

func ElementASMFileName added in v0.15.0

func ElementASMFileName(nbWords, nbBits int) string

func GenerateCommonASM added in v0.15.0

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

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

func GenerateF31ASM added in v0.15.0

func GenerateF31ASM(f *FFAmd64, hasVector bool) 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 added in v0.15.0

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

func (*FFAmd64) DefineFn added in v0.15.0

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

func (*FFAmd64) GenerateReduceDefine added in v0.15.0

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