From: Philip Silva Date: Mon, 10 Jul 2023 20:22:15 +0000 (+0200) Subject: internal/bytealg: use generic IndexByte on plan9/amd64 X-Git-Tag: go1.22rc1~1594 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=da7b4b01bdb6127ed78203d6f7015a454bd26c2f;p=gostls13.git 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 Auto-Submit: Ian Lance Taylor Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Gopher Robot Reviewed-by: David du Colombier <0intro@gmail.com> --- 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