1
0
mirror of https://github.com/golang/go synced 2024-09-29 11:44:31 -06:00
Commit Graph

57344 Commits

Author SHA1 Message Date
Jorropo
bac4e2f241 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>
2023-07-31 18:33:29 +00:00
Sean Liao
8613ef81e6 .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>
2023-07-31 18:28:27 +00:00
Tolya Korniltsev
734de5e526 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>
2023-07-31 18:12:47 +00:00
Mauri de Souza Meneguzzo
845fff35c6 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: 1e17f2e6ba
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>
2023-07-31 18:10:41 +00:00
Joel Sing
789980ec0e 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>
2023-07-31 18:05:11 +00:00
Joel Sing
48f431ee3c 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>
2023-07-31 18:05:08 +00:00
Joel Sing
f6966577a2 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>
2023-07-31 18:04:35 +00:00
Joel Sing
24af43fa66 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>
2023-07-31 18:04:32 +00:00
Russ Cox
8a83ef8479 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>
2023-07-31 17:52:48 +00:00
Cherry Mui
e417698e84 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>
2023-07-31 17:37:16 +00:00
Hiro
463887d5cc go/types: add test cases for generic constraints, types and functions
Dups: #60856
For #60817

Change-Id: Ic0710758e170d6ceed66649fec08ef8054be4d6b
GitHub-Last-Rev: 8bbc76aaa7
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>
2023-07-31 17:08:18 +00:00
Cherry Mui
be910bf2fd 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>
2023-07-31 17:02:24 +00:00
Cherry Mui
bad9ca8a61 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>
2023-07-31 17:01:57 +00:00
Matthew Dempsky
9eb1d5317b 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>
2023-07-31 16:52:06 +00:00
Joel Sing
6eaad824e5 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>
2023-07-31 16:39:36 +00:00
Robert Griesemer
03bec7dc6f 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>
2023-07-31 16:39:02 +00:00
Joel Sing
208fc13245 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>
2023-07-31 16:38:47 +00:00
Joel Sing
3313b39bae 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>
2023-07-31 16:37:49 +00:00
Srinivas Pokala
a37da52d75 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>
2023-07-31 16:23:41 +00:00
Carl Johnson
42d2dfb430 reflect: add TypeFor
Fixes #60088

Change-Id: I7b43d329def22c2524501ba1d6bfc73becc823d1
GitHub-Last-Rev: becd714c45
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>
2023-07-31 15:50:15 +00:00
korzhao
f024e390bb 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>
2023-07-31 15:44:01 +00:00
Meng Zhuo
c17e0cd2da 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>
2023-07-31 15:43:06 +00:00
Srinivas Pokala
20ea988421 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>
2023-07-31 04:25:54 +00:00
Junxian Zhu
b1474672c6 cmd/compile: intrinsify Sub64 on mips64
This CL intrinsify Sub64 on mips64.

pkg: math/bits
                  _   sec/op    _   sec/op     vs base               _
Sub-4               2.849n _ 0%   1.948n _ 0%  -31.64% (p=0.000 n=8)
Sub32-4             3.447n _ 0%   3.446n _ 0%        ~ (p=0.982 n=8)
Sub64-4             2.815n _ 0%   1.948n _ 0%  -30.78% (p=0.000 n=8)
Sub64multiple-4     6.124n _ 0%   3.340n _ 0%  -45.46% (p=0.000 n=8)

Change-Id: Ibba91a4350e4a549ae0b60d8cafc4bca05034b84
Reviewed-on: https://go-review.googlesource.com/c/go/+/498497
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Joel Sing <joel@sing.id.au>
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2023-07-31 03:59:48 +00:00
Junxian Zhu
5f8a2fdf09 cmd/compile: intrinsify Add64 on mips64
This CL intrinsify Add64 on mips64.

pkg: math/bits
                  _   sec/op    _   sec/op     vs base               _
Add64-4             2.783n _ 0%   1.950n _ 0%  -29.93% (p=0.000 n=8)
Add64multiple-4     5.713n _ 0%   3.063n _ 0%  -46.38% (p=0.000 n=8)

pkg: crypto/elliptic
                                     _    sec/op    _   sec/op     vs base               _
