1
0
mirror of https://github.com/golang/go synced 2024-09-29 19:34:38 -06:00
The Go programming language
Go to file
Josh Bleecher Snyder 18053b7131 cmd/compile: optimize unsigned comparisons to 0/1 on amd64
Plus a bonus optimization I noticed while working on this.

There are no functions (besides the rewrite rules) whose text size
increases as a result of this change.

Updates #21439

The following per-package text size stats were generated by parsing the
output of compiling with -S and summing the function size reported on the
STEXT line. This gives a far more accurate picture of the impact
on generated code than merely looking at the object file size changes
or the resulting binary size changes. The latter are below, for reference.

file                                          before  after   Δ       %       
runtime.s                                     477257  476417  -840    -0.176% 
math.s                                        35985   35976   -9      -0.025% 
vendor/golang.org/x/net/dns/dnsmessage.s      87314   87232   -82     -0.094% 
debug/dwarf.s                                 108444  108432  -12     -0.011% 
regexp.s                                      64535   64467   -68     -0.105% 
internal/xcoff.s                              23175   22945   -230    -0.992% 
cmd/vendor/golang.org/x/arch/arm/armasm.s     45263   45260   -3      -0.007% 
cmd/vendor/golang.org/x/arch/arm64/arm64asm.s 118140  118135  -5      -0.004% 
cmd/internal/obj/arm64.s                      151502  151498  -4      -0.003% 
cmd/compile/internal/ssa.s                    6061483 6063120 +1637   +0.027% 
total                                         9321728 9322112 +384    +0.004% 

file      before    after     Δ       %       
go        15188916  15184820  -4096   -0.027% 
addr2line 4315984   4311888   -4096   -0.095% 
cgo       4836088   4831992   -4096   -0.085% 
compile   24506008  24493720  -12288  -0.050% 
doc       4680952   4676856   -4096   -0.088% 
link      6605336   6601240   -4096   -0.062% 
pprof     14776756  14772660  -4096   -0.028% 
total     135250956 135214092 -36864  -0.027% 

Change-Id: I1243a098a08db452f7d1eb0998e241c9b199e2b4
Reviewed-on: https://go-review.googlesource.com/c/go/+/213058
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2020-02-28 00:19:12 +00:00
.github .github: add link to questions in ISSUE_TEMPLATE 2020-01-06 17:05:31 +00:00
api sync: add new Map method LoadAndDelete 2020-02-25 14:31:55 +00:00
doc cmd/go/internal/{test,vet}: use a standard flag.FlagSet to parse flags 2020-02-25 20:54:34 +00:00
lib/time lib/time: update tz data to 2019c 2019-11-26 12:03:08 +00:00
misc misc/wasm: avoid implicit boolean to number conversion 2020-02-25 21:08:47 +00:00
src cmd/compile: optimize unsigned comparisons to 0/1 on amd64 2020-02-28 00:19:12 +00:00
test test: re-enable open-coded defer test on riscv64 2020-02-26 16:54:17 +00:00
.gitattributes
.gitignore
AUTHORS
CONTRIBUTING.md
CONTRIBUTORS CONTRIBUTORS: second round of updates for Go 1.14 2020-02-21 19:59:34 +00:00
favicon.ico
LICENSE
PATENTS
README.md
robots.txt
SECURITY.md

The Go Programming Language

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Gopher image Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.

Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.

Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.

Download and Install

Binary Distributions

Official binary distributions are available at https://golang.org/dl/.

After downloading a binary release, visit https://golang.org/doc/install or load doc/install.html in your web browser for installation instructions.

Install From Source

If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source or load doc/install-source.html in your web browser for source installation instructions.

Contributing

Go is the work of thousands of contributors. We appreciate your help!

To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html

Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.