]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
9 months agocmd/compile: fix missing init nodes for len(string([]byte)) optimization
Cuong Manh Le [Sat, 5 Aug 2023 15:51:49 +0000 (22:51 +0700)]
cmd/compile: fix missing init nodes for len(string([]byte)) optimization

CL 497276 added optimization for len(string([]byte)) by avoiding call to
slicebytetostring. However, the bytes to string expression may contain
init nodes, which need to be preserved. Otherwise, it would make the
liveness analysis confusing about the lifetime of temporary variables
created by init nodes.

Fixes #61778

Change-Id: I6d1280a7d61bcc75f11132af41bda086f084ab54
Reviewed-on: https://go-review.googlesource.com/c/go/+/516375
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
9 months agocmd/compile/internal/ssagen: sort locals by alignment, not size
Matthew Dempsky [Fri, 4 Aug 2023 19:53:11 +0000 (12:53 -0700)]
cmd/compile/internal/ssagen: sort locals by alignment, not size

Sorting variables by size doesn't actually do anything, but sorting by
alignment makes sure we can optimally pack variables into the stack
frame.

While here, replace the monolithic description at the top of
cmpstackvarlt with line-by-line explanations of what each comparison
is doing.

Change-Id: I860677799618130ce4a55f084cec637cb9a2e295
Reviewed-on: https://go-review.googlesource.com/c/go/+/516197
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
9 months agocmd/compile/internal/ir: remove unused Name.{Offset,SetOffset}
Matthew Dempsky [Fri, 4 Aug 2023 19:37:52 +0000 (12:37 -0700)]
cmd/compile/internal/ir: remove unused Name.{Offset,SetOffset}

These aren't used and don't do anything useful anyway.

Change-Id: I2865f6bbb0409fa59b1fde32abb7c5f81a6bdb7c
Reviewed-on: https://go-review.googlesource.com/c/go/+/516195
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
9 months agoos: replace "used to used" with "used to use" in description text
Jes Cok [Fri, 4 Aug 2023 04:58:40 +0000 (04:58 +0000)]
os: replace "used to used" with "used to use" in description text

Change-Id: I5445f3393373423592dfdd88b91d267c2c98d113
GitHub-Last-Rev: f554da58f49deb38101fd9ffba744bf4bf35ab55
GitHub-Pull-Request: golang/go#61749
Reviewed-on: https://go-review.googlesource.com/c/go/+/515798
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: qiulaidongfeng <2645477756@qq.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

9 months agocrypto/rand, internal/syscall/unix: use simpler random seed on NetBSD
Maya Rashish [Wed, 2 Aug 2023 08:32:07 +0000 (08:32 +0000)]
crypto/rand, internal/syscall/unix: use simpler random seed on NetBSD

sysctl kern.arandom has been supported since NetBSD 4.0, works inside a
chroot, has no confusing bells and whistles like Linux getrandom,
requires no complicated querying to avoid SIGSYS traps, and is what
NetBSD 10 will usee for the getentropy(3) library routine soon to
appear in POSIX.

Change-Id: I23bd84ecd5ff3e33e8958c60896db842c44667ba
GitHub-Last-Rev: 5db094c85ae14bbd9f80247d46d90e00061187cc
GitHub-Pull-Request: golang/go#61441
Reviewed-on: https://go-review.googlesource.com/c/go/+/511036
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
9 months agoencoding/base32: optimize Encode
korzhao [Wed, 5 Jul 2023 12:23:35 +0000 (20:23 +0800)]
encoding/base32: optimize Encode

Converts the 5 x 8-bit source byte to two 32-bit integers.
This will reduce the number of shift operations.

benchmark                      old ns/op     new ns/op     delta
BenchmarkEncode-10             9005          4426          -50.85%
BenchmarkEncodeToString-10     10739         6155          -42.69%

benchmark                      old MB/s     new MB/s     speedup
BenchmarkEncode-10             909.69       1850.81      2.03x
BenchmarkEncodeToString-10     762.84       1331.02      1.74x

Change-Id: I9418d3436b73f94a4eb4b2b525e4f83612ff4d47
Reviewed-on: https://go-review.googlesource.com/c/go/+/514095
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

9 months agocmd/fix: use reflect.TypeFor for known types
cui fliter [Wed, 2 Aug 2023 08:38:12 +0000 (16:38 +0800)]
cmd/fix: use reflect.TypeFor for known types

For #60088

Change-Id: Id19435e864bcfd2adbb1492db3f8cdf2ee3c915e
Reviewed-on: https://go-review.googlesource.com/c/go/+/515175
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: shuang cui <imcusg@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
9 months agoarchive/tar: add FileInfoNames interface
qiulaidongfeng [Fri, 4 Aug 2023 05:15:41 +0000 (05:15 +0000)]
archive/tar: add FileInfoNames interface

An optional interface FileInfoNames has been added.

If the parameter fi of FileInfoHeader implements the interface
the Gname and Uname of the return value Header are
provided by the method of the interface.

Also added testing.

Fixes #50102

Change-Id: I6fd06c7c9aaf29b22b7384542fe57affed33009a

Change-Id: I6fd06c7c9aaf29b22b7384542fe57affed33009a
GitHub-Last-Rev: 5e82257948759e13880d8af12743b9524ae3df5a
GitHub-Pull-Request: golang/go#61662
Reviewed-on: https://go-review.googlesource.com/c/go/+/514235
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

9 months agoencoding/xml, image/jpeg, image/png: use the builtin min function
apocelipes [Fri, 4 Aug 2023 03:15:12 +0000 (03:15 +0000)]
encoding/xml, image/jpeg, image/png: use the builtin min function

Change-Id: I9bafc7aa4e20e7cd994b75e7576156ca68f4fc8b
GitHub-Last-Rev: e037f689bddd0ef03a6ad38982fe98b4c26aaede
GitHub-Pull-Request: golang/go#61746
Reviewed-on: https://go-review.googlesource.com/c/go/+/515855
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

9 months agoos: use t.Fatalf instead of t.Errorf in TestErrProcessDone
Jes Cok [Thu, 3 Aug 2023 23:50:14 +0000 (23:50 +0000)]
os: use t.Fatalf instead of t.Errorf in TestErrProcessDone

If err is non-nil, use t.Fatalf to avoid panic when calling p.Wait().

Change-Id: Ief4e43ba5ad782999063941ed3b12f3fe4d93621
GitHub-Last-Rev: 5d32b3c082e54a914360cb4434d4cc7682e7031e
GitHub-Pull-Request: golang/go#61740
Reviewed-on: https://go-review.googlesource.com/c/go/+/515655
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

9 months agoregexp: improve Regexp.ReplaceAll documentation and tests related to Expand part
Eduard Bondarenko [Tue, 1 Aug 2023 14:48:16 +0000 (14:48 +0000)]
regexp: improve Regexp.ReplaceAll documentation and tests related to Expand part

For #40329

Change-Id: Ie0cb337545ce39cd169129227c45f7d2eaebc898
GitHub-Last-Rev: c017d4c7c1bc1f8cd39e6c70b60885cef1231dcd
GitHub-Pull-Request: golang/go#56507
Reviewed-on: https://go-review.googlesource.com/c/go/+/446836
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

9 months agocmd/compile/internal/base: optimize the readImportCfg function to make it clearer
cui fliter [Sat, 5 Aug 2023 15:52:52 +0000 (15:52 +0000)]
cmd/compile/internal/base: optimize the readImportCfg function to make it clearer

Change-Id: If8fc77d5b04b2979707032d91112d4f33ef5e3da
GitHub-Last-Rev: d82d769c04569af8a0c99a0ba9a78db641b97368
GitHub-Pull-Request: golang/go#55913
Reviewed-on: https://go-review.googlesource.com/c/go/+/435536
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: shuang cui <imcusg@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: qiulaidongfeng <2645477756@qq.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

9 months agoarm64: replace "PCALGIN with PCALIGN" in package documentation
adetunjii [Sat, 5 Aug 2023 21:14:36 +0000 (21:14 +0000)]
arm64: replace "PCALGIN with PCALIGN" in package documentation

Change-Id: I476e2a75f39c876fa9c071cada36573740d546de
GitHub-Last-Rev: dec3fb438f4dd0d8e0aff300356c8d92e8ee6749
GitHub-Pull-Request: golang/go#61783
Reviewed-on: https://go-review.googlesource.com/c/go/+/516395
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

9 months agointernal/bytealg: optimize Index/IndexString in amd64
Mauri de Souza Meneguzzo [Sun, 6 Aug 2023 23:34:18 +0000 (23:34 +0000)]
internal/bytealg: optimize Index/IndexString in amd64

Now with PCALIGN available on amd64 we can start optimizing some routines that benefit from instruction alignment.

