diff options
| author | Martin Möhrmann <moehrmann@google.com> | 2018-07-28 10:56:48 +0200 |
|---|---|---|
| committer | Martin Möhrmann <moehrmann@google.com> | 2018-08-24 07:29:52 +0000 |
| commit | c15c04d9e85a6a2c46ae57cb830192e0eee276dc (patch) | |
| tree | 83dd5c15182196d11597cfad6823987138297c70 /src/runtime/proc.go | |
| parent | d8cf1514cadb512de6972e760ccef76452e3a67c (diff) | |
| download | go-c15c04d9e85a6a2c46ae57cb830192e0eee276dc.tar.xz | |
runtime: use internal/cpu variables in assembler code
Using internal/cpu variables has the benefit of avoiding false sharing
(as those are padded) and allows memory and cache usage for these variables
to be shared by multiple packages.
Change-Id: I2bf68d03091bf52b466cf689230d5d25d5950037
Reviewed-on: https://go-review.googlesource.com/126599
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/runtime/proc.go')
| -rw-r--r-- | src/runtime/proc.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go index c9cc7544b8..75d309a9f6 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -507,7 +507,8 @@ func cpuinit() { cpu.Initialize(env) - support_erms = cpu.X86.HasERMS + // Support cpu feature variables are used in code generated by the compiler + // to guard execution of instructions that can not be assumed to be always supported. support_popcnt = cpu.X86.HasPOPCNT support_sse2 = cpu.X86.HasSSE2 support_sse41 = cpu.X86.HasSSE41 |
