go-randomx/fpu/round_amd64.go
DataHoarder b207b994b3
All checks were successful
continuous-integration/drone/push Build is passing
Working RandomX with minimal assembly for rounding mode (AMD64,ARM64)
2024-04-11 08:46:34 +02:00

18 lines
364 B
Go

//go:build amd64
// +build amd64
package fpu
// stmxcsr reads the MXCSR control and status register.
func stmxcsr(addr *uint32)
// ldmxcsr writes to the MXCSR control and status register.
func ldmxcsr(addr *uint32)
func setRoundingMode(mode uint8) {
var csr uint32
stmxcsr(&csr)
csr = (csr & (^uint32(0x6000))) | ((uint32(mode) & 3) << 13)
ldmxcsr(&csr)
}