```
                         │    sec/op     │    sec/op     vs base               │
IndexByte/4K-16             69.89n ± ∞ ¹   45.88n ± ∞ ¹  -34.35% (p=0.008 n=5)
IndexByte/4M-16             65.36µ ± ∞ ¹   47.32µ ± ∞ ¹  -27.60% (p=0.008 n=5)
IndexByte/64M-16            1.435m ± ∞ ¹   1.140m ± ∞ ¹  -20.57% (p=0.008 n=5)
                         │      B/s      │      B/s       vs base               │
IndexByte/4K-16            54.58Gi ± ∞ ¹   83.14Gi ± ∞ ¹  +52.32% (p=0.008 n=5)
IndexByte/4M-16            59.76Gi ± ∞ ¹   82.54Gi ± ∞ ¹  +38.12% (p=0.008 n=5)
IndexByte/64M-16           43.56Gi ± ∞ ¹   54.84Gi ± ∞ ¹  +25.89% (p=0.008 n=5)
```

Change-Id: Iff3dfd542c55e7569242be81f38b2887b9e04e87
GitHub-Last-Rev: f309f898b13ad8fdf88a21f2f105382db9ada2f5
GitHub-Pull-Request: golang/go#61792
Reviewed-on: https://go-review.googlesource.com/c/go/+/516435
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
9 months agoio: remove manual SectionReader.Size in SectionReader.ReadAt
Jorropo [Fri, 2 Jun 2023 18:20:18 +0000 (20:20 +0200)]
io: remove manual SectionReader.Size in SectionReader.ReadAt

Change-Id: Ib3e8953dbdefa2b78c31b1bcbf0909bce248e423
Reviewed-on: https://go-review.googlesource.com/c/go/+/500475
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: qiulaidongfeng <2645477756@qq.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>

9 months agoruntime,syscall: invert openbsd architecture tests
Joel Sing [Fri, 4 Aug 2023 11:27:20 +0000 (21:27 +1000)]
runtime,syscall: invert openbsd architecture tests

Rather than testing for architectures that use libc-based system calls,
test that it is not the single architecture that Go is still using direct
system calls. This reduces the number of changes needed for new openbsd
ports.

Updates #36435
Updates #61546

Change-Id: I79c4597c629b8b372e9efcda79e8f6ff778b9e8e
Reviewed-on: https://go-review.googlesource.com/c/go/+/516016
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>
TryBot-Result: Gopher Robot <gobot@golang.org>

9 months agointernal/testenv: replace “go run.” with “go run”. in comments
Jes Cok [Fri, 4 Aug 2023 20:50:12 +0000 (20:50 +0000)]
internal/testenv: replace “go run.” with “go run”. in comments

Change-Id: I7d960ebeac38262c8ee39deeed9e1a2ea2803f5f
GitHub-Last-Rev: 59c5d7ea76dcca5424ce79f6030196c8adbf1fd9
GitHub-Pull-Request: golang/go#61755
Reviewed-on: https://go-review.googlesource.com/c/go/+/515800
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

9 months agoruntime/pprof: correct field alignment in machVMRegionBasicInfoData
Cherry Mui [Fri, 4 Aug 2023 20:30:40 +0000 (16:30 -0400)]
runtime/pprof: correct field alignment in machVMRegionBasicInfoData

The type machVMRegionBasicInfoData is generated from C type
vm_region_basic_info_data_64_t, which is a packed struct with a
64-bit field at offset 20. We cannot use uint64 as the field type
in the Go struct, as that will be aligned at offset 24, which does
not match the C struct. Change back to [8]byte (which is what the
cgo command generates), but keep the name Offset.

Updates #61707.
Updates #50891.

Change-Id: I2932328d7f9dfe9d79cff89752666c794d4d3788
Reviewed-on: https://go-review.googlesource.com/c/go/+/516156
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Cherry Mui <cherryyz@google.com>

9 months agodoc: move Go 1.21 release notes to x/website
David Chase [Fri, 4 Aug 2023 16:57:32 +0000 (12:57 -0400)]
doc: move Go 1.21 release notes to x/website

Now that the development of the Go 1.21 release is almost done, its
release notes are moved to their eventual long-term home in x/website
in CL 516095. Delete the initial development copy here.

For golang/go#58645.

Change-Id: I5207d21289b2e7b9328c943a088f45bc81c710a4
Reviewed-on: https://go-review.googlesource.com/c/go/+/516075
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
9 months agodoc/go1.21: update crypto release notes
Filippo Valsorda [Fri, 4 Aug 2023 13:47:36 +0000 (15:47 +0200)]
doc/go1.21: update crypto release notes

Left out the following commits that felt more bug-fixy.

f0de4b4f03 - crypto/x509: fix certificate validation with FQDN on Windows <Patryk Chelmecki>
20e08fe68c - crypto/tls: advertise correct ciphers in TLS 1.3 only mode <Monis Khan>
295c237b4d - crypto/tls: enforce 1.3 record version semantics <Roland Shoemaker>

Change-Id: Idd38b5c6897130424a0e8b857f371d7d384fc143
Reviewed-on: https://go-review.googlesource.com/c/go/+/515955
Reviewed-by: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>

9 months agocmd/compile: don't use BTS when OR works, add direct memory BTS operations
Keith Randall [Tue, 1 Aug 2023 21:32:56 +0000 (14:32 -0700)]
cmd/compile: don't use BTS when OR works, add direct memory BTS operations

Stop using BTSconst and friends when ORLconst can be used instead.
OR can be issued by more function units than BTS can, so it could
lead to better IPC. OR might take a few more bytes to encode, but
not a lot more.

Still use BTSconst for cases where the constant otherwise wouldn't
fit and would require a separate movabs instruction to materialize
the constant. This happens when setting bits 31-63 of 64-bit targets.

Add BTS-to-memory operations so we don't need to load/bts/store.

Fixes #61694

Change-Id: I00379608df8fb0167cb01466e97d11dec7c1596c
Reviewed-on: https://go-review.googlesource.com/c/go/+/515755
Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
9 months agoruntime: add deferreturn fast path for linked defers
Matthew Dempsky [Thu, 3 Aug 2023 20:52:00 +0000 (13:52 -0700)]
runtime: add deferreturn fast path for linked defers

A consequence of go.dev/cl/513837 was that calling deferreturn would
now use the unwinder to find (just) the current frame, and it turns
out there are workloads where this has a significant performance
impact.

As a simple optimization, this CL adds a fast path for deferreturn to
detect when there are pending linked defers, which allows us to skip
invoking the unwinder entirely.

Notably, this still doesn't handle the corner case of calling
deferreturn in a function that uses linked defer when dynamically
there just aren't any defers pending. It also means that after
recovering from a panic and returning to a frame that used open-coded,
we still need to use the unwinder too.

I hope to further optimize defer handling to improve these cases too,
but this is an easy, short-term optimization that relieves the
performance impact to the affected workloads.

Change-Id: I11fa73649302199eadccc27b403b231db8f33db2
Reviewed-on: https://go-review.googlesource.com/c/go/+/515716
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
9 months agocrypto/md5: optimize amd64 assembly
Klaus Post [Wed, 6 Oct 2021 16:11:40 +0000 (16:11 +0000)]
crypto/md5: optimize amd64 assembly

* Use two ADDL instead of LEAL
* Keep ones in R11
* Use XORL with lower latency instead of NOTL
* Remove loads and load the correct value in the previous round
* Reduce dependency chain in round 2.
* Remove MOVL in round 3.

name                    old time/op    new time/op    delta
Hash8Bytes-32              104ns ± 0%      96ns ± 1%   -7.83%   (p=0.000 n=9+10)
Hash64-32                  169ns ± 0%     155ns ± 0%   -7.97%  (p=0.000 n=10+10)
Hash128-32                 244ns ± 0%     224ns ± 0%   -8.16%   (p=0.000 n=9+10)
Hash256-32                 396ns ± 0%     360ns ± 1%   -9.01%  (p=0.000 n=10+10)
Hash512-32                 700ns ± 1%     634ns ± 1%   -9.43%  (p=0.000 n=10+10)
Hash1K-32                 1.30µs ± 0%    1.18µs ± 1%   -9.32%   (p=0.000 n=9+10)
Hash8K-32                 9.77µs ± 0%    8.81µs ± 0%   -9.78%   (p=0.000 n=9+10)
Hash1M-32                 1.24ms ± 1%    1.12ms ± 1%   -9.54%  (p=0.000 n=10+10)
Hash8M-32                 10.0ms ± 1%     9.0ms ± 1%  -10.04%  (p=0.000 n=10+10)
Hash8BytesUnaligned-32     104ns ± 0%      96ns ± 0%   -7.50%  (p=0.000 n=10+10)
Hash1KUnaligned-32        1.32µs ± 1%    1.18µs ± 1%  -10.42%  (p=0.000 n=10+10)
Hash8KUnaligned-32        9.80µs ± 0%    8.79µs ± 1%  -10.29%  (p=0.000 n=10+10)

