]> Cypherpunks repositories - gostls13.git/commit
internal/cpu: add invalid option warnings and support to enable cpu features
authorMartin Möhrmann <moehrmann@google.com>
Fri, 12 Oct 2018 17:17:21 +0000 (19:17 +0200)
committerMartin Möhrmann <moehrmann@google.com>
Mon, 15 Oct 2018 21:46:44 +0000 (21:46 +0000)
commit3e0227f6a055fff2ceab18ed1ac6bd583a7f94a5
treeb3f2b3767b3b7f8a6bbed96a2ef470f250795f43
parentf81d73e8d57c99d32744e61940dad08c4ec07111
internal/cpu: add invalid option warnings and support to enable cpu features

This CL adds the ability to enable the cpu feature FEATURE by specifying
FEATURE=on in GODEBUGCPU. Syntax support to enable cpu features is useful
in combination with a preceeding all=off to disable all but some specific
cpu features. Example:

GODEBUGCPU=all=off,sse3=on

This CL implements printing of warnings for invalid GODEBUGCPU settings:
- requests enabling features that are not supported with the current CPU
- specifying values different than 'on' or 'off' for a feature
- settings for unkown cpu feature names

Updates #27218

Change-Id: Ic13e5c4c35426a390c50eaa4bd2a408ef2ee21be
Reviewed-on: https://go-review.googlesource.com/c/141800
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/internal/cpu/cpu.go
src/internal/cpu/cpu_arm.go
src/internal/cpu/cpu_arm64.go
src/internal/cpu/cpu_ppc64x.go
src/internal/cpu/cpu_s390x.go
src/internal/cpu/cpu_test.go
src/internal/cpu/cpu_x86.go
src/internal/cpu/cpu_x86_test.go