go-randomx/fpu/round_amd64.go

18 lines
364 B
Go
Raw Normal View History

//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)
}