name                    old speed      new speed      delta
Hash8Bytes-32           77.1MB/s ± 0%  83.6MB/s ± 1%   +8.49%   (p=0.000 n=9+10)
Hash64-32                379MB/s ± 0%   412MB/s ± 0%   +8.66%  (p=0.000 n=10+10)
Hash128-32               525MB/s ± 0%   572MB/s ± 0%   +8.89%   (p=0.000 n=9+10)
Hash256-32               646MB/s ± 0%   710MB/s ± 1%   +9.90%  (p=0.000 n=10+10)
Hash512-32               732MB/s ± 1%   808MB/s ± 1%  +10.41%  (p=0.000 n=10+10)
Hash1K-32                786MB/s ± 0%   866MB/s ± 1%  +10.30%   (p=0.000 n=9+10)
Hash8K-32                839MB/s ± 0%   930MB/s ± 0%  +10.79%  (p=0.000 n=10+10)
Hash1M-32                849MB/s ± 1%   938MB/s ± 1%  +10.54%  (p=0.000 n=10+10)
Hash8M-32                841MB/s ± 1%   935MB/s ± 1%  +11.16%  (p=0.000 n=10+10)
Hash8BytesUnaligned-32  77.1MB/s ± 0%  83.4MB/s ± 0%   +8.12%  (p=0.000 n=10+10)
Hash1KUnaligned-32       778MB/s ± 1%   869MB/s ± 1%  +11.64%  (p=0.000 n=10+10)
Hash8KUnaligned-32       836MB/s ± 0%   932MB/s ± 1%  +11.47%  (p=0.000 n=10+10)

Change-Id: I02b31229b857e9257dc9d36538883eb3af4ad993

This PR will be imported into Gerrit with the title and first
comment (this text) used to generate the subject and body of
the Gerrit change.

Change-Id: I02b31229b857e9257dc9d36538883eb3af4ad993
GitHub-Last-Rev: ec8b15d789181d0dac57bf0ba5041ee7aeb305c9
GitHub-Pull-Request: golang/go#43690
Reviewed-on: https://go-review.googlesource.com/c/go/+/283538
Run-TryBot: Joel Sing <joel@sing.id.au>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Joel Sing <joel@sing.id.au>
9 months agocmd/go: default to PIE linking on darwin/amd64
Cherry Mui [Fri, 16 Sep 2022 22:10:56 +0000 (18:10 -0400)]
cmd/go: default to PIE linking on darwin/amd64

The recent version of darwin linker ld64 emits an warning about
deprecation of the -no_pie flag. Further, the new darwin linker
ld-prime ignores -no_pie flag and generates a PIE binary anyway.
Switch to building PIE binaries by default.

Updates #54482.
Updates #61229.

Change-Id: I81294dcd07a368a20e1349d56556ee2fdcb8df44
Reviewed-on: https://go-review.googlesource.com/c/go/+/461697
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

9 months agonet: use fake DNS dialer for /etc/hosts aliases tests
Mateusz Poliwczak [Thu, 3 Aug 2023 09:34:44 +0000 (09:34 +0000)]
net: use fake DNS dialer for /etc/hosts aliases tests

Change-Id: If9c41bd1e0497e76d901bfd2f749fbeb1ed3ac38
GitHub-Last-Rev: f5777d8c20afb47b8cf093e43c7c25bbbb386e91
GitHub-Pull-Request: golang/go#61734
Reviewed-on: https://go-review.googlesource.com/c/go/+/515535
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Mateusz Poliwczak <mpoliwczak34@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>

9 months agolog/slog: catch panics during formatting
Andy Pan [Sun, 30 Jul 2023 03:42:14 +0000 (11:42 +0800)]
log/slog: catch panics during formatting

Fixes #61648

Change-Id: I6b7f4948ca89142a358d74624607daf42ea8b304
Reviewed-on: https://go-review.googlesource.com/c/go/+/514135
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Andy Pan <panjf2000@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Jonathan Amsterdam <jba@google.com>

9 months agoencoding/gob: skip TestLargeSlice on machines with small address space
miller [Thu, 18 May 2023 10:25:48 +0000 (11:25 +0100)]
encoding/gob: skip TestLargeSlice on machines with small address space

The encoding/gob.TestLargeSlice test needs too much virtual memory
to run reliably on machines with a small address space, for example
the plan9-arm builders where user processes only have 1 gigabyte.

Fixes #60284

Change-Id: Ied88630e5ec6685e14d2060ae316abca1619f9b5
Reviewed-on: https://go-review.googlesource.com/c/go/+/496138
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: David du Colombier <0intro@gmail.com>
Run-TryBot: David du Colombier <0intro@gmail.com>

9 months agospec: remove unnecessary sentence
Robert Griesemer [Thu, 3 Aug 2023 00:03:55 +0000 (17:03 -0700)]
spec: remove unnecessary sentence

Change-Id: I06345199ff16c80be83c345d734caef1714ec089
Reviewed-on: https://go-review.googlesource.com/c/go/+/515338
TryBot-Bypass: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>

9 months agogo/types, types2: collect per-file Go version in Info.FileVersions
Robert Griesemer [Wed, 2 Aug 2023 01:02:41 +0000 (18:02 -0700)]
go/types, types2: collect per-file Go version in Info.FileVersions

The go/types changes are matching but the API changes are hidden
for now, pending acceptance of a respective proposal.

Change-Id: I2e38ff215ddbdcf93f182d3e70c03802d3ca4338
Reviewed-on: https://go-review.googlesource.com/c/go/+/515135
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>

9 months agogo/types, types2: don't panic during interface completion
Robert Findley [Thu, 3 Aug 2023 14:07:09 +0000 (10:07 -0400)]
go/types, types2: don't panic during interface completion

It should be possible for the importer to construct an invalid
interface, as would have been produced by type checking.

Fixes #61737

Change-Id: I72e063f4f1a6205d273a623acce2ec08c34c3cc2
Reviewed-on: https://go-review.googlesource.com/c/go/+/515555
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Findley <rfindley@google.com>
Reviewed-by: Olif Oftimis <oftimisolif@gmail.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

9 months agocmd/internal/obj/arm64: move register encoding into opxrrr
Joel Sing [Sat, 7 Jan 2023 16:00:21 +0000 (03:00 +1100)]
cmd/internal/obj/arm64: move register encoding into opxrrr

Rather than having register encoding knowledge in each caller of opxrrr,
pass the registers into opxrrr and let it handle the encoding. This reduces
duplication and improves readability.

Change-Id: I202c503465a0169277a0f64340598203c9dcf20c
Reviewed-on: https://go-review.googlesource.com/c/go/+/461140
Run-TryBot: Joel Sing <joel@sing.id.au>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
9 months agocmd/asm,cmd/internal/obj/riscv,cmd/link: improve TLS handling on riscv64
Joel Sing [Thu, 15 Sep 2022 16:29:12 +0000 (02:29 +1000)]
cmd/asm,cmd/internal/obj/riscv,cmd/link: improve TLS handling on riscv64

The existing Thread Local Storage (TLS) implementation for riscv64 uses
initial-exec (IE) mode, however a MOV of a TLS symbol currently loads the
thread pointer offset and not the actual address or memory location.

Rework TLS on riscv64 to generate the full instruction sequence needed to
load from or store to a TLS symbol. Additionally, provide support for both
initial-exec (IE) and local-exec (LE) TLS - in many cases we can use LE,
which is slightly more efficient and easier to support in the linker.

Change-Id: I1b43f8888b3b6b10354bbb79d604771e64d92645
Reviewed-on: https://go-review.googlesource.com/c/go/+/431103
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: M Zhuo <mzh@golangcn.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>

9 months agoruntime,runtime/pprof: get memory mappings on darwin.
Cosmos Nicolaou [Wed, 14 Jun 2023 21:33:43 +0000 (14:33 -0700)]
runtime,runtime/pprof: get memory mappings on darwin.

