DataHoarder
b207b994b3
All checks were successful
continuous-integration/drone/push Build is passing
25 lines
415 B
Go
25 lines
415 B
Go
//go:build arm64
|
|
// +build arm64
|
|
|
|
package fpu
|
|
|
|
// 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)
|
|
}
|