mirror of
https://github.com/golang/go.git
synced 2025-05-20 06:43:26 +00:00
math: simplify hasVX checking on s390x
Originally, we use an assembly function that returns a boolean result to tell whether the machine has vector facility or not. It is now no longer needed when we can directly use cpu.S390X.HasVX variable. Change-Id: Ic3ffeb9e63238ef41406d97cdc42502145ddb454 Reviewed-on: https://go-review.googlesource.com/c/go/+/230319 Reviewed-by: Michael Munday <mike.munday@ibm.com> Run-TryBot: Michael Munday <mike.munday@ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
a637ee1970
commit
d2f5e4e38c
@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
package math
|
package math
|
||||||
|
|
||||||
|
import "internal/cpu"
|
||||||
|
|
||||||
func log10TrampolineSetup(x float64) float64
|
func log10TrampolineSetup(x float64) float64
|
||||||
func log10Asm(x float64) float64
|
func log10Asm(x float64) float64
|
||||||
|
|
||||||
@ -70,8 +72,6 @@ func expm1Asm(x float64) float64
|
|||||||
func powTrampolineSetup(x, y float64) float64
|
func powTrampolineSetup(x, y float64) float64
|
||||||
func powAsm(x, y float64) float64
|
func powAsm(x, y float64) float64
|
||||||
|
|
||||||
// hasVectorFacility reports whether the machine has the z/Architecture
|
// hasVX reports whether the machine has the z/Architecture
|
||||||
// vector facility installed and enabled.
|
// vector facility installed and enabled.
|
||||||
func hasVectorFacility() bool
|
var hasVX = cpu.S390X.HasVX
|
||||||
|
|
||||||
var hasVX = hasVectorFacility()
|
|
||||||
|
@ -28,29 +28,6 @@ TEXT ·Mod(SB), NOSPLIT, $0
|
|||||||
TEXT ·Remainder(SB), NOSPLIT, $0
|
TEXT ·Remainder(SB), NOSPLIT, $0
|
||||||
BR ·remainder(SB)
|
BR ·remainder(SB)
|
||||||
|
|
||||||
// if go assembly use vector instruction
|
|
||||||
TEXT ·hasVectorFacility(SB), NOSPLIT, $24-1
|
|
||||||
MOVD $x-24(SP), R1
|
|
||||||
XC $24, 0(R1), 0(R1) // clear the storage
|
|
||||||
MOVD $2, R0 // R0 is the number of double words stored -1
|
|
||||||
WORD $0xB2B01000 // STFLE 0(R1)
|
|
||||||
XOR R0, R0 // reset the value of R0
|
|
||||||
MOVBZ z-8(SP), R1
|
|
||||||
AND $0x40, R1
|
|
||||||
BEQ novector
|
|
||||||
|
|
||||||
vectorinstalled:
|
|
||||||
// check if the vector instruction has been enabled
|
|
||||||
VLEIB $0, $0xF, V16
|
|
||||||
VLGVB $0, V16, R1
|
|
||||||
CMPBNE R1, $0xF, novector
|
|
||||||
MOVB $1, ret+0(FP) // have vx
|
|
||||||
RET
|
|
||||||
|
|
||||||
novector:
|
|
||||||
MOVB $0, ret+0(FP) // no vx
|
|
||||||
RET
|
|
||||||
|
|
||||||
TEXT ·Log10(SB), NOSPLIT, $0
|
TEXT ·Log10(SB), NOSPLIT, $0
|
||||||
MOVD ·log10vectorfacility+0x00(SB), R1
|
MOVD ·log10vectorfacility+0x00(SB), R1
|
||||||
BR (R1)
|
BR (R1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user