diff options
author | Keith Randall <khr@google.com> | 2018-03-01 16:38:41 -0800 |
---|---|---|
committer | Keith Randall <khr@golang.org> | 2018-03-02 22:46:15 +0000 |
commit | 403ab0f2214f583db84a2dae275389be92072a35 (patch) | |
tree | 9ff2fc82235a27acd95595f2152f03eec83fa71e /src/runtime/os_linux_s390x.go | |
parent | dcedcaa5fb15748cc2e5cb9461fc6b4f4fc942cb (diff) | |
download | go-403ab0f2214f583db84a2dae275389be92072a35.tar.gz go-403ab0f2214f583db84a2dae275389be92072a35.zip |
internal/bytealg: move IndexByte asssembly to the new bytealg package
Move the IndexByte function from the runtime to a new bytealg package.
The new package will eventually hold all the optimized assembly for
groveling through byte slices and strings. It seems a better home for
this code than randomly keeping it in runtime.
Once this is in, the next step is to move the other functions
(Compare, Equal, ...).
Update #19792
This change seems complicated enough that we might just declare
"not worth it" and abandon. Opinions welcome.
The core assembly is all unchanged, except minor modifications where
the code reads cpu feature bits.
The wrapper functions have been cleaned up as they are now actually
checked by vet.
Change-Id: I9fa75bee5d85db3a65b3fd3b7997e60367523796
Reviewed-on: https://go-review.googlesource.com/98016
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/runtime/os_linux_s390x.go')
-rw-r--r-- | src/runtime/os_linux_s390x.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/runtime/os_linux_s390x.go b/src/runtime/os_linux_s390x.go index 3ca6d4c8c8..2129052836 100644 --- a/src/runtime/os_linux_s390x.go +++ b/src/runtime/os_linux_s390x.go @@ -5,6 +5,7 @@ package runtime import ( + internalcpu "internal/cpu" "runtime/internal/sys" ) @@ -22,11 +23,13 @@ type facilities struct { // cpu indicates the availability of s390x facilities that can be used in // Go assembly but are optional on models supported by Go. +// TODO: remove this once we're only using internal/cpu. var cpu facilities func archauxv(tag, val uintptr) { switch tag { case _AT_HWCAP: // CPU capability bit flags + internalcpu.S390X.HasVX = val&_HWCAP_S390_VX != 0 cpu.hasVX = val&_HWCAP_S390_VX != 0 } } |