ScalarBaseMult/P256-4                   353.7_ _ 0%   282.7_ _ 0%  -20.09% (p=0.000 n=8)
ScalarBaseMult/P224-4                   330.5_ _ 0%   250.0_ _ 0%  -24.37% (p=0.000 n=8)
ScalarBaseMult/P384-4                  1228.8_ _ 0%   791.5_ _ 0%  -35.59% (p=0.000 n=8)
ScalarBaseMult/P521-4                  15.412m _ 0%   2.438m _ 0%  -84.18% (p=0.000 n=8)
ScalarMult/P256-4                      1189.4_ _ 0%   904.2_ _ 0%  -23.98% (p=0.000 n=8)
ScalarMult/P224-4                      1138.8_ _ 0%   813.8_ _ 0%  -28.54% (p=0.000 n=8)
ScalarMult/P384-4                       4.419m _ 0%   2.692m _ 0%  -39.08% (p=0.000 n=8)
ScalarMult/P521-4                      59.768m _ 0%   8.773m _ 0%  -85.32% (p=0.000 n=8)
MarshalUnmarshal/P256/Uncompressed-4    8.697_ _ 1%   7.923_ _ 1%   -8.91% (p=0.000 n=8)
MarshalUnmarshal/P256/Compressed-4     104.75_ _ 0%   66.29_ _ 0%  -36.72% (p=0.000 n=8)
MarshalUnmarshal/P224/Uncompressed-4    8.728_ _ 1%   7.823_ _ 1%  -10.37% (p=0.000 n=8)
MarshalUnmarshal/P224/Compressed-4     1035.7_ _ 0%   676.5_ _ 2%  -34.69% (p=0.000 n=8)
MarshalUnmarshal/P384/Uncompressed-4    15.32_ _ 1%   11.81_ _ 1%  -22.90% (p=0.000 n=8)
MarshalUnmarshal/P384/Compressed-4      399.8_ _ 0%   217.4_ _ 0%  -45.62% (p=0.000 n=8)
MarshalUnmarshal/P521/Uncompressed-4    96.79_ _ 0%   20.32_ _ 0%  -79.01% (p=0.000 n=8)
MarshalUnmarshal/P521/Compressed-4     6640.4_ _ 0%   790.8_ _ 0%  -88.09% (p=0.000 n=8)

Change-Id: I8a0960b9665720c1d3e57dce36386e74db37fefa
Reviewed-on: https://go-review.googlesource.com/c/go/+/498496
Reviewed-by: Heschi Kreinick <heschi@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Joel Sing <joel@sing.id.au>
Reviewed-by: Keith Randall <khr@golang.org>
2023-07-31 03:58:42 +00:00
korzhao
457721cd52 encoding/json: replace dead link in appendString
Change-Id: I534698008b46b23352d9f1fed891fd96dc0947b7
Reviewed-on: https://go-review.googlesource.com/c/go/+/507115
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
2023-07-29 03:21:50 +00:00
Dmitri Shuralyov
d8c75273cf cmd/dist: update isUnsupportedVMASize test skip
The dist test name changed from "race" to "flag:race", "net:race",
"os:race" and so on in CL 496181, we missed that this skip was checking
the exact dist test name, and no builder reported a problem despite the
skip becoming inactive.

I considered deleting it as obsolete, but it may still be helpful
if someone runs race.bash on a linux/arm64 machine configured with
something other than the supported 48-bit VMA. So for now apply a
simple change to restore the existing skip.

Hopefully one day there will be a good way to check for unsupported VMA
size and disable the race detector conditionally instead of relying on
tests running, failing, and getting marked as skipped in cmd/dist.

For #29948.
For #37486.

Change-Id: I8af6862c92fb0ee538ab27327d43c50921bd1873
Reviewed-on: https://go-review.googlesource.com/c/go/+/512116
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2023-07-28 22:09:45 +00:00
Dmitri Shuralyov
ad90eeffa5 cmd/dist: handle -json flag in runPending (clean up)
Document work fields a bit more, and move code that
synthesizes JSON-encoded skip events to testjson.go.

For #37486.
For #61557.

Change-Id: Iffc23cf990bc39696e1e3fce8ce5a6790fc44e78
Reviewed-on: https://go-review.googlesource.com/c/go/+/512115
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2023-07-28 22:09:42 +00:00
Dmitri Shuralyov
2ad666dea0 syscall, cmd/cgo: skip tests that shouldn't run under 'unshare -n -r'
A small number of tests in the main tree are currently skipped in LUCI
because our builders there run tests without root. Unfortunately, these
tests begin to run when run under 'unshare -n -r' as implemented in
the current iteration of a no-network check. Add targeted builder-only
skips so that they don't begin to run and fail with a false positive.

