fpu

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FPException

type FPException int
const (
	FPExc_InvalidOp FPException = iota
	FPExc_DivideByZero
	FPExc_Overflow
	FPExc_Underflow
	FPExc_Inexact
	FPExc_InputDenorm
)

type FPRounding

type FPRounding byte
const (
	FPRoundNearest FPRounding = 0b00
	FPRoundPlusInf FPRounding = 0b01
	FPRoundNegInf  FPRounding = 0b10
	FPRoundZero    FPRounding = 0b11
)

List of valid rounding methods for FPU

type FPSCR

type FPSCR struct {
	// contains filtered or unexported fields
}

func (*FPSCR) AHP

func (fpscr *FPSCR) AHP() bool

func (*FPSCR) C

func (fpscr *FPSCR) C() bool

func (*FPSCR) DN

func (fpscr *FPSCR) DN() bool

func (*FPSCR) FZ

func (fpscr *FPSCR) FZ() bool

func (*FPSCR) N

func (fpscr *FPSCR) N() bool

func (*FPSCR) RMode

func (fpscr *FPSCR) RMode() FPRounding

func (*FPSCR) SetAHP

func (fpscr *FPSCR) SetAHP(set bool)

func (*FPSCR) SetC

func (fpscr *FPSCR) SetC(set bool)

func (*FPSCR) SetDN

func (fpscr *FPSCR) SetDN(set bool)

func (*FPSCR) SetFZ

func (fpscr *FPSCR) SetFZ(set bool)

func (*FPSCR) SetN

func (fpscr *FPSCR) SetN(set bool)

func (*FPSCR) SetNZCV

func (fpscr *FPSCR) SetNZCV(nzcv uint8)

SetNZCV sets all four basic status registers at once. The upper four bits of the nzcv parameter are ignored

func (*FPSCR) SetRMode

func (fpscr *FPSCR) SetRMode(mode FPRounding)

func (*FPSCR) SetUFC

func (fpscr *FPSCR) SetUFC(set bool)

func (*FPSCR) SetV

func (fpscr *FPSCR) SetV(set bool)

func (*FPSCR) SetZ

func (fpscr *FPSCR) SetZ(set bool)

func (*FPSCR) UFC

func (fpscr *FPSCR) UFC() bool

func (*FPSCR) V

func (fpscr *FPSCR) V() bool

func (*FPSCR) Value

func (fpscr *FPSCR) Value() uint32

func (*FPSCR) Z

func (fpscr *FPSCR) Z() bool

type FPType

type FPType int
const (
	FPType_Nonzero FPType = iota
	FPType_Zero
	FPType_Infinity
	FPType_QNaN
	FPType_SNaN
)

type FPU

type FPU struct {
	Registers [32]uint32
	Status    FPSCR
}

func (*FPU) FPAbs

func (fpu *FPU) FPAbs(value uint64, N int) uint64

func (*FPU) FPAdd

func (fpu *FPU) FPAdd(op1 uint64, op2 uint64, N int, fpscrControlled bool) uint64

func (*FPU) FPCompare

func (fpu *FPU) FPCompare(op1 uint64, op2 uint64, N int, quietNaNexc bool, fpscrControlled bool)

func (*FPU) FPDefaultNaN

func (fpu *FPU) FPDefaultNaN(N int) uint64

func (*FPU) FPDiv

func (fpu *FPU) FPDiv(op1 uint64, op2 uint64, N int, fpscrControlled bool) uint64

func (*FPU) FPInfinity

func (fpu *FPU) FPInfinity(sign bool, N int) uint64

func (*FPU) FPMaxNormal

func (fpu *FPU) FPMaxNormal(sign bool, N int) uint64

func (*FPU) FPMul

func (fpu *FPU) FPMul(op1 uint64, op2 uint64, N int, fpscrControlled bool) uint64

func (*FPU) FPMulAdd

func (fpu *FPU) FPMulAdd(addend uint64, op1 uint64, op2 uint64, N int, fpscrControlled bool) uint64

func (*FPU) FPNeg

func (fpu *FPU) FPNeg(value uint64, N int) uint64

func (*FPU) FPProcessException

func (fpu *FPU) FPProcessException(exception FPException, fpscr FPSCR)

func (*FPU) FPProcessNaN

func (fpu *FPU) FPProcessNaN(typ FPType, N int, op uint64, fpscr FPSCR) uint64

func (*FPU) FPProcessNaNs

func (fpu *FPU) FPProcessNaNs(typ1 FPType, typ2 FPType, N int, op1 uint64, op2 uint64, fpscr FPSCR) (bool, uint64)

func (*FPU) FPProcessNaNs3

func (fpu *FPU) FPProcessNaNs3(typ1 FPType, typ2 FPType, typ3 FPType, N int,
	op1 uint64, op2 uint64, op3 uint64, fpscr FPSCR) (bool, uint64)

func (*FPU) FPRound

func (fpu *FPU) FPRound(value float64, N int, fpscr FPSCR) uint64

func (*FPU) FPSub

func (fpu *FPU) FPSub(op1 uint64, op2 uint64, N int, fpscrControlled bool) uint64

func (*FPU) FPToFixed

func (fpu *FPU) FPToFixed(operand uint64, N int, fractionBits int, unsigned bool, roundZero bool, fpscrControlled bool) uint64

func (*FPU) FPUnpack

func (fpu *FPU) FPUnpack(fpval uint64, N int, fpscr FPSCR) (FPType, bool, float64)

func (*FPU) FPZero

func (fpu *FPU) FPZero(sign bool, N int) uint64

func (*FPU) FixedToFP

func (fpu *FPU) FixedToFP(operand uint64, N int, fractionBits int, unsigned bool, nearest bool, fpscrControlled bool) uint64

func (*FPU) SignedSatQ

func (fpu *FPU) SignedSatQ(i int, N int) (uint64, bool)

func (*FPU) StandardFPSCRValue

func (fpu *FPU) StandardFPSCRValue() FPSCR

func (*FPU) UnsignedSatQ

func (fpu *FPU) UnsignedSatQ(i int, N int) (uint64, bool)

func (*FPU) VFPExpandImm

func (fpu *FPU) VFPExpandImm(imm8 uint8, N int) uint64

type VFPNegMul

type VFPNegMul int

The VNMLA, VNMLS, VNMUL group of FPU instructions use this to control operation

const (
	VFPNegMul_VNMLA VFPNegMul = iota
	VFPNegMul_VNMLS
	VFPNegMul_VNMNUL
)

Jump to

Keyboard shortcuts

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