diff options
| author | Philip Silva <philip.silva@protonmail.com> | 2023-07-10 22:22:15 +0200 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2023-07-20 17:30:15 +0000 |
| commit | da7b4b01bdb6127ed78203d6f7015a454bd26c2f (patch) | |
| tree | 00359b44edbbbb84a87cb94449dfaeb2a9f3c051 /src/internal/bytealg | |
| parent | 89699847bf29c9891c95c8c55f8b6bff82c8f4e2 (diff) | |
| download | go-da7b4b01bdb6127ed78203d6f7015a454bd26c2f.tar.xz | |
internal/bytealg: use generic IndexByte on plan9/amd64
Use generic implementation of IndexByte/IndexByteString
on plan9/amd64 since the assembly implementation
uses SSE instructions which are classified as floating
point instructions and cannot be used in a note handler.
A similar issue was fixed in CL 100577.
This fixes runtime.TestBreakpoint.
Fixes #61087.
Change-Id: Id0c085e47da449be405ea04ab9b93518c4e2fde8
Reviewed-on: https://go-review.googlesource.com/c/go/+/508400
Reviewed-by: Heschi Kreinick <heschi@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David du Colombier <0intro@gmail.com>
Diffstat (limited to 'src/internal/bytealg')
| -rw-r--r-- | src/internal/bytealg/indexbyte_amd64.s | 2 | ||||
| -rw-r--r-- | src/internal/bytealg/indexbyte_generic.go | 6 | ||||
| -rw-r--r-- | src/internal/bytealg/indexbyte_native.go | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/src/internal/bytealg/indexbyte_amd64.s b/src/internal/bytealg/indexbyte_amd64.s index 1ca70e39e2..0f07121a8c 100644 --- a/src/internal/bytealg/indexbyte_amd64.s +++ b/src/internal/bytealg/indexbyte_amd64.s @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !plan9 + #include "go_asm.h" #include "textflag.h" diff --git a/src/internal/bytealg/indexbyte_generic.go b/src/internal/bytealg/indexbyte_generic.go index b89d34ff23..b7fffcf460 100644 --- a/src/internal/bytealg/indexbyte_generic.go +++ b/src/internal/bytealg/indexbyte_generic.go @@ -2,7 +2,11 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !386 && !amd64 && !s390x && !arm && !arm64 && !loong64 && !ppc64 && !ppc64le && !mips && !mipsle && !mips64 && !mips64le && !riscv64 && !wasm +// Avoid IndexByte and IndexByteString on Plan 9 because it uses +// SSE instructions on x86 machines, and those are classified as +// floating point instructions, which are illegal in a note handler. + +//go:build !386 && (!amd64 || plan9) && !s390x && !arm && !arm64 && !loong64 && !ppc64 && !ppc64le && !mips && !mipsle && !mips64 && !mips64le && !riscv64 && !wasm package bytealg diff --git a/src/internal/bytealg/indexbyte_native.go b/src/internal/bytealg/indexbyte_native.go index c5bb2df5ea..8e46c31ff6 100644 --- a/src/internal/bytealg/indexbyte_native.go +++ b/src/internal/bytealg/indexbyte_native.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build 386 || amd64 || s390x || arm || arm64 || loong64 || ppc64 || ppc64le || mips || mipsle || mips64 || mips64le || riscv64 || wasm +//go:build 386 || (amd64 && !plan9) || s390x || arm || arm64 || loong64 || ppc64 || ppc64le || mips || mipsle || mips64 || mips64le || riscv64 || wasm package bytealg |