Updates #10719.
For #30612.

Change-Id: I6dd320714a279c395882c1b2ebfbb2fce58f913b
Reviewed-on: https://go-review.googlesource.com/c/go/+/513779
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-07-28 21:31:41 +00:00
Mauri de Souza Meneguzzo
f322d67ced cmd/asm: add PCALIGN support on 386/amd64
The PCALIGN asm directive was not supported on 386/amd64,
causing a compile-time error when used. The same directive
is currently supported on arm64, loong64 and ppc64 architectures.

This has potential for noticeable performance improvements on
amd64 across multiple packages, I did a quick test aligning a hot
loop on bytes.IndexByte:

```
IndexByte/10-16                 3.477n ± ∞ ¹   3.462n ± ∞ ¹        ~ (p=0.198 n=5)
IndexByte/32-16                 4.675n ± ∞ ¹   4.834n ± ∞ ¹   +3.40% (p=0.008 n=5)
IndexByte/4K-16                 67.47n ± ∞ ¹   44.44n ± ∞ ¹  -34.13% (p=0.008 n=5)
IndexByte/4M-16                 61.98µ ± ∞ ¹   45.07µ ± ∞ ¹  -27.28% (p=0.008 n=5)
IndexByte/64M-16               1206.6µ ± ∞ ¹   940.9µ ± ∞ ¹  -22.02% (p=0.008 n=5)
IndexBytePortable/10-16         4.064n ± ∞ ¹   4.044n ± ∞ ¹        ~ (p=0.325 n=5)
IndexBytePortable/32-16         9.999n ± ∞ ¹   9.934n ± ∞ ¹        ~ (p=0.151 n=5)
IndexBytePortable/4K-16         975.8n ± ∞ ¹   965.5n ± ∞ ¹        ~ (p=0.151 n=5)
IndexBytePortable/4M-16         973.3µ ± ∞ ¹   972.3µ ± ∞ ¹        ~ (p=0.222 n=5)
IndexBytePortable/64M-16        15.68m ± ∞ ¹   15.89m ± ∞ ¹        ~ (p=0.310 n=5)
geomean                         1.478µ         1.342µ         -9.20%

IndexByte/10-16                2.678Gi ± ∞ ¹   2.690Gi ± ∞ ¹        ~ (p=0.151 n=5)
IndexByte/32-16                6.375Gi ± ∞ ¹   6.165Gi ± ∞ ¹   -3.30% (p=0.008 n=5)
IndexByte/4K-16                56.54Gi ± ∞ ¹   85.85Gi ± ∞ ¹  +51.83% (p=0.008 n=5)
IndexByte/4M-16                63.03Gi ± ∞ ¹   86.68Gi ± ∞ ¹  +37.52% (p=0.008 n=5)
IndexByte/64M-16               51.80Gi ± ∞ ¹   66.42Gi ± ∞ ¹  +28.23% (p=0.008 n=5)
IndexBytePortable/10-16        2.291Gi ± ∞ ¹   2.303Gi ± ∞ ¹        ~ (p=0.421 n=5)
IndexBytePortable/32-16        2.980Gi ± ∞ ¹   3.000Gi ± ∞ ¹        ~ (p=0.151 n=5)
IndexBytePortable/4K-16        3.909Gi ± ∞ ¹   3.951Gi ± ∞ ¹        ~ (p=0.151 n=5)
IndexBytePortable/4M-16        4.013Gi ± ∞ ¹   4.017Gi ± ∞ ¹        ~ (p=0.222 n=5)
IndexBytePortable/64M-16       3.987Gi ± ∞ ¹   3.933Gi ± ∞ ¹        ~ (p=0.310 n=5)
geomean                        8.183Gi         9.013Gi        +10.14%
```

Fixes #56474

Change-Id: Idea022b1a16e6d4b8dd778723adb862c46602c4f
GitHub-Last-Rev: 2eb7e31dc3
GitHub-Pull-Request: golang/go#61516
Reviewed-on: https://go-review.googlesource.com/c/go/+/511662
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
2023-07-28 19:39:51 +00:00
Dmitri Shuralyov
9c62ef1243 syscall: skip TestUnshare if there's nothing more to unshare
Tests that need to use the internet are expected not to run when -short
test flag is set, and the Go build system automatically catches when a
test forgets that. It does this by unsharing all real network interfaces
and leaving only a loopback interface in a new network namespace.

