go-randomx/asm/round_arm64.go
DataHoarder aab8f99dd4
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
Include softfloat64 and allow for purego implementation
2024-04-17 06:04:29 +02:00

24 lines
410 B
Go

//go:build arm64 && !purego
package asm
// GetFPCR returns the value of FPCR register.
func getFPCR() (value uint32)
// SetFPCR writes the FPCR value.
func setFPCR(value uint32)
func setRoundingMode(mode uint8) {
switch mode {
// switch plus/minus infinity
case 1:
mode = 2
case 2:
mode = 1
}
fpcr := getFPCR()
fpcr = (fpcr & (^uint32(0x0C00000))) | ((uint32(mode) & 3) << 22)
setFPCR(fpcr)
}