Displaying assembly language has never worked for Apple Silicon
macs (see #50891). This change uses mach_vm_region to obtain the
necessary VM mappings to allow for locating assembly instructions
for a cpu profile.

Fixes #50891

Change-Id: Ib968c55a19b481b82f63337276b552f3b18f69d1
Reviewed-on: https://go-review.googlesource.com/c/go/+/503919
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
9 months agocmd/cgo/internal/testerrors: unskip TestPointerChecks on Windows
qmuntal [Mon, 31 Jul 2023 14:56:01 +0000 (16:56 +0200)]
cmd/cgo/internal/testerrors: unskip TestPointerChecks on Windows

All TestPointerChecks cases can be executed on Windows with some minor
tweaks.

It seems that the skip has been cargo-culted from when cgo error tests
were first added in https://codereview.appspot.com/13498046.

Change-Id: I39cd05f4c90965b669d2b403f7fcd9dd9c69016c
Reviewed-on: https://go-review.googlesource.com/c/go/+/514296
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Quim Muntal <quimmuntal@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

9 months agotext/template: use "IsValid" instead of "!= zero" to compare zero Value
Jes Cok [Tue, 1 Aug 2023 13:28:14 +0000 (13:28 +0000)]
text/template: use "IsValid" instead of "!= zero" to compare zero Value

See CL 308769

Change-Id: I0caa0a84215b3d4b8b3dc6f041b6cd9cbe2c0908
GitHub-Last-Rev: e3aa5bde23fe26cbb6711a6ffbf4856a23fa6f54
GitHub-Pull-Request: golang/go#61657
Reviewed-on: https://go-review.googlesource.com/c/go/+/514195
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>

9 months agoruntime/internal: switch GOWASIRUNTIME default
Johan Brandhorst-Satzkorn [Tue, 1 Aug 2023 23:01:13 +0000 (16:01 -0700)]
runtime/internal: switch GOWASIRUNTIME default

CL 513235 switched the default wasip1 runtime in the misc/wasm
executable script, but it missed this use of the GOWASIRUNTIME
environment variable. Update this instance to make the default runtime
choice consistent.

Change-Id: Iff7f96231422747a38d65d13a940f6e9d04d835d
Reviewed-on: https://go-review.googlesource.com/c/go/+/515115
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Achille Roussel <achille.roussel@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Run-TryBot: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>

9 months agonet/rpc: use reflect.TypeFor for known types
Ian Lance Taylor [Tue, 1 Aug 2023 19:38:43 +0000 (12:38 -0700)]
net/rpc: use reflect.TypeFor for known types

For #60088

Change-Id: I56586b68d5e38a46560f4ced19214f1d2db2850e
Reviewed-on: https://go-review.googlesource.com/c/go/+/514995
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Rob Pike <r@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>

9 months agoarchive: use predeclared function min
qiulaidongfeng [Tue, 1 Aug 2023 05:08:08 +0000 (05:08 +0000)]
archive: use predeclared function min

Change-Id: I23e0005071fcbafeaecaa05f51712dd1de6eed01

Change-Id: I23e0005071fcbafeaecaa05f51712dd1de6eed01
GitHub-Last-Rev: 364d7c74fef1668930b730b05a7539f7ac43e60a
GitHub-Pull-Request: golang/go#61661
Reviewed-on: https://go-review.googlesource.com/c/go/+/514215
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>

9 months agoimage/jpeg, image/png: replace Fatal with Error in tests
Hiro [Tue, 1 Aug 2023 07:25:46 +0000 (07:25 +0000)]
image/jpeg, image/png: replace Fatal with Error in tests

Replaced t.Fatalf with t.Errorf for non-critical errors to footprint more failing test cases for better analysis of the error.

Change-Id: I6f51d21e37a4ddb95d239d8afed2154f3ef52d31
GitHub-Last-Rev: d56aa49bced80c80f1177ae4b9ce038265ead551
GitHub-Pull-Request: golang/go#60524
Reviewed-on: https://go-review.googlesource.com/c/go/+/499336
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
9 months agonet: use the extended RCode from EDNS(0) OPT resources
Mateusz Poliwczak [Tue, 1 Aug 2023 18:02:54 +0000 (18:02 +0000)]
net: use the extended RCode from EDNS(0) OPT resources

For a while now we support EDNS, but the current
implementation only sends the OPT resource and doesn't
do anything with the response OPT resource.

For reference the miekg/dns updates the RCode in the
header when there is a OPT resource:
https://github.com/miekg/dns/blob/48f38ebef989eedc6b57f1869ae849ccc8f5fe29/msg.go#L868-L872

Change-Id: I0a7146aed3e50654f340a3925f48612561cb85f4
GitHub-Last-Rev: adc304167e0540cb1f066f07a249d67fad89182e
GitHub-Pull-Request: golang/go#61695
Reviewed-on: https://go-review.googlesource.com/c/go/+/514835
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

9 months agodoc/go1.21: document changes in crypto/tls related to client authentication alerts
Anit Gandhi [Tue, 27 Jun 2023 16:55:45 +0000 (16:55 +0000)]
doc/go1.21: document changes in crypto/tls related to client authentication alerts

For #52113
For #58645

Change-Id: Id7dff2570132588da95fb4216a86faf34fa2cbdc
GitHub-Last-Rev: 94eabfe82f189b7a5fb7f1ee32ac3074aa58088f
GitHub-Pull-Request: golang/go#60972
Reviewed-on: https://go-review.googlesource.com/c/go/+/505436
Run-TryBot: Roland Shoemaker <roland@golang.org>
Auto-Submit: Roland Shoemaker <roland@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
9 months agodoc: fix html tags
cui fliter [Wed, 2 Aug 2023 06:39:11 +0000 (14:39 +0800)]
doc: fix html tags

Change-Id: I535bec2de8f4f7dd415896a020d71c373c22be56
Reviewed-on: https://go-review.googlesource.com/c/go/+/515155
Run-TryBot: shuang cui <imcusg@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: David Chase <drchase@google.com>
9 months agodoc/go1.21: consistently use spaces for indentation
Tobias Klauser [Mon, 17 Jul 2023 12:32:44 +0000 (14:32 +0200)]
doc/go1.21: consistently use spaces for indentation

Change-Id: Ib0aec9ee6cd7aae1821c82e67f0c67be01122992
Reviewed-on: https://go-review.googlesource.com/c/go/+/509677
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>

9 months agocmd/internal/obj/mips: add WSBH/DSBH/DSHD instructions
Junxian Zhu [Tue, 9 May 2023 11:11:20 +0000 (19:11 +0800)]
cmd/internal/obj/mips: add WSBH/DSBH/DSHD instructions

Add support for WSBH/DSBH/DSHD instructions, which are introduced in mips{32,64}r2.

WSBH reverse bytes within halfwords for 32-bit word, DSBH reverse bytes within halfwords for 64-bit doubleword, and DSHD reverse halfwords within doublewords. These instructions can be used to optimize byte swaps.

Ref: The MIPS64 Instruction Set, Revision 5.04: https://s3-eu-west-1.amazonaws.com/downloads-mips/documents/MD00087-2B-MIPS64BIS-AFP-05.04.pdf

Updates #60072

Change-Id: I31c043150fe8ac03027f413ef4cb2f3e435775e1
Reviewed-on: https://go-review.googlesource.com/c/go/+/493816
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Joel Sing <joel@sing.id.au>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>

9 months agodoc/go1.21: finish last TODO for go/types.Package.GoVersion
Matthew Dempsky [Wed, 26 Jul 2023 17:40:12 +0000 (10:40 -0700)]
doc/go1.21: finish last TODO for go/types.Package.GoVersion

Updates #58645.

Change-Id: I7352bf7f03c478d92ebd0b8345d676d5b2dfccb7
Reviewed-on: https://go-review.googlesource.com/c/go/+/513475
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Bypass: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
10 months agocmd/asm: add s390x crypto related instructions
Srinivas Pokala [Wed, 12 Jul 2023 12:47:31 +0000 (14:47 +0200)]
cmd/asm: add s390x crypto related instructions

This CL add's the following instructions,useful for cipher and
message digest operations:

 * KM   - cipher message
 * KMC  - cipher message with chaining
 * KLMD - compute last message digest
 * KIMD - compute intermediate message digest

Fixes #61163

Change-Id: Ib0636430c3e4888ed61b86c5acae45ee596463ff
Reviewed-on: https://go-review.googlesource.com/c/go/+/509075
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
10 months agointernal/goexperiment: add "NewInliner" experiment
Than McIntosh [Tue, 11 Jul 2023 14:34:48 +0000 (10:34 -0400)]
internal/goexperiment: add "NewInliner" experiment

Add "NewInliner" to the list of Go experiments, used for enabling an
updated/improved version of the function inlining phase within the Go
compiler.

Updates #61502.

Change-Id: I3218b3ae59a2d05156e8017cd9ee1d7b66cad031
Reviewed-on: https://go-review.googlesource.com/c/go/+/511555
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>

10 months agogo/types, types2: move posVers field into group of package-specific fields (cleanup)
Robert Griesemer [Tue, 1 Aug 2023 22:48:17 +0000 (15:48 -0700)]
go/types, types2: move posVers field into group of package-specific fields (cleanup)

posVers exists once for an entire package. Move it into the group
of fields related to the entire package (and out from the group
of fields that are specific to each batch of files).

Change-Id: I40ea722578408bdf2b85db91b65680e720c0c502
Reviewed-on: https://go-review.googlesource.com/c/go/+/514998
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
10 months agocrypto/tls: change SendSessionTicket to take an options struct
Damien Neil [Tue, 1 Aug 2023 20:33:37 +0000 (13:33 -0700)]
crypto/tls: change SendSessionTicket to take an options struct

To allow for future evolution of the API, make
QUICConn.SendSessionTicket take a QUICSessionTicketOptions
rather than a single bool.

For #60107

Change-Id: I798fd0feec5c7581e3c3574e2de99611c81df47f
Reviewed-on: https://go-review.googlesource.com/c/go/+/514997
Reviewed-by: Roland Shoemaker <roland@golang.org>
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Marten Seemann <martenseemann@gmail.com>
10 months agoruntime: cpu profiler to use high resolution timers on Windows
qmuntal [Mon, 31 Jul 2023 15:33:40 +0000 (17:33 +0200)]
runtime: cpu profiler to use high resolution timers on Windows

The CPU profiler skip samples if the sampling rate is too high
for the system timer resolution. This CL uses high resolution
timers on Windows when available, to avoid this problem.

Note that the default sampling rate (100Hz) is already too high
for the Windows timer resolution (15.6ms), so this CL also improves
the default Windows sampling coverage.

Not adding regression tests, as they would be too flaky.

Fixes #61665

Change-Id: Ifdadabc9ebaf56f397eac517bd0e5f1502b956b3
Reviewed-on: https://go-review.googlesource.com/c/go/+/514375
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Quim Muntal <quimmuntal@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
10 months agoreflect: update Type.FieldByName documentation
qiulaidongfeng [Wed, 2 Aug 2023 00:37:49 +0000 (00:37 +0000)]
reflect: update Type.FieldByName documentation

Fixes #61495

Change-Id: I9abaf3613c797006b803dcb1dbee16f25ffb7516

Change-Id: I9abaf3613c797006b803dcb1dbee16f25ffb7516
GitHub-Last-Rev: 7bc2cba77286be1bd322ee31eee3e1df3d8761f1
GitHub-Pull-Request: golang/go#61645
Reviewed-on: https://go-review.googlesource.com/c/go/+/514035
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>

10 months agoencoding/json: adjust comment to keep the same style as comment above
Jes Cok [Wed, 2 Aug 2023 12:30:56 +0000 (12:30 +0000)]
encoding/json: adjust comment to keep the same style as comment above

Change-Id: Id47d32d18031883b874bba4cf8541f75c5d7f9db
GitHub-Last-Rev: 98c671c00c112e7bdf70b2f901a4f7682f922725
GitHub-Pull-Request: golang/go#61711
Reviewed-on: https://go-review.googlesource.com/c/go/+/515215
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: David Chase <drchase@google.com>
10 months agocmd/go: missing name in failed command error
Mauri de Souza Meneguzzo [Wed, 2 Aug 2023 13:47:16 +0000 (13:47 +0000)]
cmd/go: missing name in failed command error

Fixed the error reporting for an unknown command to
preserve the name when displaying the error message.

Fixes #61604

Change-Id: I13defb84e61265ab48ab514e9d4f1626a4a3f758
GitHub-Last-Rev: 5d2889c60ceb3f43bb63b6641ecbcca08b7cd365
GitHub-Pull-Request: golang/go#61607
Reviewed-on: https://go-review.googlesource.com/c/go/+/513555
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
10 months agocrypto/tls: restrict RSA keys in certificates to <= 8192 bits
Roland Shoemaker [Wed, 7 Jun 2023 22:27:13 +0000 (15:27 -0700)]
crypto/tls: restrict RSA keys in certificates to <= 8192 bits

Extremely large RSA keys in certificate chains can cause a client/server
to expend significant CPU time verifying signatures. Limit this by
restricting the size of RSA keys transmitted during handshakes to <=
8192 bits.

Based on a survey of publicly trusted RSA keys, there are currently only
three certificates in circulation with keys larger than this, and all
three appear to be test certificates that are not actively deployed. It
is possible there are larger keys in use in private PKIs, but we target
the web PKI, so causing breakage here in the interests of increasing the
default safety of users of crypto/tls seems reasonable.

Thanks to Mateusz Poliwczak for reporting this issue.

Fixes #61460
Fixes CVE-2023-29409

Change-Id: Ie35038515a649199a36a12fc2c5df3af855dca6c
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1912161
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Tatiana Bradley <tatianabradley@google.com>
Run-TryBot: Roland Shoemaker <bracewell@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/515257
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>

10 months agocmd/distpack: test for .DS_Store files in all directories
Dmitri Shuralyov [Tue, 1 Aug 2023 17:43:08 +0000 (13:43 -0400)]
cmd/distpack: test for .DS_Store files in all directories

macOS may write a .DS_Store file to any directory at any time in
the general case, unfortunately. Expand test rules to catch them
no matter where they may appear.

For #24904.

Change-Id: I98a2bb5d0ae2ab3a191ff87b33d6f8048ca39aa8
Reviewed-on: https://go-review.googlesource.com/c/go/+/514898
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>

10 months agocmd/dist: tolerate macOS writing .DS_Store to GOROOT/bin
Dmitri Shuralyov [Sat, 29 Jul 2023 20:33:13 +0000 (16:33 -0400)]
cmd/dist: tolerate macOS writing .DS_Store to GOROOT/bin

I was trying out gorebuild (a program that runs make.bash many times)
on a macOS system. Unfortunately there were a few failed invocations
on my first try, but not with a very good or interesting reason:

go tool dist: unexpected new file in $GOROOT/bin: .DS_Store

Tolerate it since it's not unexpected, and will not affect the build.

Change-Id: I656536b896098c2ba934667196d4ce82e706c8da
Reviewed-on: https://go-review.googlesource.com/c/go/+/513763
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>

10 months agoencoding/json: replace "between or" with "between and" in comment
Jes Cok [Tue, 1 Aug 2023 20:22:13 +0000 (20:22 +0000)]
encoding/json: replace "between or" with "between and" in comment

Change-Id: Id19a15f9367de10e08a9ec22a8cb50c58d517906
GitHub-Last-Rev: f413d71c9ad0f2efc0b4811c7188cc2caa9c1de0
GitHub-Pull-Request: golang/go#61701
Reviewed-on: https://go-review.googlesource.com/c/go/+/514976
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
10 months agocmd/compile: implement float min/max in hardware for amd64 and arm64
Keith Randall [Mon, 31 Jul 2023 21:08:42 +0000 (14:08 -0700)]
cmd/compile: implement float min/max in hardware for amd64 and arm64

Update #59488

Change-Id: I89f5ea494cbcc887f6fae8560e57bcbd8749be86
Reviewed-on: https://go-review.googlesource.com/c/go/+/514596
Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
10 months agoreflect: make linkable cross-references in documentation
Keith Randall [Tue, 1 Aug 2023 17:03:40 +0000 (10:03 -0700)]
reflect: make linkable cross-references in documentation

This makes it easier to click around in documentation on pkg.go.dev.

Change-Id: Idc67c312bc72c612e660607e5400b43ecc110bc1
Reviewed-on: https://go-review.googlesource.com/c/go/+/514895
Run-TryBot: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
10 months agoruntime: handle SIGPE exception for p256 crypto package on s390x
root [Wed, 31 May 2023 12:06:02 +0000 (12:06 +0000)]
runtime: handle SIGPE exception for p256 crypto package on s390x

Older s390x before z13 did not have support to carry out floating point operations i.e. they didn't have the support for vector instructions like VX/VL, etc.

Starting with Go1.19, z13 is the minimum hardware level for running Go on LoZ (s390x). The main cause of this issue was the refactoring of elliptic curve to internal/nistec. The new code structures made it difficult to dynamically switch implementations at runtime, so it became necessary (in order machines to continue to use the accelerated implementation) to require z13 as the minimum hardware.

Hence, Go programs, when run on unsupported hardware, should crash on startup instead of crashing out in crypto code.

Fixes: #58465
Change-Id: I7c1a816205d19b5ddd2f1464839d16fa96815384
Reviewed-on: https://go-review.googlesource.com/c/go/+/499495
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Bypass: Cherry Mui <cherryyz@google.com>

10 months agogo/types, types2: instantiated interfaces must be concurrency safe
Rob Findley [Tue, 25 Jul 2023 15:57:37 +0000 (11:57 -0400)]
go/types, types2: instantiated interfaces must be concurrency safe

It is the responsibility of go/types to complete any interface it
creates, except for those created by the user using NewInterface.
However, this was not being done for interfaces created during
instantiation.

Fix this by (rather carefully) ensuring that all newly created
interfaces are eventually completed.

Fixes golang/go#61561

Change-Id: I3926e7c9cf80714838d2c1b5f36a2d3221c60c41
Reviewed-on: https://go-review.googlesource.com/c/go/+/513015
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
10 months agogo/types, types2: remove internal constant enableInterfaceInference
Robert Griesemer [Tue, 1 Aug 2023 04:46:31 +0000 (21:46 -0700)]
go/types, types2: remove internal constant enableInterfaceInference

We're not going to disable this functionality as it would
invalidate code that now type-checks with type inference
based on this mechanism.

Change-Id: Ib11059e2f70a5a209693b06f754cba862e3650ec
Reviewed-on: https://go-review.googlesource.com/c/go/+/514715
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>

10 months agocmd/compile/internal/mips: use hardware NOP instruction as NOOP on mips platform
Junxian Zhu [Wed, 12 Jul 2023 11:07:55 +0000 (19:07 +0800)]
cmd/compile/internal/mips: use hardware NOP instruction as NOOP on mips platform

This CL uses mips hardware NOP instruction as NOOP on mips platform, instead of pseudo NOP "nor $zero,$zero,$zero".

Change-Id: I336e1ba4228b71e6bfc6be66b367a4327fb3b36e
Reviewed-on: https://go-review.googlesource.com/c/go/+/509015
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Joel Sing <joel@sing.id.au>
Run-TryBot: Joel Sing <joel@sing.id.au>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
10 months agotext/template, html/template: use reflect.TypeFor for known types
Ian Lance Taylor [Mon, 31 Jul 2023 22:24:18 +0000 (15:24 -0700)]
text/template, html/template: use reflect.TypeFor for known types

For #60088

Change-Id: Ibc3983ca5cfe396087ddfa96c43cfe32ca47129a
Reviewed-on: https://go-review.googlesource.com/c/go/+/514640
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>

10 months agoencoding/json: use reflect.TypeFor for known types
Ian Lance Taylor [Mon, 31 Jul 2023 22:18:12 +0000 (15:18 -0700)]
encoding/json: use reflect.TypeFor for known types

For #60088

Change-Id: I2e471c76de62944b14472966b63f5778124b9b8b
Reviewed-on: https://go-review.googlesource.com/c/go/+/514655
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Joseph Tsai <joetsai@digital-static.net>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
10 months agoencoding/xml: use reflect.TypeFor for known types
Ian Lance Taylor [Mon, 31 Jul 2023 22:20:54 +0000 (15:20 -0700)]
encoding/xml: use reflect.TypeFor for known types

For #60088

Change-Id: Ib2589b994d304cca1f2e2081639959d80818ac7f
Reviewed-on: https://go-review.googlesource.com/c/go/+/514639
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
10 months agoos/exec: Use the built-in function min instead of minInt
apocelipes [Mon, 31 Jul 2023 19:40:37 +0000 (19:40 +0000)]
os/exec: Use the built-in function min instead of minInt

The built-in function `min` has been implemented and can now be used to replace some manually written `minType` helper functions.

Change-Id: Ie8ffc7881c8652ece752751214f1242bf76a6e7e
GitHub-Last-Rev: 5db344f13142c78f437571e3a1cdc0b02c0589cb
GitHub-Pull-Request: golang/go#60866
Reviewed-on: https://go-review.googlesource.com/c/go/+/504315
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: qiulaidongfeng <2645477756@qq.com>
10 months agoarchive/tar: narrow trim range for formatter'formatString
Jes Cok [Mon, 12 Jun 2023 12:09:44 +0000 (12:09 +0000)]
archive/tar: narrow trim range for formatter'formatString

Trim s[:len(b)-1] rather than s[:len(b)], since s[len(b)-1] is '/'.

Change-Id: I055da555810c112774549bd13d4faa8bfa0a60dc
GitHub-Last-Rev: 457977514d75a6c72086c2f4d89fb601280b8b90
GitHub-Pull-Request: golang/go#60729
Reviewed-on: https://go-review.googlesource.com/c/go/+/502376
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
10 months agoencoding/gob: use reflect.TypeFor for known types
Ian Lance Taylor [Mon, 31 Jul 2023 17:30:27 +0000 (10:30 -0700)]
encoding/gob: use reflect.TypeFor for known types

This avoids several mildly confusing Elem calls.

For #60088

Change-Id: If7b83d2ab10537c7e886a035b43cb272130c1669
Reviewed-on: https://go-review.googlesource.com/c/go/+/514455
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

10 months agotime: mention time resolution in docs
qmuntal [Mon, 31 Jul 2023 09:00:40 +0000 (11:00 +0200)]
time: mention time resolution in docs

Updates #44343
Updates #53824

Change-Id: Ia7234fac4b1b88b3c331328aaa98dc85205e09ba
Reviewed-on: https://go-review.googlesource.com/c/go/+/514275
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Quim Muntal <quimmuntal@gmail.com>

10 months agosync: panic rather than throw on nil *Pool
Ian Lance Taylor [Sat, 29 Jul 2023 15:59:20 +0000 (08:59 -0700)]
sync: panic rather than throw on nil *Pool

Fixes #61651

Change-Id: I27d581719e6bf38910f9d47dcf023bbff74ddf72
Reviewed-on: https://go-review.googlesource.com/c/go/+/514037
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>

10 months agonet/http: fix doc comment on FormValue function
Eduard Bondarenko [Wed, 26 Jul 2023 16:28:28 +0000 (16:28 +0000)]
net/http: fix doc comment on FormValue function

This function checks Request.Form, which now includes values parsed from a PATCH request.

Fixes #60585

Change-Id: Icb095d9ac2f8b0c5dbf313e507ed838cb941517f
GitHub-Last-Rev: 3a477ea97e27f5b31d28085df75163fc13541c13
GitHub-Pull-Request: golang/go#61591
Reviewed-on: https://go-review.googlesource.com/c/go/+/513435
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Damien Neil <dneil@google.com>

10 months agoregexp/syntax: accept (?<name>...) syntax as valid capture
Mauri de Souza Meneguzzo [Sat, 29 Jul 2023 20:26:00 +0000 (20:26 +0000)]
regexp/syntax: accept (?<name>...) syntax as valid capture

Currently the only named capture supported by regexp is (?P<name>a).

The syntax (?<name>a) is also widely used and there is currently an effort from
 the Rust regex and RE2 teams to also accept this syntax.

Fixes #58458

Change-Id: If22d44d3a5c4e8133ec68238ab130c151ca7c5c5
GitHub-Last-Rev: 31b50e6ab40cfb0f36df6f570525657d4680017f
GitHub-Pull-Request: golang/go#61624
Reviewed-on: https://go-review.googlesource.com/c/go/+/513838
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
10 months agodoc/go_mem: explain arrays, structs, and complex numbers
Russ Cox [Mon, 31 Jul 2023 18:01:00 +0000 (14:01 -0400)]
doc/go_mem: explain arrays, structs, and complex numbers

Arrays, structs, and complex numbers are collections of values that
are handled separately by the memory model.

An earlier version may have said this, but the current version does not.
Say it.

Change-Id: If3928bed6659e58e688f88aa0dde05423cbb3820
Reviewed-on: https://go-review.googlesource.com/c/go/+/514476
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
10 months agoerrors: optimize *joinError's Error method for less allocation and faster execution
Jes Cok [Tue, 6 Jun 2023 23:25:42 +0000 (23:25 +0000)]
errors: optimize *joinError's Error method for less allocation and faster execution

Handle the case of one error at the beginning.
Use unsafe.String to avoid memory allocation when converting byte slice to string.

Change-Id: Ib23576f72b1d87489e6f17762be483f62ca4998a
GitHub-Last-Rev: ed8003bfbcae8efd42e54895db0554c139b9d3a7
GitHub-Pull-Request: golang/go#60026
Reviewed-on: https://go-review.googlesource.com/c/go/+/493237
Reviewed-by: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>

10 months agodebug/buildinfo: read full data segment to lookup buildinfo magic
Alexander Yastrebov [Sat, 29 Jul 2023 17:00:35 +0000 (17:00 +0000)]
debug/buildinfo: read full data segment to lookup buildinfo magic

Fixes #61644

Change-Id: I7d40c33e65221994bb6865d22dd0994545603ba8
GitHub-Last-Rev: aca92afcbdef2dd191ed0e5c61da29d3b1cb0698
GitHub-Pull-Request: golang/go#61649
Reviewed-on: https://go-review.googlesource.com/c/go/+/514075
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
10 months agoencoding/json: optimize Unmarshal for maps
korzhao [Sun, 30 Jul 2023 07:02:15 +0000 (15:02 +0800)]
encoding/json: optimize Unmarshal for maps

benchmark                    old ns/op     new ns/op     delta
BenchmarkUnmarshalMap-10     218           172           -21.28%

benchmark                    old allocs     new allocs     delta
BenchmarkUnmarshalMap-10     15             12             -20.00%

benchmark                    old bytes     new bytes     delta
BenchmarkUnmarshalMap-10     328           256           -21.95%

Change-Id: Ie20ab62731c752eb0040c6d1591fedd7d12b1e0c
Reviewed-on: https://go-review.googlesource.com/c/go/+/514100
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

10 months agocmd/compile: try to rewrite loops to count down
Jorropo [Tue, 25 Jul 2023 14:19:10 +0000 (16:19 +0200)]
cmd/compile: try to rewrite loops to count down

Fixes #61629

This reduce the pressure on regalloc because then the loop only keep alive
one value (the iterator) instead of the iterator and the upper bound since
the comparison now acts against an immediate, often zero which can be skipped.

This optimize things like:
  for i := 0; i < n; i++ {
Or a range over a slice where the index is not used:
  for _, v := range someSlice {
Or the new range over int from #61405:
  for range n {

It is hit in 975 unique places while doing ./make.bash.

Change-Id: I5facff8b267a0b60ea3c1b9a58c4d74cdb38f03f
Reviewed-on: https://go-review.googlesource.com/c/go/+/512935
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>

10 months ago.github: fix templates with multiple labels
Sean Liao [Sun, 30 Jul 2023 08:46:55 +0000 (09:46 +0100)]
.github: fix templates with multiple labels

Also Go2 -> v2

Change-Id: Icde8ffc4a1ee2e43241a3dcd00ff0c48992b1e25
Reviewed-on: https://go-review.googlesource.com/c/go/+/514175
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Bypass: Dmitri Shuralyov <dmitshur@golang.org>

10 months agodebug/elf: don't use reflection in File.Symbols
Tolya Korniltsev [Mon, 24 Jul 2023 06:11:48 +0000 (13:11 +0700)]
debug/elf: don't use reflection in File.Symbols

cpu: AMD Ryzen 9 5950X 16-Core Processor
             |   old.txt    |               new.txt                |
             |    sec/op    |    sec/op     vs base                |
Symbols64-32   18.486µ ± 2%   4.509µ ± 24%  -75.61% (p=0.000 n=10)
Symbols32-32   17.823µ ± 3%   4.798µ ±  2%  -73.08% (p=0.000 n=10)
geomean         18.15µ        4.651µ        -74.38%

             |    old.txt    |               new.txt                |
             |     B/op      |     B/op      vs base                |
Symbols64-32   10.680Ki ± 0%   8.922Ki ± 0%  -16.46% (p=0.000 n=10)
Symbols32-32    9.773Ki ± 0%   8.570Ki ± 0%  -12.31% (p=0.000 n=10)
geomean         10.22Ki        8.744Ki       -14.41%

             |   old.txt   |              new.txt               |
             |  allocs/op  | allocs/op   vs base                |
Symbols64-32   119.00 ± 0%   45.00 ± 0%  -62.18% (p=0.000 n=10)
Symbols32-32   125.00 ± 0%   50.00 ± 0%  -60.00% (p=0.000 n=10)
geomean         122.0        47.43       -61.11%

Fixes #61534

Change-Id: I13a96467108771df31f018853df754e42100e773
Reviewed-on: https://go-review.googlesource.com/c/go/+/512395
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

10 months agoarchive/zip: add AddFS method to zip Writer
Mauri de Souza Meneguzzo [Thu, 27 Jul 2023 23:11:59 +0000 (23:11 +0000)]
archive/zip: add AddFS method to zip Writer

The method AddFS can be used to add the contents of a fs.FS filesystem
to a zip archive.
This method walks the directory tree starting at the root of the filesystem
and adds each file to the archive.

Fixes #54898

Change-Id: I80511cbd91a1d7e09ee52d2d1b09fb5eed25f45f
GitHub-Last-Rev: 1e17f2e6bae60cf5168d687dd1357ab58a883675
GitHub-Pull-Request: golang/go#61602
Reviewed-on: https://go-review.googlesource.com/c/go/+/513438
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>

10 months agocmd/internal/obj/mips: use more appropriate register types for OP_FRRR/OP_SRR
Joel Sing [Fri, 28 Jul 2023 16:03:38 +0000 (02:03 +1000)]
cmd/internal/obj/mips: use more appropriate register types for OP_FRRR/OP_SRR

Rather than passing registers as uint32, use int16 and cast to uint32 in
the OP_FRRR/OP_SRR implementation. This allows a large number of casts to be
removed and code simplified at call sites.

Change-Id: Ia4bf3bd022f79d65e45fca64db13db12739e5b23
Reviewed-on: https://go-review.googlesource.com/c/go/+/514099
Run-TryBot: Joel Sing <joel@sing.id.au>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Rong Zhang <rongrong@oss.cipunited.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>

10 months agocmd/internal/obj/mips: use more appropriate register types for OP_IRR
Joel Sing [Fri, 28 Jul 2023 10:20:39 +0000 (20:20 +1000)]
cmd/internal/obj/mips: use more appropriate register types for OP_IRR

Rather than passing registers as uint32, use int16 and cast to uint32 in
the OP_IRR implementation. This allows a large number of casts to be removed
and code simplified at call sites. Also be more consistent with op, register
and value ordering.

Change-Id: I510347d97787ce80a338037b25470addf3a2939d
Reviewed-on: https://go-review.googlesource.com/c/go/+/514098
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Joel Sing <joel@sing.id.au>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Rong Zhang <rongrong@oss.cipunited.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>

10 months agocmd/internal/obj/mips: use more appropriate register types for OP_RRR
Joel Sing [Fri, 28 Jul 2023 09:59:36 +0000 (19:59 +1000)]
cmd/internal/obj/mips: use more appropriate register types for OP_RRR

Rather than passing registers as uint32, use int16 and cast to uint32 in
the OP_RRR implementation. This allows a large number of casts to be removed
and code simplified at call sites.

Change-Id: I2194ea07a6f89861530cd88c4b60c993bb0fa0c1
Reviewed-on: https://go-review.googlesource.com/c/go/+/514097
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rong Zhang <rongrong@oss.cipunited.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>
TryBot-Result: Gopher Robot <gobot@golang.org>

10 months agocmd/internal/obj/mips: use obj.REG_NONE rather than 0
Joel Sing [Fri, 28 Jul 2023 09:27:22 +0000 (19:27 +1000)]
cmd/internal/obj/mips: use obj.REG_NONE rather than 0

Instead of comparing register values to 0, use obj.REG_NONE to improve
readability. No functional change.

Change-Id: I848f7ab7e27fe7e5e9fe2caf9cce47e372c6cd6c
Reviewed-on: https://go-review.googlesource.com/c/go/+/514096
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Rong Zhang <rongrong@oss.cipunited.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Junxian Zhu <zhujunxian@oss.cipunited.com>
10 months agocmd/go: make go list -m -u all not complain about missing checksums
Russ Cox [Thu, 27 Jul 2023 19:56:37 +0000 (15:56 -0400)]
cmd/go: make go list -m -u all not complain about missing checksums

This is a band-aid of a fix for Go 1.21, to create space to work on
a real fix for Go 1.22, if in fact the real fix is different. It simply
disables the go.sum update check during go list -m -u.
I don't have a self-contained test for the breakage. See #61605.
All existing tests continue to pass.

For #61605.
After merging into the Go 1.21 branch we can move #61605 to the Go 1.22 milestone.

Change-Id: Ib155710092003f08d2a6ce0aefa8e0270cad5a5c
Reviewed-on: https://go-review.googlesource.com/c/go/+/513778
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

10 months agocmd/link: fix up more zero-sized local symbols on darwin dynamic linking
Cherry Mui [Wed, 14 Jun 2023 21:09:30 +0000 (17:09 -0400)]
cmd/link: fix up more zero-sized local symbols on darwin dynamic linking

When dynamic linking on darwin, the darwin linker doesn't link
relocations pointing to zero-sized local symbols, like our
start/end marker symbols, e.g. runtime.text and runtime.etext.
It will choose to resolve to another symbol on the same address
that may not be local, therefore that reference may point to a
different DSO, which is not what we want. We already fix up some
marker symbols, like text/etext, data/edata, bss/ebss. But we
currently don't fix up noptrdata and noptrbss. With the new
darwin linker ld-prime, this causes problems when building a
plugin. Fix up those symbols.

For #61229.

Change-Id: I2181bb9184b85af9a3c3f5dc6d78e4d5a1d56d53
Reviewed-on: https://go-review.googlesource.com/c/go/+/503538
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

10 months agogo/types: add test cases for generic constraints, types and functions
Hiro [Mon, 31 Jul 2023 08:50:43 +0000 (08:50 +0000)]
go/types: add test cases for generic constraints, types and functions

Dups: #60856
For #60817

Change-Id: Ic0710758e170d6ceed66649fec08ef8054be4d6b
GitHub-Last-Rev: 8bbc76aaa704f102f9eabdfead45da452e1ea6e6
GitHub-Pull-Request: golang/go#61664
Reviewed-on: https://go-review.googlesource.com/c/go/+/514255
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>

10 months agocmd/link: always use symbol-targeted relocations on Mach-O
Cherry Mui [Thu, 15 Jun 2023 21:25:08 +0000 (17:25 -0400)]
cmd/link: always use symbol-targeted relocations on Mach-O

In Mach-O object files, there are two kinds of relocations:
"external" relocation, which targets a symbol, and "non-external"
relocation, which targets a section. For targeting symbols not in
the current object, we must use symbol-targeted relocations. For
targeting symbols defined in the current object, for some
relocation types, both kinds can be used. We currently use
section-targeted relocations for R_ADDR targeting locally defined
symbols.

Modern Apple toolchain seems to prefer symbol-targeted relocations.
Also, Apple's new linker, ld-prime, seems to not handle section-
targeted relocations well in some cases. So this CL switches to
always generate symbol-targeted relocations. This also simplifies
the code.

One exception is that DWARF tools seem to handle only section-
targeted relocations. So generate those in DWARF sections.

This CL supersedes CL 502616.

Fixes #60694.
For #61229.

Change-Id: I3b74df64f21114635061bcd89114392b3a2d588b
Reviewed-on: https://go-review.googlesource.com/c/go/+/503935
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

10 months agocmd/link: use symbol-targeted relocation for initializers on Mach-O
Cherry Mui [Mon, 12 Jun 2023 17:42:30 +0000 (13:42 -0400)]
cmd/link: use symbol-targeted relocation for initializers on Mach-O

Apple's new linker, ld-prime from Xcode 15 beta, when handling
initializers in __mod_init_func, drops the offset in the data,
resolving the relocation to the beginning of the section. The
latest version of ld-prime rejects non-zero addend. We need to use
symbol-targeted "external" relocations, so that it doesn't need
an addend and can be resolved correctly. This also works fine with
ld64.

Fixes #60694.
For #61229.

Change-Id: Ida2be6aa4c91bfcd142b755e2ec63aabfbbd77a6
Reviewed-on: https://go-review.googlesource.com/c/go/+/502616
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

10 months agoruntime: refactor defer processing
Matthew Dempsky [Thu, 27 Jul 2023 23:20:36 +0000 (16:20 -0700)]
runtime: refactor defer processing

This CL refactors gopanic, Goexit, and deferreturn to share a common
state machine for processing pending defers. The new state machine
removes a lot of redundant code and does overall less work.

It should also make it easier to implement further optimizations
(e.g., TODOs added in this CL).

Change-Id: I71d3cc8878a6f951d8633505424a191536c8e6b3
Reviewed-on: https://go-review.googlesource.com/c/go/+/513837
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

10 months agocmd/internal/obj/arm64: improve splitting of 24 bit unsigned scaled immediates
Joel Sing [Sat, 29 Apr 2023 10:29:41 +0000 (20:29 +1000)]
cmd/internal/obj/arm64: improve splitting of 24 bit unsigned scaled immediates

The previous implementation would limit itself to 0xfff000 | 0xfff << shift,
while the maximum possible value is 0xfff000 + 0xfff << shift. In practical
terms, this means that an additional ((1 << shift) - 1) * 0x1000 of offset
is reachable for operations that use this splitting format. In the case of
an 8 byte load/store, this is an additional 0x7000 that can be reached
without needing to use the literal pool.

Updates #59615

Change-Id: Ice7023104042d31c115eafb9398c2b999bdd6583
Reviewed-on: https://go-review.googlesource.com/c/go/+/512540
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>

10 months agospec: add Appendix with detailed type unification rules
Robert Griesemer [Wed, 26 Jul 2023 00:18:20 +0000 (17:18 -0700)]
spec: add Appendix with detailed type unification rules

Change-Id: I0d4ccbc396c48d565c0cbe93c9558ab330a44d02
Reviewed-on: https://go-review.googlesource.com/c/go/+/513275
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Bypass: Robert Griesemer <gri@google.com>

10 months agocmd/internal/obj/arm64: avoid unnecessary literal pool usage for moves
Joel Sing [Wed, 3 May 2023 11:56:18 +0000 (21:56 +1000)]
cmd/internal/obj/arm64: avoid unnecessary literal pool usage for moves

In a number of load and store cases, the use of the literal pool can be
entirely avoided by simply adding or subtracting the offset from the
register. This uses the same number of instructions, while avoiding a
load from memory, along with the need for the value to be in the literal
pool. Overall this reduces the size of binaries slightly and should have
lower overhead.

Updates #59615

Change-Id: I9cb6a403dc71e34a46af913f5db87dbf52f8688c
Reviewed-on: https://go-review.googlesource.com/c/go/+/512539
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>

10 months agocmd/internal/obj/arm64: improve classification of loads and stores
Joel Sing [Mon, 1 May 2023 17:42:30 +0000 (03:42 +1000)]
cmd/internal/obj/arm64: improve classification of loads and stores

Currently, pool literals are added when they are not needed, namely
in the case where the offset is a 24 bit unsigned scaled immediate.
By improving the classification of loads and stores, we can avoid
generating unused pool literals. However, more importantly this
provides a basis for further improvement of the load and store
code generation.

Updates #59615

Change-Id: Ia3bad1709314565a05894a76c434cca2fa4533c4
Reviewed-on: https://go-review.googlesource.com/c/go/+/512538
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>
TryBot-Result: Gopher Robot <gobot@golang.org>

10 months agomath: enable huge argument tests on s390x
Srinivas Pokala [Fri, 14 Jul 2023 05:49:03 +0000 (07:49 +0200)]
math: enable huge argument tests on s390x

new s390x assembly implementation of Sin/Cos/SinCos/Tan handle huge argument
test's.

Updates #29240

Change-Id: I9f22d9714528ef2af52c749079f3727250089baf
Reviewed-on: https://go-review.googlesource.com/c/go/+/509675
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

10 months agoreflect: add TypeFor
Carl Johnson [Thu, 27 Jul 2023 01:21:48 +0000 (01:21 +0000)]
reflect: add TypeFor

Fixes #60088

Change-Id: I7b43d329def22c2524501ba1d6bfc73becc823d1
GitHub-Last-Rev: becd714c4562da4a3280c3a56ebaf246e48e9f37
GitHub-Pull-Request: golang/go#61598
Reviewed-on: https://go-review.googlesource.com/c/go/+/513478
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>

10 months agoreflect: optimize DeepEqual() for maps
korzhao [Thu, 6 Jul 2023 03:12:29 +0000 (11:12 +0800)]
reflect: optimize DeepEqual() for maps

benchmark                     old ns/op     new ns/op     delta
BenchmarkMapsDeepEqual-10     235           200           -15.05%

benchmark                     old allocs     new allocs     delta
BenchmarkMapsDeepEqual-10     7              6              -14.29%

benchmark                     old bytes     new bytes     delta
BenchmarkMapsDeepEqual-10     96            48            -50.00%

Change-Id: Ifa625ad25524cc9ee438711917606626b33a9597
Reviewed-on: https://go-review.googlesource.com/c/go/+/512576
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>

10 months agonet: ignore blackhole route in TestDialCancel
Meng Zhuo [Thu, 27 Jul 2023 08:20:58 +0000 (16:20 +0800)]
net: ignore blackhole route in TestDialCancel

CL 496037 had ignored 3 types of null route, however blackhole route
is not included i.e. on Linux we can add a blackhole route by
`ip route add blackhole 198.18.0.254/32`

Fixes #61590

Change-Id: I9ddb86c5be0e5e261afa96cbaf55d9fdf30b2795
Reviewed-on: https://go-review.googlesource.com/c/go/+/513595
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: M Zhuo <mzh@golangcn.org>

10 months agomath: huge argument handling for sin/cos in s390x
Srinivas Pokala [Mon, 20 Feb 2023 06:10:37 +0000 (07:10 +0100)]
math: huge argument handling for sin/cos in s390x

Currently s390x, sin/cos assembly implementation not handling huge
arguments. This change reverts assembly routine to native go implementation
for huge arguments. Implementing the changes in assembly giving better
performance than native go changes in terms of execution/cycles.

name                                         Go_changes     Asm_changes
Sin/input_size_(0.5)-8                      11.85ns ± 0%   5.32ns ± 1%
Sin/input_size_(1<<20)-8                    15.32ns ± 0%   9.75ns ± 3%
Sin/input_size_(1<<_40)-8                   17.9ns  ± 0%   10.3ns ± 6%
Sin/input_size_(1<<50)-8                    16.33ns ± 0%   9.75ns ± 6%
Sin/input_size_(1<<60)-8                    33.0ns  ± 1%   29.1ns ± 0%
Sin/input_size_(1<<80)-8                    29.9ns  ± 0%   27.2ns ± 2%
Sin/input_size_(1<<200)-8                   31.5ns  ± 1%   28.3ns ± 0%
Sin/input_size_(1<<480)-8                   29.4ns  ± 1%   28.0ns ± 1%
Sin/input_size_(1234567891234567_<<_180)-8  29.3ns  ± 1%   28.0ns ± 0%
Cos/input_size_(0.5)-8                      10.33ns ± 0%   5.69ns ± 1%
Cos/input_size_(1<<20)-8                    16.67ns ± 0%   9.18ns ± 0%
Cos/input_size_(1<<_40)-8                   18.50ns ± 0%   9.45ns ± 3%
Cos/input_size_(1<<50)-8                    16.67ns ± 0%   9.18ns ± 1%
Cos/input_size_(1<<60)-8                    31.6ns  ± 1%   26.7ns ± 2%
Cos/input_size_(1<<80)-8                    31.3ns  ± 0%   25.5ns ± 1%
Cos/input_size_(1<<200)-8                   30.0ns  ± 0%   26.7ns ± 1%
Cos/input_size_(1<<480)-8                   31.9ns  ±2%   27.0ns ± 0%
Cos/input_size_(1234567891234567_<<_180)-8  31.8ns  ± 0%   26.9ns ± 0%

Fixes #29240

Change-Id: Id2ebcfa113926f27510d527e80daaddad925a707
Reviewed-on: https://go-review.googlesource.com/c/go/+/469635
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bill O'Farrell <billotosyr@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>