TestUnshare tests that a process started with CLONE_NEWNET unshare flag
has fewer network interfaces than before. Of course, if /proc/net/dev
starts out with a single loopback interface, the test would fail with
a false positive:

=== RUN TestUnshare
exec_linux_test.go:139: Got 3 lines of output, want <3
--- FAIL: TestUnshare (0.00s)

Give the test what it wants: a skip when the environment doesn't meet
the minimum requirements for the test, and more useful log output if
it fails.

Change-Id: I6b9c29d88ce725e640a7ee86c7e1be9761f21b02
Reviewed-on: https://go-review.googlesource.com/c/go/+/513762
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
2023-07-28 17:55:45 +00:00
Jes Cok
b656fa3312 cmd/internal/goobj: use unsafe.String in toString func
Change-Id: I93a5e0996e48cc74e6b2e39c3a4c7aa68fd6a3a0
GitHub-Last-Rev: afd8feb0de
GitHub-Pull-Request: golang/go#61137
Reviewed-on: https://go-review.googlesource.com/c/go/+/507517
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
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: Keith Randall <khr@golang.org>
2023-07-28 17:25:53 +00:00
Dmitri Shuralyov
68d50ca271 cmd/dist: handle -json flag in runPending (minimal)
The -json flag is new to Go 1.21, but missed skips in runPending.
This CL adds minimal code to fix that. CL 512115 cleans up a bit.

For #37486.
Fixes (via backport) #61557.

Change-Id: I53e426c9a5585b2703f0ff6661a0470e1993f960
Reviewed-on: https://go-review.googlesource.com/c/go/+/512719
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
2023-07-28 16:46:36 +00:00
Dmitri Shuralyov
8488309192 net/http: perform streaming body feature detection once per process
As far a I can tell, there's currently no situation where this feature
detection will report a different result per request, so default to
doing once per process until there's evidence that doing it more often
is worthwhile.

Change-Id: I567d3dbd847af2f49f2e83cd9eb0ae61d82c1f83
Reviewed-on: https://go-review.googlesource.com/c/go/+/513459
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
2023-07-28 02:46:31 +00:00
root
a8a6f90a23 math: support to handle huge arguments in tan function on s390x
Currently on s390x, tan assembly implementation is not handling huge arguments at all. This change is to check for large arguments and revert back to native go implantation from assembly code in case of huge arguments.

The changes are implemented in assembly code to get better performance over native go implementation.

Benchmark details of tan function with table driven inputs are updated as part of the issue link.

Fixes #37854

Change-Id: I4e5321e65c27b7ce8c497fc9d3991ca8604753d2
Reviewed-on: https://go-review.googlesource.com/c/go/+/470595
Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
2023-07-27 23:30:00 +00:00
qiulaidongfeng
93ec88160e reflect: deprecate PtrTo
Replace reflect.PtrTo with reflect.PointerTo.

Fixes #59599

Change-Id: I49407193e2050543ef983cd637703acc682d9f51

Change-Id: I49407193e2050543ef983cd637703acc682d9f51
GitHub-Last-Rev: 7bc9ccf1dc
GitHub-Pull-Request: golang/go#61440
Reviewed-on: https://go-review.googlesource.com/c/go/+/511035
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2023-07-27 23:28:51 +00:00
Ian Lance Taylor
737a5b0eaa runtime: call miniterrno on m0 on AIX and Solaris
AIX and Solaris call into libc for syscalls, and expect M.mOS.perrno
to point to the thread-local errno value for the current M.
We initialize that field in miniterrno called from mstart.
However, this means that any libc calls before mstart will not
return the correct errno value.

This caused trouble in checkfds, which runs very early, before mstart.
We worked around that in 513215. This CL reverts 513215 in favor
of a better workaround: call miniterrno for m0 earlier (we will
still wind up calling miniterrno again from mstart, which does
no harm).

This is a better workaround because it means that if we add future
syscalls before mstart, they will behave as expected.

Fixes #61584

