]> Cypherpunks repositories - gostls13.git/commit
all: replace runtime SSE2 detection with GO386 setting
authorMartin Möhrmann <martin@golang.org>
Mon, 23 Aug 2021 09:34:51 +0000 (11:34 +0200)
committerMartin Möhrmann <martin@golang.org>
Mon, 23 Aug 2021 21:22:58 +0000 (21:22 +0000)
commit8157960d7f4a89807c71b3427a0363a23fd43ca9
tree80ce59e8564ed9a8f7780554e24a4ed8758c2151
parent22540abf76a693bc9e4c550203d8ccbaa60c12e2
all: replace runtime SSE2 detection with GO386 setting

When GO386=sse2 we can assume sse2 to be present without
a runtime check. If GO386=softfloat is set we can avoid
the usage of SSE2 even if detected.

This might cause a memcpy, memclr and bytealg slowdown of Go
binaries compiled with softfloat on machines that support
SSE2. Such setups are rare and should use GO386=sse2 instead
if performance matters.

On targets that support SSE2 we avoid the runtime overhead of
dynamic cpu feature dispatch.

The removal of runtime sse2 checks also allows to simplify
internal/cpu further by removing handling of the required
feature option as a followup after this CL.

Change-Id: I90a853a8853a405cb665497c6d1a86556947ba17
Reviewed-on: https://go-review.googlesource.com/c/go/+/344350
Trust: Martin Möhrmann <martin@golang.org>
Run-TryBot: Martin Möhrmann <martin@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
15 files changed:
src/cmd/go/internal/work/gc.go
src/internal/bytealg/bytealg.go
src/internal/bytealg/compare_386.s
src/internal/bytealg/equal_386.s
src/internal/cpu/cpu.go
src/internal/cpu/cpu_386.go [deleted file]
src/internal/cpu/cpu_amd64.go [deleted file]
src/internal/cpu/cpu_x86.go
src/internal/cpu/cpu_x86_test.go
src/runtime/asm_386.s
src/runtime/cpuflags.go
src/runtime/memclr_386.s
src/runtime/memmove_386.s
src/runtime/mkpreempt.go
src/runtime/preempt_386.s