amd64

package
v0.0.0-...-783462d Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

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 Generate

func Generate(w io.Writer, F *field.FieldConfig) error

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

func GenerateMul

func GenerateMul(w io.Writer, F *field.FieldConfig) error

func GenerateMulADX

func GenerateMulADX(w io.Writer, F *field.FieldConfig) error

Types

type FFAmd64

type FFAmd64 struct {
	*field.FieldConfig
	*amd64.Amd64
	// contains filtered or unexported fields
}

func NewFFAmd64

func NewFFAmd64(w io.Writer, F *field.FieldConfig) *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) GenerateDefines

func (f *FFAmd64) GenerateDefines()

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