aboutsummaryrefslogtreecommitdiff
path: root/src/math
diff options
context:
space:
mode:
authorRuixin(Peter) Bao <ruixin.bao@ibm.com>2020-04-27 09:51:01 -0400
committerMichael Munday <mike.munday@ibm.com>2020-04-27 20:20:53 +0000
commita7e9e84716e2d39b1e7ea7f231334c88f2428260 (patch)
treed8bde93146838d708ea629bc51d1ed9b0972d1c3 /src/math
parentd2f5e4e38c8f3d847a1925344dadbf8fb8cdb180 (diff)
downloadgo-a7e9e84716e2d39b1e7ea7f231334c88f2428260.tar.gz
go-a7e9e84716e2d39b1e7ea7f231334c88f2428260.zip
math/big: 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: Ic1dae851982532bcfd9a9453416c112347f21d87 Reviewed-on: https://go-review.googlesource.com/c/go/+/230318 Reviewed-by: Michael Munday <mike.munday@ibm.com> Run-TryBot: Michael Munday <mike.munday@ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/math')
-rw-r--r--src/math/big/arith_decl_s390x.go5
-rw-r--r--src/math/big/arith_s390x.s22
2 files changed, 3 insertions, 24 deletions
diff --git a/src/math/big/arith_decl_s390x.go b/src/math/big/arith_decl_s390x.go
index 5973d3cfc1..f1a69e1df0 100644
--- a/src/math/big/arith_decl_s390x.go
+++ b/src/math/big/arith_decl_s390x.go
@@ -6,12 +6,13 @@
package big
+import "internal/cpu"
+
func addVV_check(z, x, y []Word) (c Word)
func addVV_vec(z, x, y []Word) (c Word)
func addVV_novec(z, x, y []Word) (c Word)
func subVV_check(z, x, y []Word) (c Word)
func subVV_vec(z, x, y []Word) (c Word)
func subVV_novec(z, x, y []Word) (c Word)
-func hasVectorFacility() bool
-var hasVX = hasVectorFacility()
+var hasVX = cpu.S390X.HasVX
diff --git a/src/math/big/arith_s390x.s b/src/math/big/arith_s390x.s
index ef0192224f..4891768111 100644
--- a/src/math/big/arith_s390x.s
+++ b/src/math/big/arith_s390x.s
@@ -9,28 +9,6 @@
// This file provides fast assembly versions for the elementary
// arithmetic operations on vectors implemented in arith.go.
-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 ·mulWW(SB), NOSPLIT, $0
MOVD x+0(FP), R3
MOVD y+8(FP), R4