]> Cypherpunks repositories - gostls13.git/commitdiff
internal/bytealg: use generic IndexByte on plan9/amd64
authorPhilip Silva <philip.silva@protonmail.com>
Mon, 10 Jul 2023 20:22:15 +0000 (22:22 +0200)
committerGopher Robot <gobot@golang.org>
Thu, 20 Jul 2023 17:30:15 +0000 (17:30 +0000)
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>
src/internal/bytealg/indexbyte_amd64.s
src/internal/bytealg/indexbyte_generic.go
src/internal/bytealg/indexbyte_native.go

index 1ca70e39e23a79240b08c5cfeb46500f7e98cf74..0f07121a8cf882a6d2d9d45fc92de55e662a2640 100644 (file)
@@ -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"
 
index b89d34ff231aecd6e082a3bda08f1b5a2cde80cc..b7fffcf460c741561e7988fd08c95feb8620316e 100644 (file)
@@ -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
 
index c5bb2df5ea1e686b0be00267e60ee9c7b2bcb96f..8e46c31ff66bf98e107d2ab82beb368169aa6d01 100644 (file)
@@ -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