1
0
mirror of https://github.com/golang/go synced 2024-11-26 11:08:38 -07:00
go/src
Keith Randall f66db49976 cmd/compile: store constant floats using integer constants
x86 is better at storing constant ints than constant floats.
(It uses a constant directly in the instruction stream, instead of
loading it from a constant global memory.)

Noticed as part of #67957

Change-Id: I9b7b586ad8e0fe9ce245324f020e9526f82b209d
Reviewed-on: https://go-review.googlesource.com/c/go/+/592596
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-07-23 20:53:57 +00:00
..
archive
arena
bufio
builtin
bytes internal/bytealg: extend memchr result correctly on wasm 2024-07-17 07:00:20 +00:00
cmd cmd/compile: store constant floats using integer constants 2024-07-23 20:53:57 +00:00
cmp
compress
container
context
crypto
database/sql
debug
embed
encoding encoding/binary: add missing test helper calls 2024-07-23 19:17:29 +00:00
errors
expvar
flag flag: handle nil os.Args when setting CommandLine at package level 2024-07-22 20:58:27 +00:00
fmt
go runtime,internal: move runtime/internal/sys to internal/runtime/sys 2024-07-23 19:05:35 +00:00
hash
html
image
index/suffixarray
internal runtime,internal: move runtime/internal/sys to internal/runtime/sys 2024-07-23 19:05:35 +00:00
io
iter
log
maps maps: document handling of non-reflexive keys 2024-07-17 23:08:52 +00:00
math math/big: fix comment typo in natdiv.go 2024-07-17 15:08:04 +00:00
mime
net all: update vendored dependencies 2024-07-23 20:29:12 +00:00
os os: check relative paths in UserConfigDir and UserCacheDir 2024-07-22 21:51:21 +00:00
path
plugin
reflect runtime,internal: move runtime/internal/sys to internal/runtime/sys 2024-07-23 19:05:35 +00:00
regexp regexp: more cross-references in docstrings 2024-07-16 20:07:41 +00:00
runtime runtime,internal: move runtime/internal/sys to internal/runtime/sys 2024-07-23 19:05:35 +00:00
slices slices: explicitly document nil and empty slice equality 2024-07-22 17:38:46 +00:00
sort
strconv strconv: document that Unquote("''") returns an empty string 2024-07-22 18:35:09 +00:00
strings cmd/compile: don't inline runtime functions in -d=checkptr build 2024-07-22 15:45:09 +00:00
structs
sync
syscall
testdata
testing
text text/template: fix doc spacing 2024-07-22 20:58:50 +00:00
time
unicode unicode/utf8: AppendRune and EncodeRune performance improvement 2024-07-22 21:20:30 +00:00
unique
unsafe
vendor all: update vendored dependencies 2024-07-23 20:29:12 +00:00
all.bash
all.bat
all.rc
bootstrap.bash
buildall.bash
clean.bash
clean.bat
clean.rc
cmp.bash
go.mod all: update vendored dependencies 2024-07-23 20:29:12 +00:00
go.sum all: update vendored dependencies 2024-07-23 20:29:12 +00:00
make.bash make.bash: drop GNU/kFreeBSD handling 2024-07-22 21:24:34 +00:00
make.bat
Make.dist
make.rc
race.bash
race.bat
README.vendor
run.bash
run.bat
run.rc

Vendoring in std and cmd
========================

The Go command maintains copies of external packages needed by the
standard library in the src/vendor and src/cmd/vendor directories.

There are two modules, std and cmd, defined in src/go.mod and
src/cmd/go.mod. When a package outside std or cmd is imported
by a package inside std or cmd, the import path is interpreted
as if it had a "vendor/" prefix. For example, within "crypto/tls",
an import of "golang.org/x/crypto/cryptobyte" resolves to
"vendor/golang.org/x/crypto/cryptobyte". When a package with the
same path is imported from a package outside std or cmd, it will
be resolved normally. Consequently, a binary may be built with two
copies of a package at different versions if the package is
imported normally and vendored by the standard library.

Vendored packages are internally renamed with a "vendor/" prefix
to preserve the invariant that all packages have distinct paths.
This is necessary to avoid compiler and linker conflicts. Adding
a "vendor/" prefix also maintains the invariant that standard
library packages begin with a dotless path element.

The module requirements of std and cmd do not influence version
selection in other modules. They are only considered when running
module commands like 'go get' and 'go mod vendor' from a directory
in GOROOT/src.

Maintaining vendor directories
==============================

Before updating vendor directories, ensure that module mode is enabled.
Make sure that GO111MODULE is not set in the environment, or that it is
set to 'on' or 'auto', and if you use a go.work file, set GOWORK=off.

Requirements may be added, updated, and removed with 'go get'.
The vendor directory may be updated with 'go mod vendor'.
A typical sequence might be:

    cd src  # or src/cmd
    go get golang.org/x/net@master
    go mod tidy
    go mod vendor

Use caution when passing '-u' to 'go get'. The '-u' flag updates
modules providing all transitively imported packages, not only
the module providing the target package.

Note that 'go mod vendor' only copies packages that are transitively
imported by packages in the current module. If a new package is needed,
it should be imported before running 'go mod vendor'.