]> Cypherpunks repositories - gostls13.git/commitdiff
math/big: simplify hasVX checking on s390x
authorRuixin(Peter) Bao <ruixin.bao@ibm.com>
Mon, 27 Apr 2020 13:51:01 +0000 (09:51 -0400)
committerMichael Munday <mike.munday@ibm.com>
Mon, 27 Apr 2020 20:20:53 +0000 (20:20 +0000)
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>

src/math/big/arith_decl_s390x.go
src/math/big/arith_s390x.s

index 5973d3cfc1c5696f9e979ca26748e29b06ac4b5d..f1a69e1df0800f07020c131e2674bcaf4231052d 100644 (file)
@@ -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
index ef0192224fe80e7d7b873570f344666da27e42b3..48917681112a981b9685dba693e62a943c26e843 100644 (file)
@@ -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