Change-Id: Ib6a0d3c53d2c8214cc339a5019f9d4f71a746f0c
Reviewed-on: https://go-review.googlesource.com/c/go/+/513535
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
2023-07-27 22:20:25 +00:00
Dmitri Shuralyov
9b0361e549 net: make mustHaveExternalNetwork work as usual on GOOS=linux
I considered deleting mustHaveExternalNetwork in favor of just using
the real testenv.MustHaveExternalNetwork. That certainly makes these
tests that call it easier to understand. But that negatively affects
some ports that don't have a longtest builder as it'd make the tests
not run automatically on any builder at all.

So, make a minimal change that applies only to GOOS=linux for now.
If we make more progress on establishing -longtest builders for all
ports, this intermediate layer helper will cease to have any benefit
and can be deleted in favor of the one in testenv package.

Change-Id: Iaea207d98e780db429ab49e6e227650a8b35b786
Reviewed-on: https://go-review.googlesource.com/c/go/+/513416
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
2023-07-27 22:07:17 +00:00
Jes Cok
3bc28402fa all: use built-in clear to clear maps
Change-Id: I7f4ac72fe3230d8b7486fab0c925015cefcbe355
GitHub-Last-Rev: 54455839b6
GitHub-Pull-Request: golang/go#61544
Reviewed-on: https://go-review.googlesource.com/c/go/+/512376
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-07-27 22:07:13 +00:00
Cherry Mui
1c10d743ea cmd/link: sort HOSTOBJ and UNDEFEXT symbols with undefined symbols in Mach-O symbol table
HOSTOBJ and UNDEFEXT symbols are actually not defined in the
current translation unit. So put them as undefined symbols, along
with DYNIMPORT.

For #61229.

Change-Id: I1112ca928cdc401bac45adaa3f88b19422813960
Reviewed-on: https://go-review.googlesource.com/c/go/+/503539
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2023-07-27 19:08:00 +00:00
Cherry Mui
333c80694c cmd/cgo/internal/test: don't pass -lm on darwin
On darwin, -lm is not necessary as the math functions are included
in libSystem. Passing -lm multiple times results in linker
warnings. Don't pass it on darwin.

For #61229.

Change-Id: I72d8dab1f0eead68cbeb176ac97b8ed1a0cfddab
Reviewed-on: https://go-review.googlesource.com/c/go/+/508697
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2023-07-27 19:07:25 +00:00
Cherry Mui
f55e7e104b cmd/link: don't generate DYSYMTAB when external linking on Mach-O
When external linking, the external linker will generate it.

Updates #60694.
For #61229.

Change-Id: I086a7628dd9baa84b46315641746fc3640473f2b
Reviewed-on: https://go-review.googlesource.com/c/go/+/502617
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-07-27 19:06:04 +00:00
Jes Cok
27927ed749 cmd/asm/internal/asm: fix comment grammar
Change-Id: I6fc0ae765c347669d1b061de018eb97d8e43461c
GitHub-Last-Rev: 9e6c1f1f97
GitHub-Pull-Request: golang/go#61131
Reviewed-on: https://go-review.googlesource.com/c/go/+/507515
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Joedian Reid <joedian@golang.org>
2023-07-27 18:57:49 +00:00
Dmitri Shuralyov
77863e4243 src/buildall.bash: mention no longer being used by Go build system
The buildall.bash script was initially added in 2015 (in CL 9438),
documented as used in the implementation of the new compile-only
builders at the time.

That description was updated as the builder implementation changed
from "linux-amd64-compilesmoke" to "all-compile" and most recently
to "misc-compile", which it still mentions today.

The build system stopped using it in CL 464955 and there are no plans
to use it again in the future, so update the description so that it's
not misleading. Notably, adding additional checks to this script does
not mean they will be caught by builders.

Updates #31916.
Updates #58163.

Change-Id: I17558b1c150a3ad95105de14511c51791287991b
Reviewed-on: https://go-review.googlesource.com/c/go/+/513755
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-07-27 17:32:27 +00:00
Dmitri Shuralyov
d79ec708bd cmd/dist: skip testing packages without tests in short test mode
For short all.bash, we can keep the small speedup of 2-10 seconds by
skipping 'go test' on packages without tests. This is viable without
coverage loss since the Go release process is guaranteed to run long
tests for all first class ports.

For golang/go#60463.

Change-Id: Ib5a6bd357d757141bc8f1c1dec148a6565726587
Reviewed-on: https://go-review.googlesource.com/c/go/+/503115
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2023-07-27 17:32:21 +00:00
Dmitri Shuralyov
d2ec964e9c cmd/dist: test all 'std cmd' packages, even ones without _test.go files
Remove the optimization added in CL 10492 that skips running 'go test'
on Go packages without _test.go files. By now, 'go test' can find real
problems even in packages that don't have any custom tests.

On my fairly fast laptop, running go test -short on all 164 normal
and 96 vendored packages without tests took around 10 seconds on
the first run and 2.5 seconds on the second, a small fraction of
the total all.bash time. So prioritize gains in the test coverage
over those savings in all.bash time.

Fixes golang/go#60463.

Change-Id: I3d2bec5c367de687e57131e7fd7e6b84fed30187
Reviewed-on: https://go-review.googlesource.com/c/go/+/503095
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2023-07-27 17:32:18 +00:00
erifan01
8a1ff51827 cmd/asm: add the fifth argument of the instruction to Optab on arm64
Currently the Optab structure contains four arguments of an instruction,
excludes the fifth argument p.RegTo2. It does not participate in
instruction matching and is usually handled separately.

Instructions with five operands are common in the newer arm instruction
set, so this CL adds the fifth argument to Optab, so that instruction
matching is easier. This caused the oplook function also needs to be
updated synchronously, this CL also made some cleaning and modifications
to this function.

Change-Id: I1d95ad99e72a44dfad1e00db182cfc369a0e55c6
Reviewed-on: https://go-review.googlesource.com/c/go/+/505975
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Eric Fang <eric.fang@arm.com>
2023-07-27 01:37:21 +00:00
Ian Lance Taylor
598958f0f2 maps: remove Keys and Values
Preserve the names in case we want them to return an iterator.
Keep the efficient runtime implementations for now,
as we will probably want them under some name, perhaps KeysSlice
and ValuesSlice.

Fixes #61538

Change-Id: I6b03010bf071fb4531cb2f967dad46425962fcb8
Reviewed-on: https://go-review.googlesource.com/c/go/+/513476
Run-TryBot: Ian Lance Taylor <iant@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>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2023-07-26 21:40:38 +00:00
Russ Cox
3afa5daabd cmd/distpack: sort files in standard walk order
The code was sorting files in the archives entirely by path string,
but that's not what fs.WalkDir would do. In a directory with
subdirectory foo/bar and file foo/bar.go, foo/bar gets visited
first, so foo/bar/baz appears before foo/bar.go, even though
"foo/bar/baz" > "foo/bar.go".

This CL replaces the string comparison with a path-aware
comparison that places foo/bar/baz before foo/bar.go,
so that if the tar file is extracted and then repacked using
fs.WalkDir, the files will remain in the same order.

This will make it easier to compare the pristine distpack-produced
tgz for darwin against the rebuilt tgz with signed binaries.

Before:
% tar tzvf /tmp/cmddist.tgz | grep -C1 runtime/cgo.go
-rw-r--r--  0 0      0       11122 Jul 13 15:00 go/src/runtime/callers_test.go
-rw-r--r--  0 0      0        2416 Jul 13 15:00 go/src/runtime/cgo.go
-rw-r--r--  0 0      0        2795 Jul 13 15:00 go/src/runtime/cgo/abi_amd64.h

After:
% tar tzvf pkg/distpack/go1.21rsc.src.tar.gz | grep -C1 runtime/cgo.go
-rw-r--r--  0 0      0        1848 Dec 31  1969 go/src/runtime/cgo/signal_ios_arm64.s
-rw-r--r--  0 0      0        2416 Dec 31  1969 go/src/runtime/cgo.go
-rw-r--r--  0 0      0        2479 Dec 31  1969 go/src/runtime/cgo_mmap.go

For #24904.
For #61513.

Change-Id: Ib7374bc0d6324377f81c561bef57fd87b2111b98
Reviewed-on: https://go-review.googlesource.com/c/go/+/511977
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-07-26 19:28:08 +00:00
Keith Randall
e4fdb437f6 cmd/compile: update README for unified IR
Change-Id: Ie84e88db4b84f04f2c6f7750a2a413ecad6d817a
Reviewed-on: https://go-review.googlesource.com/c/go/+/513436
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@google.com>
TryBot-Bypass: Keith Randall <khr@google.com>
2023-07-26 19:27:07 +00:00