Compare commits

..

243 Commits

Author SHA1 Message Date
guoguangwu
3b092b27a9 net/textproto: add Referer to commonHeader
Change-Id: Id4c95138788d90779aa7b9a54e58f9e4cb271163
GitHub-Last-Rev: ee43b95269
GitHub-Pull-Request: golang/go#65985
Reviewed-on: https://go-review.googlesource.com/c/go/+/567539
Reviewed-by: Sean Liao <sean@liao.dev>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
2026-02-04 14:45:25 -08:00
AN Long
9972154461 go/build: don't invoke go command when setting UseAllFiles
Fixes #68556

Change-Id: I36b08577243a6b3a13b3adef116411d73a2d3428
Reviewed-on: https://go-review.googlesource.com/c/go/+/700337
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-02-04 14:45:16 -08:00
Randy Reddig
f2e7fa6d31 net/http/httptrace: compose ClientTrace without reflect
This is to enable use of package httptrace on TinyGo, which does not have an implementation of reflect.MakeFunc.

Change-Id: I4f1f94352797bfe3553c1c2d4d1d3dca44b03e43
GitHub-Last-Rev: 4587368ad8
GitHub-Pull-Request: golang/go#69172
Reviewed-on: https://go-review.googlesource.com/c/go/+/609763
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sean Liao <sean@liao.dev>
2026-02-04 14:44:58 -08:00
Олег Световидов
044fe174d7 internal/stringslite: remove duplicate code in Index
Merge two nearly identical loops into one by selecting the fallback
method (IndexString vs IndexRabinKarp) inside the loop based on
whether n <= bytealg.MaxLen.

Fixes #77364#

Change-Id: Iefbef60922ca24e4dda3016127f54290096bcfed
Reviewed-on: https://go-review.googlesource.com/c/go/+/741340
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2026-02-04 12:19:11 -08:00
Keith Randall
f766b8da6c cmd/link: remove obsolete duffzero/duffcopy code
Change-Id: Icf94808a6c137c3c114a0be1f8da85ee5f68d58e
Reviewed-on: https://go-review.googlesource.com/c/go/+/740740
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Keith Randall <khr@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2026-02-04 12:16:14 -08:00
Roland Shoemaker
28fbdf7acb cmd/go: fix pkg-config flag sanitization
Implement a new pkg-config safe flag list (containing everything except
for --log-file) and use that when checking flags passed to pkg-config,
instead of using checkCompilerFlags.

Fixes #77387

Change-Id: Id6141d0a2934053aa43e3aa8ce402bd499c4c028
Reviewed-on: https://go-review.googlesource.com/c/go/+/741042
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2026-02-04 12:14:51 -08:00
qmuntal
045d1270a7 internal/poll: unlock read lock if write lock fails in readWriteLock
If the write lock acquisition fails, the read lock acquired earlier is
not released, leading to a potential deadlock.

The deadlock shouldn't occur because when the write lock fails, it
indicates that the FD is closing, and no other goroutine should be
holding the read lock. However, better to be safe and release the read
lock in such cases.

Change-Id: If593c36040a97357f835b42bb3133ff1dc55a638
Reviewed-on: https://go-review.googlesource.com/c/go/+/740560
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2026-02-04 11:54:32 -08:00
Ian Lance Taylor
bd1b41eb81 reflect, runtime: adjust user-created GCData on AIX
On AIX the runtime adjusts the GCData field in getGCMaskOnDemand
to account for the AIX dynamic loader moving the data section.
That works fine for statically generated types,
but it breaks user generated types. The user generated type
will have a normal, correct, pointer, and adjusting the pointer
will make it point elsewhere.

This all happens to work OK when doing an external link,
because in that case we do have dynamic relocs and there is no adjustment.
But it fails with an internal link.

This CL fixes the problem by applying a reverse adjustment to
user generated types, so that the adjustment winds up with the
original pointer value.

Change-Id: Ibf3199b9ffb36e79af134fbed41db2853297de74
Reviewed-on: https://go-review.googlesource.com/c/go/+/740800
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2026-02-04 11:28:03 -08:00
Ian Lance Taylor
01299a31c2 cmd/cgo: use objdir consistently, create it as needed
Previously we added a slash to the end of objdir only after
processing input files. The effect was that the temporary gcc
output files were placed in /tmp, using objdir as a prefix.
Those output files were not removed by anything.

Now we consistently use objdir as a directory, not a prefix.
We only create it when needed; there is already a test for that in
cmd/go/testdata/script/build_cwd_newline.txt.

Change-Id: Ie66d9c04ecc3c0f5950fc1111c74e1d01c67304c
Reviewed-on: https://go-review.googlesource.com/c/go/+/740742
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-02-04 11:28:00 -08:00
Ian Lance Taylor
1bbb78e777 cmd/go: rewrite cgo names to "C." in compiler error messages
We used to do this but it broke in Go 1.10. This restores the rewrite,
but only applied to compiler output for packages that use cgo.
That is all that the original rewrite applied to anyhow.

Fixes #76339

Change-Id: Ife8ee858ddd0ff7bcc7423455b2eabf8381b7bde
Reviewed-on: https://go-review.googlesource.com/c/go/+/721821
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2026-02-04 11:25:57 -08:00
David Chase
a3688ab13e cmd/compile: add node collapse/expand to html ast output
AI-generated code, plus a lot of reviewing and tweaking
of arrows and fonts.

This adds subtree collapse/expand triangles.

Change-Id: I2dd322abdf7ef956b1435946d79f864a6150f976
Reviewed-on: https://go-review.googlesource.com/c/go/+/740481
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-02-03 20:24:21 -08:00
David Chase
ae7b257f24 cmd/compile: enhance astdump flag to also generate HTML
AI-generated code, 3 merged commits, plus a LOT of hand
cleanups and tweaks, including removing cargo-culted dead
code from the SSA example, reorganizing CSS and JS out of a
single giant comment, using defer appropriately to ensure
balanced open/close tags, running output through tidy to
check compliance.  Prompts are included for reference.

This is intended to produce an HTML file in the style of "ssa.html",
but for AST.  The result of various phases appears in columns,
which can be scrolled side to side, and also dragged sideways
to make them wider (because AST tends wide).

This supports three kinds of highlighting, which I tweaked
along the way to make them (in my opinion) more useful.

1) Node outlining.  This outlines a node and all of its subtrees.
When the cursor is a "cell" (outlined cross) node highlighting
is available.  Note that "NAME" nodes are repeated within the
tree, so click on one of these will outline every occurrence.
This is actually done with pointer identity.

2) Name highlighting, available with a "crosshair" cursor.
This highlights a name, e.g. "autotmp_1".

3) Position highlighting, available with a "crosshair" cursor.
This highlights either a file (all occurrences of that file's positions),
a line within a file (all occurrences of that file:line combination),
or a column (all occurrences of that particular file:line:column).
Inlined positions are treated as a sequence of positions, not a single
position.

Prompts:
```
The file cmd/compile/internal/ir/dump.go contains a function AstDump
that calls FDump to generate a textual representation of the AST from
several phases within the compiler.

The file cmd/compile/internal/ir/fmt.go contains the definition of
FDump.

The SSA phases of the compiler use code in
cmd/compile/internal/ssa/html.go to render its textual representation
into an html display that allows hiding phases and highlighting blocks,
identifiers and line numbers.

Please write a similar HTML-generating phase for AST that produces an
output that will allow hiding phases and perhaps hiding subtrees, and
highlighting identifiers and line numbers.  The idioms and hacks used
in the SSA html display have worked well, if you want to copy them.
```

```
Not bad, but the output contains a strike-through beginning on a line
that contains  "TYPE  type *testing.B tc(1)".  The strike through
begins after "TYPE " and continues for the rest of the output.  Can you
find that bug and fix it?
```

```
The AST output is often wider than the statically sized columns in the
HTML output.  Either the columns need to have a width that can be
resized (dragged wider, for example) or the AST needs to be draggable,
side-to-side, within the columns.  Resizable columns seems like the
preferable choice, if it is possible.
```

```
The highlighting for file name and line number is not quite right -- all
the lines in the same file are grouped together, where what I want, is
that each different file:line:column gets its own number.  There's also
the issue of inlining, in some cases the location is described as more
than one file:line:column, where the first is the call site and the
second is the inlined function.  I think it makes sense to treat each
single file:line:column as its own item for highlighting, instead of
trying to treat the sequence of file:line:column as a single distinct
location.  One thing that might be interesting, but I am not sure how
hard it would be, is to distinguish between clicks to the file part,
the line part, and the column part -- click on file means highlight
all that matches file, click on line means all that machines file:line
(not just the line numner, since there may be different files, with
inlining) and click on the column means to highlight the specific
file:line:column triple.  That is, if it is possible.
```

```
Lovely.  Can you implement highlighting for names, strings
like "NAME-testing.b" so that all uses of a variable or a temporary can
easily be seen?
```

Change-Id: I1ed97cd92cdae16d556e3334e543af37973799e5
Reviewed-on: https://go-review.googlesource.com/c/go/+/740563
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: t hepudds <thepudds1460@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
2026-02-03 20:24:06 -08:00
David Chase
835d6d42c4 cmd/compile: add astdump debug flag
This was extraordinarily useful for inlining work.
I have cleaned it up somewhat, and did some additional tweaks
after working on changes to bloop.

-gcflags=-d=astdump=SomeFunc
-gcflags=-d=astdump=SomeSubPkg.SomeFunc
-gcflags=-d=astdump=Some/Pkg.SomeFunc
-gcflags=-d=astdump=~YourRegExpHere

Change-Id: I3f98601ca96c87d6b191d4b64b264cd236e6d8bf
Reviewed-on: https://go-review.googlesource.com/c/go/+/629775
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
2026-02-03 20:22:18 -08:00
Nicholas S. Husin
1179cfc9b4 net/http: prevent blocking when draining response body after it has been closed
Previously, draining the response body after it has been closed causes
Response.Body.Close to block for longer than it otherwise would. In a
worst-case scenario, this means that we are incurring a 50 ms delay for
each HTTP/1 request that we make.

This CL makes sure that a response body is drained asynchronously and
updates relevant documentations to reflect the current behavior.

For #77370

Change-Id: I2486961bc1ea3d43d727d0aabc7a6ca7dfb166ee
Reviewed-on: https://go-review.googlesource.com/c/go/+/741222
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Nicholas Husin <husin@google.com>
2026-02-03 17:14:44 -08:00
Michael Anthony Knyszek
8572b1cfea internal/runtime: fix assembly for spectre retpoline instrumentation
In the last year we added two CALLs whose targets are loaded from
memory. Change them to call from a register so that the instrumentation
for spectre mitigations works.

This change also adds a smoke test for the spectre build flags.

For #77420.

Change-Id: I35ec723449ff6a712bcce3276bf1df3fa932bddc
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/741541
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2026-02-03 11:56:29 -08:00
Corentin Chary
e0414d74fe bytes, strings: replace asciiSet bitset with lookup table
Replace the 32-byte bitset implementation with a 256-byte lookup table
for simpler and faster ASCII character membership testing.

The bitset implementation used bit manipulation (shifts, masks, AND/OR)
requiring multiple CPU operations per lookup. The lookup table uses
direct array indexing with a single load and compare, reducing CPU
overhead significantly.

Using [256]bool instead of [256]byte allows the compiler to eliminate
the comparison instruction entirely, as bool values are guaranteed to be
either 0 or 1.

The full 256-element array (rather than 128 elements) is used because it
eliminates branches entirely. Testing shows [256]bool is 68% faster than
[128]bool with an explicit bounds check (488µs vs 821µs) due to avoiding
branch misprediction penalties in the hot path. Using [128]bool with bit
masking (c&0x7f) eliminates bounds checks but still costs ~10% performance
due to the AND operation.

The 224-byte increase in memory usage is acceptable for modern systems,
and the simpler implementation is easier to understand and maintain.

Full benchmark results demonstrating ~1.5x improvements across all
affected functions are available at:
https://github.com/golang/go/issues/77194#issuecomment-3814095806

This supersedes CL 737920 with a simpler approach that improves
performance for all architectures without requiring SIMD instructions.

Updates #77194

Change-Id: I272ee6de05b963a8efc62e7e8838735fb0c4f41b
Reviewed-on: https://go-review.googlesource.com/c/go/+/739982
Auto-Submit: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
2026-02-03 11:43:42 -08:00
Filippo Valsorda
b691a2edc7 crypto/tls: revalidate whole chain on resumption on Windows and macOS
TestHandshakeChangeRootCAsResumption and TestHandshakeGetConfigForClientDifferentClientCAs 
changed because previously rootA and rootB shared Subject and SPKI,
which made the new full-chain revalidation check succeed, as the
same leaf would verify against both roots.

Fixes #77376

Cq-Include-Trybots: luci.golang.try:gotip-darwin-arm64-longtest
Change-Id: I60bed694bdc621c9e83f1bd8a8224c016a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/741361
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>
2026-02-03 10:34:45 -08:00
qmuntal
31c9bcb103 internal/poll: readWriteUnlock should destroy fd when no remaining references
Fixes #77404

Change-Id: I0402becb94855baf942d6ba3815cc2a3c1526d6e
Reviewed-on: https://go-review.googlesource.com/c/go/+/740921
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2026-02-03 01:00:16 -08:00
Ian Lance Taylor
18d31e3e8b compress/bzip2: use obscuretestdata.ReadFile to avoid creating temporary
The temporary was not being deleted. Not creating it at all is better.

Change-Id: Id9c5498a2f7d2f58770a09a2a76f4ab30943dd3d
Reviewed-on: https://go-review.googlesource.com/c/go/+/740780
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-02-02 19:40:59 -08:00
Mark Freeman
7fd116f864 go/types, types2: add missing Named.unpack call in Checker.hasVarSize
CL 734980 swapped use of Type.Underlying() in Checker.hasVarSize for
traversal of Named.fromRHS. It forgot to call Named.unpack() before
inspecting Named.fromRHS, allowing access of unexpanded instantiated
types.

These unexpanded instantiated types are then mistakenly marked as having
fixed size, which fails assertions downstream. This change adds the
missing Named.unpack() call and swaps direct access of Named.fromRHS for
Named.rhs(), which verifies such access in debug mode.

Fixes #77382

Change-Id: I324bbbbf790f8b09e95902ebe67f775483f88417
Reviewed-on: https://go-review.googlesource.com/c/go/+/740620
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-02-02 15:18:11 -08:00
Damien Neil
8ac41b52c4 testing/synctest: add Sleep
Add a convenience function which combines time.Sleep and synctest.Wait.

Fixes #77169

Change-Id: I2ff105105e95cfd8e5b4f72ccacf7afa59efb6bd
Reviewed-on: https://go-review.googlesource.com/c/go/+/740066
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-02-02 14:43:36 -08:00
ArsenySamoylov
62d08234b7 internal/maps,cmd/compile/internal/walk: replace calls to mapaccess1* with mapaccess2*
mapaccess1* and mapaccess2* functions share the same implementation and differ only in whether the boolean "found" is returned.

This change replaces mapaccess1* calls with mapaccess2*.
We can do this transparently, since the call site can safely discard the second (boolean) result.

Ideally, mapacces1* functions could be removed entirely, but this change keeps them as thin wrappers for compatibility.

Fixes #73196
Change-Id: I07c3423d22ed1095ac3666d00e134c2747b2f9c1
Reviewed-on: https://go-review.googlesource.com/c/go/+/736020
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
2026-02-02 13:24:26 -08:00
Joe Tsai
35abaf75c3 encoding/json: use pooled encoder in Encoder.Encode
Due to the lack of MarshalWrite in the v1 API,
it is unfortunately common to see:

    json.NewEncoder(out).Encode(in)

where a single-use Encoder is constructed and thrown away.
This performed acceptably in v1 since every call to Encode
used a globally pooled encoder resource.

Prior to this change, the v1-in-v2 implementation relied
on a bytes.Buffer cached only for the lifetime of the Encoder
object itself. Thus, a single-use Encoder does not benefit.
Modify the wrapper implementation to use the internal
pooled encoder from v2 and use the intermediate buffer
to write directly to the output io.Writer.

We assume that the user-provided io.Writer never leaks the buffer,
but this assumption was already held in the v1 implementation.
We are not increasing the surface area of data corruption risk.

Performance of v1 to v1-in-v2 (before the pool fix):

	name                 old time/op    new time/op    delta
	NewEncoderEncode-32    30.2ms ± 4%    28.3ms ± 9%    -6.19%  (p=0.002 n=9+10)

	name                 old alloc/op   new alloc/op   delta
	NewEncoderEncode-32    7.64MB ± 0%   28.37MB ± 0%  +271.23%  (p=0.000 n=10+10)

	name                 old allocs/op  new allocs/op  delta
	NewEncoderEncode-32      200k ± 0%      100k ± 0%   -49.99%  (p=0.000 n=9+10)

Interestingly, v1-in-2 is slightly faster,
but the amount of allocated memory is massive.

Performance of v1 to v1-in-v2 (after the pool fix):

	name                 old time/op    new time/op    delta
	NewEncoderEncode-32    30.2ms ± 4%    24.0ms ± 7%  -20.36%  (p=0.000 n=9+10)

	name                 old alloc/op   new alloc/op   delta
	NewEncoderEncode-32    7.64MB ± 0%    4.09MB ± 3%  -46.52%  (p=0.000 n=10+10)

	name                 old allocs/op  new allocs/op  delta
	NewEncoderEncode-32      200k ± 0%      100k ± 0%  -50.00%  (p=0.000 n=9+9)

Now, the v1-in-v2 implementation is better than v1 on all metrics.

Fixes #75026

Change-Id: I50c975b1d5b8da806e46bc627966b0a39c1817eb
Reviewed-on: https://go-review.googlesource.com/c/go/+/740660
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-02-02 13:05:45 -08:00
Ian Lance Taylor
07f7f8ca52 cmd/cover, cmd/covdata: actually delete temp dirs
The code was using defer in TestMain, but was also calling os.Exit,
which meant that the deferred functions did not run.
TestMain does not require calling os.Exit, so stop doing it.

Change-Id: I25ca64c36acf65dae3dc3f46e5fa513b9460a8e9
Reviewed-on: https://go-review.googlesource.com/c/go/+/740781
Reviewed-by: Than McIntosh <thanm@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
2026-02-02 12:16:54 -08:00
Filippo Valsorda
1c9abbdc8e crypto/tls: document resumption behavior across Configs
Updates #77113
Updates #77217
Updates CVE-2025-68121

Change-Id: Ia47904a9ed001275aad0243a6a0ce57e6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/740240
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
2026-02-02 12:11:19 -08:00
qmuntal
cce3fea08f internal/poll: move buffer pinning inside execIO
This is a step towards deferring adding the handle to IOCP until the
first IO operation.

The goal of this CL is to avoid the fd.isBlocking check in fd.pin,
which was happening outside execIO, and making buffer pinning less
error-prone.

This also fixes an issue where buffer used in Pwrite and WriteTo
were unpinned too early when the write buffer was larger than the
maximum chunk size.

For #76391

Cq-Include-Trybots: luci.golang.try:gotip-windows-amd64-longtest,gotip-windows-amd64-race
Change-Id: Ia181dcb57a559ae466a4341c36a307ad6678aac0
Reviewed-on: https://go-review.googlesource.com/c/go/+/740561
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-02-02 11:06:07 -08:00
qmuntal
3b2a451cef internal/poll: consolidate cancelIO logic into waitIO
This is a step towards deferring adding the handle to IOCP until the
first IO operation.

The main goal of this CL is to remove the fd.pollable() check in
cancelIO.

For #76391

Cq-Include-Trybots: luci.golang.try:gotip-windows-amd64-longtest,gotip-windows-amd64-race
Change-Id: I76263ce12980297d88a5f6c514e4074dfee428cb
Reviewed-on: https://go-review.googlesource.com/c/go/+/740540
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
2026-02-02 10:51:25 -08:00
Brad Fitzpatrick
6de7a19fea net: don't wait 5 seconds to re-read /etc/resolv.conf
If a Go process starts up, finds /etc/resolv.conf empty, then the DHCP
client writes /etc/resolv.conf, the Go program would find itself
broken for up to 5 seconds.

We noticed this during integration tests in ephemeral VMs using
gokrazy that boot into our application.

Change-Id: Ia64c2b5c698a4ee3efc15d8a8f1850c47e531b84
Reviewed-on: https://go-review.googlesource.com/c/go/+/739620
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-02-02 10:15:12 -08:00
Nicholas S. Husin
11d5284363 net/http: try to drain response body upon closing for better connection re-use
Currently, we have a rather inconsistent behavior in terms of whether a
connection can be re-used or not when an HTTP body is not read to
completion:

- In HTTP/2, not reading bodies to completion is not an issue, since a
  new HTTP/2 stream can be created on the same TCP connection.
- In HTTP/1 server, we discard up to 256 KiB of unconsumed request body,
  to potentially allow re-use.
- In HTTP/1 client, we do not do anything, and fail to re-use a TCP
  connection if there are any unconsumed response body at all.

This has led to some confusion. For example, some users have mistakenly
discarded response body for HTTP/2 when doing so is not needed. Manually
discarding response body can also be disadvantageous if the body is
excessively large or is a never-ending stream.

To solve this issue, this CL makes it so that closing a response body
will cause any remaining content to be drained, up to a limit of 256 KiB
or 50 milliseconds, whichever one is reached first. This allows better
connection re-use for HTTP/1, and most users can now avoid having to
manually drain their response body.

For #77370

Change-Id: I71e1227fc9cf5f901362c8e234320817f6b0be24
Reviewed-on: https://go-review.googlesource.com/c/go/+/737720
Reviewed-by: Nicholas Husin <husin@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
2026-02-02 09:54:16 -08:00
Julian Zhu
d99be5c444 crypto/sha1: use const table for key loading on loong64
Load constant keys from a static memory table rather than loading immediates into registers on loong64.

Benchmark for Loongson-3A5000:
goos: linux
goarch: loong64
pkg: crypto/sha1
cpu: Loongson-3A5000-HV @ 2500.00MHz
                   │     old      │                new                │
                   │    sec/op    │   sec/op     vs base              │
Hash8Bytes/New-4      235.9n ± 0%   229.1n ± 0%  -2.88% (p=0.000 n=8)
Hash8Bytes/Sum-4      1.892µ ± 0%   1.882µ ± 0%  -0.50% (p=0.000 n=8)
Hash320Bytes/New-4   1022.0n ± 0%   963.8n ± 0%  -5.70% (p=0.000 n=8)
Hash320Bytes/Sum-4   1037.0n ± 0%   981.1n ± 0%  -5.39% (p=0.000 n=8)
Hash1K/New-4          2.760µ ± 0%   2.594µ ± 0%  -6.01% (p=0.000 n=8)
Hash1K/Sum-4          2.775µ ± 0%   2.610µ ± 0%  -5.95% (p=0.000 n=8)
Hash8K/New-4          20.46µ ± 0%   19.20µ ± 0%  -6.17% (p=0.000 n=8)
Hash8K/Sum-4          20.49µ ± 0%   19.22µ ± 0%  -6.17% (p=0.000 n=8)
geomean               2.498µ        2.377µ       -4.87%

                   │     old      │                new                 │
                   │     B/s      │     B/s       vs base              │
Hash8Bytes/New-4     32.34Mi ± 0%   33.30Mi ± 0%  +2.98% (p=0.000 n=8)
Hash8Bytes/Sum-4     4.034Mi ± 0%   4.053Mi ± 0%  +0.47% (p=0.000 n=8)
Hash320Bytes/New-4   298.7Mi ± 0%   316.7Mi ± 0%  +6.02% (p=0.000 n=8)
Hash320Bytes/Sum-4   294.3Mi ± 0%   311.0Mi ± 0%  +5.69% (p=0.000 n=8)
Hash1K/New-4         353.8Mi ± 0%   376.5Mi ± 0%  +6.41% (p=0.000 n=8)
Hash1K/Sum-4         351.9Mi ± 0%   374.1Mi ± 0%  +6.31% (p=0.000 n=8)
Hash8K/New-4         381.8Mi ± 0%   406.9Mi ± 0%  +6.57% (p=0.000 n=8)
Hash8K/Sum-4         381.4Mi ± 0%   406.4Mi ± 0%  +6.58% (p=0.000 n=8)
geomean              146.1Mi        153.6Mi       +5.11%

Change-Id: I7305caefa1434ab2bb4ce94a1c789d4ee5b7ccf3
Reviewed-on: https://go-review.googlesource.com/c/go/+/732580
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2026-02-02 01:42:56 -08:00
Tony Tang
acd65ebb13 runtime: delete unused parameter of userForced
delete unused parameter userForced

Change-Id: I71c26ab5e3fadc532b6b1f266212c6f620769efd
GitHub-Last-Rev: 6a32c8ff6e
GitHub-Pull-Request: golang/go#76732
Reviewed-on: https://go-review.googlesource.com/c/go/+/727680
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Tony Tang <jianfeng.tony@gmail.com>
2026-01-30 18:35:34 -08:00
thepudds
045fe9aa8c fmt: avoid storing input arguments on pp to help escape analysis
This is part of a series of CLs that aim to reduce how often
interface arguments escape for the print functions in fmt,
such as val here:

  func f(val int) {
      fmt.Sprintf("%d", val)
  }

Prior to this change, arguments immediately escape in doPrintf
because they are stored on the *pp in printArg:

  parameter a leaks to <heap> for (*pp).doPrintf with derefs=1:
    flow: <heap> ← *a:
      from a[argNum] (dot of pointer) at .\print.go:1077:18
      from (*pp).printArg(p, a[argNum], rune(c)) (call parameter) at .\print.go:1077:16

  parameter arg leaks to <heap> for (*pp).printArg with derefs=0:
    flow: <heap> ← arg:
      from p.arg = arg (assign) at .\print.go:682:8

The *pp is heap allocated, and the heap cannot point to stack
variables, so the arguments currently cannot be on the stack.

This change instead threads through the input arguments as individual
type any and reflect.Value parameters, rather than storing on the *pp.

After this change, input arguments still escape, but now for
other reasons.

Updates #8618
Updates #62653

Change-Id: I81984daeceb761ce4ce269b150b888950ce2c5d4
Reviewed-on: https://go-review.googlesource.com/c/go/+/524938
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-01-30 14:22:48 -08:00
Vasily Leonenko
f14d8975a2 runtime: align end of systemstack_switch prologue on amd64 for consistency with gosave_systemstack_switch
gosave_systemstack_switch saves PC with fixed offset of 8 bytes from systemstack_switch to bypass prologue.
This commit makes this offset consistent with actual address of UNDEF instruction intended to be at that address.

Fixes #71440

Change-Id: Ibe6458c5bcb0bdaec228a2f13d6aec7ecc0e319e
Reviewed-on: https://go-review.googlesource.com/c/go/+/740360
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-01-30 09:55:05 -08:00
Paul Murphy
35c5deb1d4 all: switch linux-ppc64 target to ELFv2 ABI
Go is only capable of producing internally linked, static binaries
on linux-ppc64. As such, binaries should run in either ELFv1 or
ELFv2 ppc64 userspaces today.

This opens the door to enabling cgo and external linking which
will require ELFv2 support and userspace, eventually.

Fixes #76244

Change-Id: I5ca15037cbe546f352e8693dcf14da51a308b8ca
Reviewed-on: https://go-review.googlesource.com/c/go/+/734540
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-01-30 08:06:41 -08:00
Neal Patel
afae853072 cmd/go,crypto/mlkem,crypto/x509,encoding/ascii85: clean up tautological/impossible nil conditions
Change-Id: I3cdc599ebc93f5c9be5645e7ef7ce167242d9c1b
Reviewed-on: https://go-review.googlesource.com/c/go/+/739800
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-30 07:54:05 -08:00
Xiaolin Zhao
5aa006dee0 test/codegen: add bitwise operation combination tests
This commit adds two test functions, bitsOptXor1 and bitsOptXor2,
to verify that the compiler correctly optimizes certain bitwise
expression patterns in future CLs.

Change-Id: Idf5bd1ff8653f8fa218604d857639e063546d8e7
Reviewed-on: https://go-review.googlesource.com/c/go/+/736540
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-29 16:48:45 -08:00
thepudds
bae9486d07 cmd/compile/internal/bloop: avoid extraneous heap allocs in b.Loop body due to autotmp variable scope
The motivating example I created for #73137 still seems
to heap allocate in go1.26rc2 when used in a b.Loop body.

                    │   go1.25    │            go1.26rc2               │
                    │  allocs/op  │ allocs/op   vs base                │
NewX/b.Loop-basic-4   1.000 ± 0%     1.000 ± 0%       ~ (p=1.000 n=10) ¹

I suspect it is because the temps are by default declared
outside the loop body, which escape analysis will determine is
an escaping value and result in a heap allocation. (I've seen
this problem before, including in my older CL 546023 that attempts
to help PGO with a similar issue.)

This is an attempt to address that by placing ODCLs within the
b.Loop body for the temps that are created so that they can be
marked keepalive.

There are two cases handled in the CL: function return values
and function arguments. The first case is what affects my example
from #73137, and is also illustrated via the NewX test case in
the new test/escape_bloop.go file.

Without this CL, the NewX call in the BenchmarkBloop test is inlined,
which is an improvement over Go 1.25, but the slice still escapes
because the temporary used for the return value is declared outside
the loop body.

With this CL, the slice does not escape.

The second case is illustrated via the new BenchmarkBLoopFunctionArg
test, which shows a function argument that escapes without this CL
but does not escape with this CL.

We can also make the two new b.Loop tests in testing/benchmark_test.go
individually pass or fail as expected based on individually
reverting the two changes in this CL.

While we are here, we add a note to typecheck.TempAt to help
make people aware of this behavior.

Updates #73137
Fixes #77339

Change-Id: I69abe978367a8d3a931430aec5d85c9c54b42c1f
Reviewed-on: https://go-review.googlesource.com/c/go/+/738822
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
2026-01-29 15:51:12 -08:00
Ian Lance Taylor
c08f6a5b26 cmd/link: put type:* at the start of the type descriptors
That used to happen naturally because the symbol had zero size.
After CL 724261 we need to force it.

Fixes #77372

Change-Id: Ia8eef989bc9cbad5459b60ff6535136e7e0c6cab
Reviewed-on: https://go-review.googlesource.com/c/go/+/740400
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-29 15:15:54 -08:00
Jonah Uellenberg
14a4cb13e3 cmd/compile: make prove use non-equality in subtraction for a stronger bound
Given:
  s := /* slice */
  k := /* proved valid index in s (0 <= k < len(s)) */
  v := s[k:]

len(v) >= 1, so v[0] needs no bounds check. However, for
len(v) = len(s) - k, we only checked if len(s) >= k and so could only
prove len(v) >= 0, thus the bounds check wasn't removed.

As far as I can tell these checks were commented out for performance,
but after benchmarking prove I see no difference.

Fixes: #76429

Change-Id: I39ba2a18cbabc0559924d4d226dcb99dbe9a06ed
GitHub-Last-Rev: 53f3344d26
GitHub-Pull-Request: golang/go#76609
Reviewed-on: https://go-review.googlesource.com/c/go/+/725100
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-01-29 14:08:19 -08:00
Ian Lance Taylor
ee7a2119ac cmd/link: remove AIX special case for first type descriptor
It doesn't seem to be necessary, and removing it seems cleaner
than adding an AIX case to the code in runtime.moduleTypelinks.

Fixes #77365

Change-Id: I59fa56abf42e18017bd112481ea09d0cca47d105
Reviewed-on: https://go-review.googlesource.com/c/go/+/740220
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2026-01-29 13:17:26 -08:00
Mateusz Poliwczak
48788436b8 go/token: simplify fixOffset
Each time I go to definition of this I am deeply confused
at what I am looking, so let's clean this a bit with modern Go.

Change-Id: I8f44e78f0cdde9b970388f9b98a2720e6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/738341
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2026-01-29 13:17:22 -08:00
Ian Lance Taylor
5593ea4634 cmd/link: adjust symkind comparisons in XCOFF code
This XCOFF symkind comparison broke when STYPE moved in CL 723580.
These comparisons are unmaintainable, but at least the new code
is no worse than the old code.

Change-Id: I1be9de6afdf1814aaadcd2105e6247a4b66b46fe
Reviewed-on: https://go-review.googlesource.com/c/go/+/740200
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
2026-01-29 13:15:54 -08:00
Guoqi Chen
baa6b1f2bf cmd/compile: update ABI document for loong64
The duff device has been dropped on loong64,
now we can remove related documentation.

Change-Id: I0bd721adc227522ae3c56dfe199ef735cfdf5d33
Reviewed-on: https://go-review.googlesource.com/c/go/+/740260
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
2026-01-29 13:11:41 -08:00
Keith Randall
10ed9b6ed5 runtime: use smaller max align for arm32
Maybe fixes a dashboard build failure for linux/arm32 casued
by CL 724261.

This value comes from cmd/link/internal/arm/l.go (and in general,
maxAlign in cmd/link/internal/$ARCH/<something>.go).

Change-Id: I4d02cd41072da1b6ad6c7405044bd7788626b013
Reviewed-on: https://go-review.googlesource.com/c/go/+/740101
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Keith Randall <khr@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-01-29 13:04:30 -08:00
Ian Lance Taylor
1172294145 runtime, cmd/link: store type descriptor length, not end
Storing the type descriptor length lets us save a relocation.
It also avoids a problem for Darwin dynamic linking.

For #6853
Fixes #77350

Change-Id: If5c94330fe10d75690325f3d0b0658060ef3eb2d
Reviewed-on: https://go-review.googlesource.com/c/go/+/739681
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-29 08:14:53 -08:00
Mateusz Poliwczak
2bd7f15dd7 go/scanner: document implicit semicolon in multiline comments
Updates #54941

Change-Id: I62406c53b5b27742003098c77cfba0a96a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/738720
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-01-28 22:44:54 -08:00
Mateusz Poliwczak
74c909b2c5 go/parser: use (*Scanner).End instead of scannerhooks
Also drop the scannerhooks code, as it is now unused.

Updates #74958
Updates #76031

Change-Id: I5a0cb8a7fe954e40ce40b8406aed0d3f6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/738701
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-01-28 22:44:38 -08:00
Mateusz Poliwczak
15882523a1 go/parser: use (*Scanner).End in error testing
Updates #74958

Change-Id: I43dcbff6ec828bddf157b2e6ec80df526a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/738700
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-01-28 22:44:26 -08:00
Mateusz Poliwczak
3c924059e6 go/scanner: add End method to Scanner
Fixes #74958

Change-Id: I50ef64ae9ae6a762a7aada3d29914bae6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/738681
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-28 22:44:07 -08:00
Xiaolin Zhao
7f0f671951 math: optimize the floating-point pipeline on loong64
Using the FSEL instruction on loong64 to eliminate branches and reduce
pipeline interruptions.

On the Loongson CPU 3A6000, there is a 0.09% performance improvement, as follows:
goos: linux
goarch: loong64
pkg: math/big
cpu: Loongson-3A6000-HV @ 2500.00MHz
        │  old.bench  │             new.bench              │
        │   sec/op    │   sec/op     vs base               │
Exp       7.748m ± 0%   7.740m ± 0%  -0.10% (p=0.001 n=10)
Exp2      7.747m ± 0%   7.741m ± 0%  -0.09% (p=0.002 n=10)
geomean   7.747m        7.740m       -0.09%

Change-Id: If62f2e81bf345c83a1fa9350ace131240cfa3b9b
Reviewed-on: https://go-review.googlesource.com/c/go/+/693458
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Meidan Li <limeidan@loongson.cn>
2026-01-28 17:01:37 -08:00
David Chase
985b0b3fe2 simd/archsimd: add missing cpufeature to generated mask/merge methods
Change-Id: I34678f4ef17fe1b8b7657a2c3d39685b4a5951f2
Reviewed-on: https://go-review.googlesource.com/c/go/+/739981
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2026-01-28 13:41:19 -08:00
Junyang Shao
83b232b0af cmd/compile, simd: capture VAES instructions and fix AVX512VAES feature
The code previously filters out VAES-only instructions, this CL added
them back.

This CL added the VAES feature check following the Intel xed data:

  XED_ISA_SET_VAES:              vaes.7.0.ecx.9 # avx.1.0.ecx.28

This CL also found out that the old AVX512VAES feature check is not
checking the correct bits, it also fixes it:

  XED_ISA_SET_AVX512_VAES_128:    vaes.7.0.ecx.9  aes.1.0.ecx.25  avx512f.7.0.ebx.16 avx512vl.7.0.ebx.31
  XED_ISA_SET_AVX512_VAES_256:    vaes.7.0.ecx.9  aes.1.0.ecx.25  avx512f.7.0.ebx.16 avx512vl.7.0.ebx.31
  XED_ISA_SET_AVX512_VAES_512:    vaes.7.0.ecx.9  aes.1.0.ecx.25  avx512f.7.0.ebx.16

It restricts to the most strict common set - includes avx512vl for even
512-bits although it doesn't requires it.

Change-Id: I4e2f72b312fd2411589fbc12f9ee5c63c09c2e9a
Reviewed-on: https://go-review.googlesource.com/c/go/+/738500
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-28 11:06:13 -08:00
Amol Yadav
6aef900af4 runtime/metrics: fix panic in Read with empty slice
Calling Read with a nil or empty slice previously caused a panic with
"index out of range" because the function unconditionally accessed the
first element of the slice (via &m[0]) to pass the pointer to the
runtime.

This change adds a check for len(m) == 0 to return early, preventing
the panic when no samples are provided.

Fixes #77231

Change-Id: I442635f5c61de432883c8d0efae9cc6aa1363cc9
GitHub-Last-Rev: 6f24f67b18
GitHub-Pull-Request: golang/go#77233
Reviewed-on: https://go-review.googlesource.com/c/go/+/737380
Reviewed-by: Amol Yadav <amolyadav6125@gmail.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Commit-Queue: Michael Pratt <mpratt@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-01-28 08:44:36 -08:00
Roland Shoemaker
026fa9dc59 crypto/tls: check verifiedChains roots when resuming sessions
When resuming TLS sessions, on the server and client verify that the
chains stored in the session state (verifiedChains) are still acceptable
with regards to the Config by checking for the inclusion of the root in
either ClientCAs (server) or RootCAs (client). This prevents resuming
a session with a certificate chain that would be rejected during a full
handshake due to an untrusted root.

Updates #77113
Updates #77217
Updates CVE-2025-68121

Change-Id: I11fe00909ef1961c24ecf80bf5b97f7b1121d359
Reviewed-on: https://go-review.googlesource.com/c/go/+/737700
Auto-Submit: Roland Shoemaker <roland@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Coia Prant <coiaprant@gmail.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
2026-01-28 08:15:14 -08:00
Roland Shoemaker
133b339ca5 crypto/tls: add verifiedChains expiration checking during resumption
When resuming a session, check that the verifiedChains contain at least
one chain that is still valid at the time of resumption. If not, trigger
a new handshake.

Updates #77113
Updates #77217
Updates CVE-2025-68121

Change-Id: I14f585c43da17802513cbdd5b10c552d7a38b34e
Reviewed-on: https://go-review.googlesource.com/c/go/+/739321
Reviewed-by: Coia Prant <coiaprant@gmail.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-01-28 08:13:28 -08:00
Roland Shoemaker
4f9c3439a3 Revert "crypto/tls: don't copy auto-rotated session ticket keys in Config.Clone"
This reverts CL 736709 (commit bba24719a4).

Updates #77113
Updates CVE-2025-68121

Change-Id: I0261cb75e9adf9d0ac9890dc91ae8476b8988ba0
Reviewed-on: https://go-review.googlesource.com/c/go/+/739320
Reviewed-by: Coia Prant <coiaprant@gmail.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-01-28 08:12:11 -08:00
Guoqi Chen
134035855c cmd/compile: simplify slice/array range loops on loong64
loong64 supports R+R addressing ({st,ld}x.{b,h,w,d} instructions)
and has implemented the relevant lowering rules (only width is 1).

Removes 1616 instructions from the go binary on loong64.

file         before    after      Δ         %
asm          575366    575314    -52     -0.0090%
cgo          489972    489884    -88     -0.0180%
compile     2920418   2920110    -308    -0.0105%
cover        540458    540290    -168    -0.0311%
fix          865840    865668    -172    -0.0199%
link         732858    732662    -196    -0.0267%
preprofile   246022    245978    -44     -0.0179%
vet          839268    839124    -144    -0.0172%
go          1666470   1666114    -356    -0.0214%
gofmt        326526    326438    -88     -0.0270%
total       9203198   9201582    -1616   -0.0176%

Change-Id: If3518547c785764877a6cf987781d43d8b572990
Reviewed-on: https://go-review.googlesource.com/c/go/+/738240
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-01-28 06:42:05 -08:00
Xiaolin Zhao
f65fe3216e cmd/compile: (loong64) optimize float32(abs|sqrt64(float64(x)))
Ref: #733621
Updates #75463

Change-Id: Idd8821d1713754097a2fe83a050c25d9ec5b17eb
Reviewed-on: https://go-review.googlesource.com/c/go/+/735540
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-28 06:19:53 -08:00
Xiaolin Zhao
514790c2b9 cmd/compile: remove the NORconst op on mips{,64}
In the mips{,64} instruction sets and their extensions, there is no
NORI instruction.

Change-Id: If008442c792297d011b3d0c1e8501e62e32ab175
Reviewed-on: https://go-review.googlesource.com/c/go/+/735900
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2026-01-28 06:17:40 -08:00
Keith Randall
a0796d8af6 reflect: allow conversions between slices of named {byte,rune} and string
So the reflect behavior matches that of the language.

These conversions are allowed:

[]myByte <-> string
[]myRune <-> string
[]myByte <-> myString
[]myRune <-> myString

And even if the left-hand-side is named, e.g.

myBytes([]myByte) <-> string

Fixes #53523

Change-Id: I6562e72bc233a45dc7b02f75f68020831ad399ea
Reviewed-on: https://go-review.googlesource.com/c/go/+/739680
Auto-Submit: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-27 15:08:23 -08:00
Ian Lance Taylor
481ab86aaf cmd/link, runtime: remove typelinks
Instead of adding a typelinks section to a Go binary,
mark the start and end of the typelinked type descriptors.
The runtime can then step through the descriptors to find them all,
rather than relying on the extra linker-generated offset list.

The runtime steps through the type descriptors lazily,
as many Go programs don't need the typelinks list at all.

This reduces the size of cmd/go by 15K bytes, which isn't much
but it's not nothing.

A future CL will change the reflect package to use the type pointers
directly rather than converting to offsets and then back to type pointers.

For #6853

Change-Id: Id0af4ce81c5b1cea899fc92b6ff9d2db8ce4c267
Reviewed-on: https://go-review.googlesource.com/c/go/+/724261
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
2026-01-27 13:47:14 -08:00
Ian Lance Taylor
251f3aa6ee os/exec: document blocking Stdin/Stdout/Stderr
WaitDelay only handles writes to Stdin and reads from Stdout/Stderr.
If Stdin is set to a blocking Reader, or Stdout/Stderr are set to
a blocking Writer, Wait can hang indefinitely. I don't see any way to
fix this with the current API, as there is no general way that the
os/exec package can interrupt the blocking Read or Write.

This CL documents the limitation and points people toward the
workaround of using StdinPipe/StdoutPipe/StderrPipe and arranging
for their own way to interrupt the blocking Read or Write.

Fixes #77227

Change-Id: I3150ae7af89dccf8d859b41eb43eaf0bbbb55fee
Reviewed-on: https://go-review.googlesource.com/c/go/+/739422
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Sean Liao <sean@liao.dev>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2026-01-27 12:28:35 -08:00
Ian Lance Taylor
5ec5fdc093 cmd/link: remove unused symbol kind SFUNCTAB
Change-Id: Ica7201dabe7f72b9470d8acbad043a34a20345a9
Reviewed-on: https://go-review.googlesource.com/c/go/+/724121
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-01-27 12:09:49 -08:00
Neal Patel
0f72aff835 simd/archsimd: fix typo in the SHA256Message1 documentation string
Change-Id: I8bc5fec0475bfaebc0469d0efb2ba89af4b3f150
Reviewed-on: https://go-review.googlesource.com/c/go/+/738640
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-27 11:13:56 -08:00
Ian Lance Taylor
03a6a20740 cmd/link: handle SRODATALRELRO in xcoffUpdateOuterSize
This is a followup to CL 723580. This fixes cgo builds on AIX.

For #76038

Change-Id: Idea959615891f3f6e33932fae7a9043778db3366
Reviewed-on: https://go-review.googlesource.com/c/go/+/738920
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
2026-01-27 09:30:54 -08:00
Mark Freeman
ffb50fb716 go/types, types2: rename Named.finite to Named.varSize
Change-Id: I81646c2753c2e44953b116138cb41d41a011ff08
Reviewed-on: https://go-review.googlesource.com/c/go/+/739561
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Mark Freeman <markfreeman@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
2026-01-27 08:26:32 -08:00
Michael Pratt
d8d2b90a46 internal/runtime/gc/scan: include package in expandAVX512 symbol names
These symbols are part of the scan package, so they should include the
package name in the symbol name for consistency.

Change-Id: I6a6a636ca63b34a8da7fb2f0bfe1fa5f8672fff5
Reviewed-on: https://go-review.googlesource.com/c/go/+/738522
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-27 08:25:05 -08:00
Michael Pratt
64e8b238a1 runtime: rename aeshashbody to runtime.aeshashbody
Currently this is a raw symbol name with no package component, which is
confusing when seen in profilers or similar tools.

This function does not follow a Go ABI, and thus should not have a Go
function declaration. go vet requires declaration for standard assembly
functions.

CL 176100 removed the package name as part of making vet pass on package
runtime, but simply making the function static via the <> suffix is
sufficient, there is no need to shorten the symbol name.

Change-Id: I6a6a636c6030f1c9a4b8bb330978733bb336b08e
Reviewed-on: https://go-review.googlesource.com/c/go/+/738521
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2026-01-27 08:24:58 -08:00
Mark Freeman
a977717393 go/types, types2: add check for map value completeness in IndexExpr
An index expression can also go from map[K]V to V. Since V could be
incomplete (due to some admittedly contrived syntax), we need a
check.

Change-Id: I03ffbfc0e5bcc9129591d60dfbaa5fafcf8fb183
Reviewed-on: https://go-review.googlesource.com/c/go/+/737620
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Mark Freeman <markfreeman@google.com>
2026-01-27 07:52:07 -08:00
Mark Freeman
8ca47fab42 go/types, types2: replace pendingType with completion check
This change establishes the invariant that Underlying() cannot observe
a nil RHS for a defined type, unless that type was created by go/types
with an explicitly nil underlying type.

It does so using isComplete, which is a guard to check that a type has
an underlying type. This guard is needed whenever we could produce a
value of a defined type or access some property of a defined type.

Examples include T{}, *x (where x has type *T), T.x, etc. (see CL
734600 for more).

The pendingType mechanism to deeply traverse values of a defined type
is moved to hasVarSize, since this is only truly needed at the site
of a built-in such as unsafe.Sizeof.

This ties cycle detection across value context directly to the syntax,
which seems like the right direction.

Change-Id: Ic47862a2038fb2ba3ae6621e9907265ccbd86ea3
Reviewed-on: https://go-review.googlesource.com/c/go/+/734980
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Mark Freeman <markfreeman@google.com>
2026-01-27 07:52:02 -08:00
wangboyao
2d1f571c6b cmd/compile, runtime: avoid improper control transfer instruction hints on riscv64
On RISC-V the JAL and JALR instructions provide Return Address
Stack(RAS) prediction hints based on the registers used (as per section
2.5.1 of the RISC-V ISA manual). When a JALR instruction uses X1 or X5
as the source register, it hints that a pop should occur.

When making a function call, avoid the use of X5 as a source register
since this results in the RAS performing a pop-then-push instead of a
push, breaking call/return pairing and significantly degrading front-end
branch prediction performance.

Based on test result of golang.org/x/benchmarks/json on SpacemiT K1, fix
version has a performance improvement of about 7%

Fixes #76654

Change-Id: I867c8d7cfb54f5decbe176f3ab3bb3d78af1cf64
Reviewed-on: https://go-review.googlesource.com/c/go/+/726760
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Joel Sing <joel@sing.id.au>
Run-TryBot: Joel Sing <joel@sing.id.au>
2026-01-27 03:43:00 -08:00
Joel Sing
f532f87a98 crypto/subtle: add vector implementation of xorBytes for riscv64
On a Banana Pi F3:

                                     │   subtle.1    │               subtle.2               │
                                     │    sec/op     │    sec/op     vs base                │
ConstantTimeSelect-8                    4.391n ±  1%   4.390n ±  0%        ~ (p=0.500 n=10)
ConstantTimeByteEq-8                    3.763n ±  0%   3.764n ±  0%        ~ (p=0.549 n=10)
ConstantTimeEq-8                        3.767n ±  1%   3.764n ±  0%   -0.08% (p=0.002 n=10)
ConstantTimeLessOrEq-8                  3.136n ±  0%   3.138n ±  0%   +0.06% (p=0.002 n=10)
XORBytes/8Bytes-8                       53.42n ±  0%   52.28n ±  0%   -2.13% (p=0.000 n=10)
XORBytes/128Bytes-8                     64.79n ±  0%   64.12n ±  0%   -1.03% (p=0.000 n=10)
XORBytes/2048Bytes-8                    479.3n ±  0%   322.0n ±  0%  -32.84% (p=0.000 n=10)
XORBytes/8192Bytes-8                    8.897µ ± 26%   7.734µ ± 12%        ~ (p=0.165 n=10)
XORBytes/32768Bytes-8                   39.17µ ± 17%   35.40µ ± 24%   -9.63% (p=0.029 n=10)
XORBytesAlignment/8Bytes0Offset-8       51.74n ±  0%   54.18n ±  0%   +4.72% (p=0.000 n=10)
XORBytesAlignment/8Bytes1Offset-8       51.51n ±  1%   53.52n ±  0%   +3.92% (p=0.000 n=10)
XORBytesAlignment/8Bytes2Offset-8       51.35n ±  1%   53.58n ±  0%   +4.34% (p=0.000 n=10)
XORBytesAlignment/8Bytes3Offset-8       50.86n ±  0%   53.56n ±  0%   +5.31% (p=0.000 n=10)
XORBytesAlignment/8Bytes4Offset-8       51.62n ±  0%   54.20n ±  0%   +4.98% (p=0.000 n=10)
XORBytesAlignment/8Bytes5Offset-8       51.42n ±  1%   53.48n ±  0%   +4.02% (p=0.000 n=10)
XORBytesAlignment/8Bytes6Offset-8       51.08n ±  1%   53.46n ±  0%   +4.67% (p=0.000 n=10)
XORBytesAlignment/8Bytes7Offset-8       50.83n ±  0%   53.54n ±  0%   +5.33% (p=0.000 n=10)
XORBytesAlignment/128Bytes0Offset-8     63.67n ±  0%   66.04n ±  0%   +3.72% (p=0.000 n=10)
XORBytesAlignment/128Bytes1Offset-8    114.40n ±  0%   67.42n ±  0%  -41.07% (p=0.000 n=10)
XORBytesAlignment/128Bytes2Offset-8    113.85n ±  0%   67.43n ±  0%  -40.78% (p=0.000 n=10)
XORBytesAlignment/128Bytes3Offset-8    114.60n ±  0%   67.31n ±  0%  -41.27% (p=0.000 n=10)
XORBytesAlignment/128Bytes4Offset-8    109.30n ±  0%   67.45n ±  0%  -38.29% (p=0.000 n=10)
XORBytesAlignment/128Bytes5Offset-8    110.70n ±  0%   67.32n ±  1%  -39.19% (p=0.000 n=10)
XORBytesAlignment/128Bytes6Offset-8    110.05n ±  0%   67.45n ±  1%  -38.71% (p=0.000 n=10)
XORBytesAlignment/128Bytes7Offset-8    110.60n ±  0%   67.43n ±  0%  -39.04% (p=0.000 n=10)
XORBytesAlignment/2048Bytes0Offset-8    478.4n ±  0%   335.6n ±  0%  -29.85% (p=0.000 n=10)
XORBytesAlignment/2048Bytes1Offset-8    529.7n ±  0%   349.3n ±  0%  -34.05% (p=0.000 n=10)
XORBytesAlignment/2048Bytes2Offset-8    529.3n ±  0%   349.8n ±  0%  -33.91% (p=0.000 n=10)
XORBytesAlignment/2048Bytes3Offset-8    529.8n ±  0%   349.5n ±  0%  -34.02% (p=0.000 n=10)
XORBytesAlignment/2048Bytes4Offset-8    524.7n ±  0%   349.6n ±  0%  -33.38% (p=0.000 n=10)
XORBytesAlignment/2048Bytes5Offset-8    525.9n ±  0%   349.6n ±  0%  -33.52% (p=0.000 n=10)
XORBytesAlignment/2048Bytes6Offset-8    525.1n ±  0%   349.8n ±  0%  -33.39% (p=0.000 n=10)
XORBytesAlignment/2048Bytes7Offset-8    526.0n ±  0%   349.8n ±  0%  -33.51% (p=0.000 n=10)
geomean                                 120.0n         96.92n        -19.23%

                                     │   subtle.1    │                subtle.2                │
                                     │      B/s      │      B/s        vs base                │
XORBytes/8Bytes-8                      142.8Mi ±  0%    145.9Mi ±  0%   +2.19% (p=0.000 n=10)
XORBytes/128Bytes-8                    1.840Gi ±  0%    1.859Gi ±  0%   +1.05% (p=0.000 n=10)
XORBytes/2048Bytes-8                   3.979Gi ±  0%    5.925Gi ±  0%  +48.89% (p=0.000 n=10)
XORBytes/8192Bytes-8                   879.1Mi ± 35%   1010.2Mi ± 13%        ~ (p=0.165 n=10)
XORBytes/32768Bytes-8                  797.9Mi ± 21%    882.8Mi ± 31%  +10.64% (p=0.029 n=10)
XORBytesAlignment/8Bytes0Offset-8      147.5Mi ±  0%    140.8Mi ±  0%   -4.50% (p=0.000 n=10)
XORBytesAlignment/8Bytes1Offset-8      148.1Mi ±  1%    142.5Mi ±  0%   -3.77% (p=0.000 n=10)
XORBytesAlignment/8Bytes2Offset-8      148.6Mi ±  1%    142.4Mi ±  0%   -4.15% (p=0.000 n=10)
XORBytesAlignment/8Bytes3Offset-8      150.0Mi ±  0%    142.4Mi ±  0%   -5.04% (p=0.000 n=10)
XORBytesAlignment/8Bytes4Offset-8      147.8Mi ±  0%    140.8Mi ±  0%   -4.75% (p=0.000 n=10)
XORBytesAlignment/8Bytes5Offset-8      148.4Mi ±  1%    142.6Mi ±  0%   -3.87% (p=0.000 n=10)
XORBytesAlignment/8Bytes6Offset-8      149.4Mi ±  1%    142.7Mi ±  0%   -4.45% (p=0.000 n=10)
XORBytesAlignment/8Bytes7Offset-8      150.1Mi ±  0%    142.5Mi ±  0%   -5.05% (p=0.000 n=10)
XORBytesAlignment/128Bytes0Offset-8    1.872Gi ±  0%    1.805Gi ±  0%   -3.59% (p=0.000 n=10)
XORBytesAlignment/128Bytes1Offset-8    1.042Gi ±  0%    1.768Gi ±  0%  +69.65% (p=0.000 n=10)
XORBytesAlignment/128Bytes2Offset-8    1.047Gi ±  0%    1.768Gi ±  0%  +68.80% (p=0.000 n=10)
XORBytesAlignment/128Bytes3Offset-8    1.040Gi ±  0%    1.771Gi ±  0%  +70.27% (p=0.000 n=10)
XORBytesAlignment/128Bytes4Offset-8    1.090Gi ±  0%    1.767Gi ±  0%  +62.08% (p=0.000 n=10)
XORBytesAlignment/128Bytes5Offset-8    1.077Gi ±  0%    1.771Gi ±  1%  +64.41% (p=0.000 n=10)
XORBytesAlignment/128Bytes6Offset-8    1.083Gi ±  0%    1.767Gi ±  1%  +63.17% (p=0.000 n=10)
XORBytesAlignment/128Bytes7Offset-8    1.078Gi ±  0%    1.768Gi ±  0%  +64.07% (p=0.000 n=10)
XORBytesAlignment/2048Bytes0Offset-8   3.987Gi ±  0%    5.684Gi ±  0%  +42.55% (p=0.000 n=10)
XORBytesAlignment/2048Bytes1Offset-8   3.601Gi ±  0%    5.459Gi ±  0%  +51.61% (p=0.000 n=10)
XORBytesAlignment/2048Bytes2Offset-8   3.604Gi ±  0%    5.453Gi ±  0%  +51.31% (p=0.000 n=10)
XORBytesAlignment/2048Bytes3Offset-8   3.600Gi ±  0%    5.457Gi ±  0%  +51.56% (p=0.000 n=10)
XORBytesAlignment/2048Bytes4Offset-8   3.635Gi ±  0%    5.456Gi ±  0%  +50.10% (p=0.000 n=10)
XORBytesAlignment/2048Bytes5Offset-8   3.627Gi ±  0%    5.455Gi ±  0%  +50.39% (p=0.000 n=10)
XORBytesAlignment/2048Bytes6Offset-8   3.632Gi ±  0%    5.454Gi ±  0%  +50.14% (p=0.000 n=10)
XORBytesAlignment/2048Bytes7Offset-8   3.626Gi ±  0%    5.453Gi ±  0%  +50.39% (p=0.000 n=10)
geomean                                881.0Mi          1.097Gi        +27.51%

Change-Id: Id7f9d87fe1ea39aa91ea7d3fd1ba20737f0dda3c
Reviewed-on: https://go-review.googlesource.com/c/go/+/649657
Reviewed-by: Julian Zhu <jz531210@gmail.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-01-27 03:27:26 -08:00
fumiyanokesinn
cf0c42c2ca cmd/compile/internal/reflectdata: fix divide by zero for zero-size array elements
When generating equality signatures for arrays with zero-size ASPECIAL
elements (e.g., [3]struct{_ [0]float64}), the compiler crashed with
a divide by zero error when computing the loop unroll factor.

Skip comparison code generation for zero-size elements since they
need no comparison.

Fixes #77303

Change-Id: Ib432cfece22b1cb714de4f0a0b0d1a2d89bb0d33
Reviewed-on: https://go-review.googlesource.com/c/go/+/738841
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
2026-01-26 18:28:40 -08:00
Dmitri Shuralyov
bb221e8954 doc/go1.27: document macOS requirements
For #75836.

Change-Id: I07f607178fadbfec95459b2a446f58ae3c5e8932
Reviewed-on: https://go-review.googlesource.com/c/go/+/739380
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-01-26 13:07:04 -08:00
Dmitri Shuralyov
d381731e06 README.vendor: document release cycle considerations
Write down a few more things relevant to the process of maintaining
the vendor directory for the std and cmd modules. This includes the
import path of the package containing a tree consistency check, and
some considerations regarding the Go release cycle.

Also mention the updatestd command with enough context so that it's
clear that it is okay to either use it to update everything at once,
or instead update specific modules with individual 'go get' calls,
whichever is a better fit for the task at hand.

For #31806.
For #36905.

Change-Id: I37d391c557d6cf6ebf2751d71ab9c8f7c10d922d
Reviewed-on: https://go-review.googlesource.com/c/go/+/739301
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Ian Alexander <jitsu@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
TryBot-Bypass: Dmitri Shuralyov <dmitshur@golang.org>
2026-01-26 12:37:19 -08:00
Dmitri Shuralyov
cffd7a3ec4 cmd/pprof: update vendored github.com/google/pprof
Pull in the latest published version of github.com/google/pprof
as part of the continuous process of keeping Go's dependencies
up to date.

For #36905.

[git-generate]
cd src/cmd
go get github.com/google/pprof@v0.0.0-20260115054156-294ebfa9ad83
go mod tidy
go mod vendor

Change-Id: Ife3c2d40fa9c34e69cdde27b5c7846e499094abf
Reviewed-on: https://go-review.googlesource.com/c/go/+/739300
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Florian Lehner <lehner.florian86@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
2026-01-26 11:24:11 -08:00
khr@golang.org
b04e7f31c8 internal/reflectlite: remove unused code
Change-Id: I87ae45657a9bae85b0fbf52692f15552a2987847
Reviewed-on: https://go-review.googlesource.com/c/go/+/738941
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-26 09:57:21 -08:00
Daniel Morsing
cc6923e839 cmd/compile: reduce lock/scheduler contention
During the parallel section of compilation, we limit the amount of
parallelism to prevent scheduler churn. We do this with a worker
scheduler, but it does not have insight on when a compilation is blocked
due to lock contention.

The symbol table was protected with a lock. While most lookups were
quick lock->read->unlock affairs, sometimes there would be
initialization logic involved. This caused every lookup to stall,
waiting for init. Since our worker scheduler couldn't see this, it would
not launch new goroutine to "cover" the gap.

Fix by splitting the symbol lock into 2 cases, initialization and
lookup. If symbols need initialization simultaneously, they will wait
for each other, but the common case of looking up a symbol will be
handled by a syncmap. In practice, I have yet to see this lock being
blocked on.

Additionally, get rid of the scheduler goroutine and have each
compilation goroutine grab work from a central queue. When multiple
compilations finished at the same time, the work scheduler would
sometime not get run immediately. This ended up starving the system of
work.

These 2 changes together cuts -1.37% off the build time of typescriptgo
on systems with a lot of cores (specifically, the c3h88 perf builder).

Updates #73044.

Change-Id: I6d4b3be56fd00a4fdd4df132bcbd52e4b2a3e91f
Reviewed-on: https://go-review.googlesource.com/c/go/+/724623
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
2026-01-26 08:07:51 -08:00
Mateusz Poliwczak
f809faeb8e go/scanner: clear all fields after Scanner reuse
We were missing s.nlPos = token.NoPos in Init, but while we are here
let's make it less likely to hit this it in future.

Change-Id: Ief4c0ba2cf97bc556d901eabc8e172406a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/738680
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2026-01-26 07:58:30 -08:00
Keith Randall
1bd5dbfc41 cmd/compile: simplify AlgType usage
Only walk needs to distinguish different sizes of AMEM. Move
the size-distinguishing AlgType there.

Change-Id: I0a725b5bd13795a623b3668325f1068579abd340
Reviewed-on: https://go-review.googlesource.com/c/go/+/727461
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-23 20:58:32 -08:00
Keith Randall
59ed013621 cmd/compile: simplify array parsing in equality signatures
Change-Id: I166586a1f75165cd17df371f9af7cd5b6b3ddc32
Reviewed-on: https://go-review.googlesource.com/c/go/+/727502
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2026-01-23 20:58:26 -08:00
Keith Randall
cca64d0f5c cmd/compile: clean up eq and hash implementations
Use unsafe.Pointer instead of *any as the argument type.
Now that we're using signatures, we don't have exact types so we
might as well use unsafe.Pointer everywhere.

Simplify hash function choice a bit.

Change-Id: If1a07091031c4b966fde3a1d66295a04fd5a838c
Reviewed-on: https://go-review.googlesource.com/c/go/+/727501
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
2026-01-23 20:58:20 -08:00
Keith Randall
0da8979210 cmd/compile: use equality signatures in hash function generation
There aren't a huge number of generated hash functions, so this probably
won't save a whole lot of memory. But it means we can clean up a bunch
of code by basing equality and hashing on the same underlying infrastructure.

Change-Id: I36ed1e49044fecb33120d8736f1c0403a4a2554e
Reviewed-on: https://go-review.googlesource.com/c/go/+/727500
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-23 20:58:13 -08:00
Keith Randall
6eec9bcdb2 cmd/compile: reorg equality functions a bit
Use signature for closure name instead of type.
Use signature instead of type to decide to use a runtime builtin comparator.
Remove trailing skips from signatures.

Change-Id: I73b2dcd3c6e2f1b2857985e14c24b290941b3ca3
Reviewed-on: https://go-review.googlesource.com/c/go/+/725604
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Keith Randall <khr@google.com>
2026-01-23 20:58:03 -08:00
khr@golang.org
30dff416e4 cmd/compile: redo how equality functions are generated
Instead of generating an equality function for each type that
needs it, generate one per "signature". A "signature" is a
summary of the comparisons needed to check a type for equality.

For instance, the type

	type S struct {
	    i int32
	    j uint32
	    s string
	    e error
	}

Will have the signature "M8SI".

	M8 = 8 bytes of regular memory
	S = string
	I = nonempty interface

This way, potentially many types that have the same signature
can share the same equality function.

The number of generated equality functions in the go binary
is reduced from 634 to 286. The go binary is ~1% smaller.

The generation of equality functions gets simpler (particularly, how
we do inlining of sub-types, unrolling, etc.) and the generated code
is probably a bit more efficient.

The new function names are kind of weird, but will seldom show up
for users. They will appear in cpu profiles, and in tracebacks in the
situation where comparisons panic because an interface somewhere in
the type being compared contains an uncomparable type (e.g. a slice).

Note that this CL only affects generated comparison functions. It does
not generally affect generated code for == (except when that code decides
to call a comparison function as a subtask). Maybe a TODO for the future.

Update #6853

Change-Id: I202bd6424cb6bf7c745a62c9603d4f01dc1a1fc8
Reviewed-on: https://go-review.googlesource.com/c/go/+/725380
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
2026-01-23 20:57:55 -08:00
David Symonds
f8b72802d7 encoding/json: fix typo in package doc.
Change-Id: Id5520757e4d73e56e533e4de4f5f303105c4339e
Reviewed-on: https://go-review.googlesource.com/c/go/+/738180
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: David Symonds <dsymonds@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: David Symonds <dsymonds@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-23 18:08:03 -08:00
xieyuschen
b408256be7 cmd/compile: fix loopvar version detection with line directives
The Go loop variable semantics changed in Go 1.22: loop variables are now
created per-iteration instead of per-loop. The compiler decides which
semantics to use based on the Go version in go.mod.

When go.mod specifies go 1.21 and the code is built with a Go 1.22+
compiler, the per-loop(compatible behavior) semantics should be used.

However, when a line directive is present in the source file,
go.mod 1.21 and go1.22+ compiler outputs a per-iteration semantics.

For example, the file below wants output 333 but got 012.

    -- go.mod --
    module test
    go 1.21
    -- main.go --
    //line main.go:1
    func main() {
            var fns []func()
            for i := 0; i < 3; i++ {
                    fns = append(fns, func() { fmt.Print(i) })
            }
            for _, fn := range fns {
                    fn()
            }
    }

The distinctVars function uses stmt.Pos().Base() to look up the file
version in FileVersions. Base() returns the file name after line
directives are applied (e.g., "main.go" for "//line main.go:1"), not
the actual source file path. This causes the version lookup to fail
for files with line directives.

This CL fixes the bug by using stmt.Pos().FileBase() instead. FileBase()
returns the actual file path before line directives are applied, ensuring
the correct version information is retrieved from the original source file.

Fixes: #77248

Change-Id: Idacc0816d112ee393089262468a02acfe40e4b72
Reviewed-on: https://go-review.googlesource.com/c/go/+/737820
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2026-01-23 15:40:20 -08:00
Gavin Lam
27fcec4d8f runtime: speed up cheaprand and cheaprand64
The current cheaprand performs 128-bit multiplication on 64-bit numbers
and truncate the result to 32 bits, which is inefficient.

A 32-bit specific implementation is more performant because it performs
64-bit multiplication on 32-bit numbers instead.

The current cheaprand64 involves two cheaprand calls.
Implementing it as 64-bit wyrand is significantly faster.

Since cheaprand64 discards one bit, I have preserved this behavior.
The underlying uint64 function is made available as cheaprandu64.

               │    old      │                new           │
               │   sec/op    │   sec/op     vs base         │
Cheaprand-8      1.358n ± 0%   1.218n ± 0%  -10.31% (n=100)
Cheaprand64-8    2.424n ± 0%   1.391n ± 0%  -42.62% (n=100)
Blocksampled-8   8.347n ± 0%   2.022n ± 0%  -75.78% (n=100)

Fixes #77149

Change-Id: Ib0b5da4a642cd34d0401b03c1d343041f8230d11
GitHub-Last-Rev: 549d8d407e
GitHub-Pull-Request: golang/go#77150
Reviewed-on: https://go-review.googlesource.com/c/go/+/735480
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-23 14:41:52 -08:00
Jorropo
478d86446e cmd/compile: on amd64 use 32bits copies for 64bits copies of 32bits values
Fixes #76449

This saves a single byte for the REX prefix per OpCopy it triggers on.

Change-Id: I1eab364d07354555ba2f23ffd2f9c522d4a04bd0
Reviewed-on: https://go-review.googlesource.com/c/go/+/731640
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-23 12:24:56 -08:00
Jorropo
8f739162e6 cmd/compile: cleanup noLimit in prove
- make it immutable
- calculate it rather than using hardcoded value
  (it all is inlined and constant folded away into noLimit's callers)

Change-Id: Ica12442df4d03e99123e62c0fe561c1078e35d75
Reviewed-on: https://go-review.googlesource.com/c/go/+/727181
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-23 12:10:19 -08:00
Jorropo
f35fb95503 cmd/compile: improve PopCount's limits modeling and add bruteforce tests
This make PopCount perfect within the limitations limits can represent.

Change-Id: Ia52e5d79064ad8109117f009c5390a6eba8ccd98
Reviewed-on: https://go-review.googlesource.com/c/go/+/727782
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
2026-01-23 12:09:01 -08:00
Jorropo
417d5e6627 cmd/compile: add limits bruteforce tests for bitlen
This ensure BitLen is perfect within the limitations limits can represent.

Change-Id: I5c1770b4a9f6408fd68fe77b4ef2b2cdd52e26cb
Reviewed-on: https://go-review.googlesource.com/c/go/+/727781
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2026-01-23 12:08:57 -08:00
Jorropo
a4fda8d32a cmd/compile: improve Ctz's limits modeling and add bruteforce tests
This make Ctz perfect within the limitations limits can represent.

Change-Id: I1e596d8d01892d1b70031cf03cecc487ce147b38
Reviewed-on: https://go-review.googlesource.com/c/go/+/727780
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
2026-01-23 12:08:53 -08:00
Jorropo
82ef9f5b21 cmd/compile: cleanup isUnsignedPowerOfTwo
Merge the signed and unsigned generic functions.
The only implementation difference between the two is:
n > 0 vs n != 0 check.

For unsigned numbers n > 0 == n != 0 and we infact optimize
the first to the second.

Change-Id: Ia2f6c3e3d4eb098d98f85e06dc2e81baa60bad4e
Reviewed-on: https://go-review.googlesource.com/c/go/+/726720
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-23 12:04:51 -08:00
Lin Lin
3443ae0863 net: fix some ineffectual assignments reported by ineffassign
Updates #35136

Change-Id: I5422a50dde51c0a57f135c83f4963053285a9bc2
GitHub-Last-Rev: 6db1a88da6
GitHub-Pull-Request: golang/go#76704
Reviewed-on: https://go-review.googlesource.com/c/go/+/727080
Reviewed-by: Florian Lehner <lehner.florian86@gmail.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2026-01-23 12:04:03 -08:00
Nicholas S. Husin
ca5ffe0092 all: update vendored dependencies
This CL does the following:

1. Bundles up golang.org/x/net/internal/httpsfv since h2_bundle.go now
relies on it.
2. Modifies h2_bundle.go import mapping to account for httpsfv package.
3. Updates all vendored dependencies using
golang.org/x/build/cmd/updatestd.

For #75500

Change-Id: Ia2f41ad606092fe20b62f946266190502b146977
Reviewed-on: https://go-review.googlesource.com/c/go/+/738621
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-23 11:09:53 -08:00
Michael Anthony Knyszek
4af8ad24ee internal/buildcfg: disable sizespecializedmalloc by default
We're finding some regressions in overall icache footprint at scale and
we should figure out how to deal with those before rolling this out to
everybody.

Change-Id: I98e792db31712bf64575d76dfeafedb48898f76a
Reviewed-on: https://go-review.googlesource.com/c/go/+/738780
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
2026-01-23 10:39:09 -08:00
goto1134
b291c3c35c cmd/compile: fix typos in types2 api_test.go
Change-Id: Ifee1b0f590ebb6671efd61a289c8884a225f5d6b
GitHub-Last-Rev: 175ae95847
GitHub-Pull-Request: golang/go#76782
Reviewed-on: https://go-review.googlesource.com/c/go/+/728980
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
2026-01-23 09:46:43 -08:00
Josh Bleecher Snyder
d774ced6a9 cmd/go/internal/vcs: support git worktrees
Fixes golang/go#58218

Change-Id: Ia155b26514557cf822caf37e727e5a410b0a36a6
Reviewed-on: https://go-review.googlesource.com/c/go/+/736260
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2026-01-23 09:38:00 -08:00
Robert Griesemer
6d89ab44cc go/types, types: flip field/method selection logic inside out (cleanup)
By selecting on *Var/*Func first, the field/method selection logic
becomes a bit cleaner, clearer, and a little bit simpler.

No functional changes.

Change-Id: I9860f98d52779b0f7ce4484ea77e74a3667d9e6b
Reviewed-on: https://go-review.googlesource.com/c/go/+/738080
Reviewed-by: Alan Donovan <adonovan@google.com>
Commit-Queue: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Griesemer <gri@google.com>
2026-01-23 09:18:50 -08:00
Xiaolin Zhao
021d5ca042 cmd/compile: avoid extending when already sufficiently shifted on loong64
This reduces 744 instructions from the go toolchain binary on loong64.

	file         before      after      Δ       %
	asm          599282      599222   -60    -0.0100%
	cgo          513606      513534   -72    -0.0140%
	compile      2939250     2939146  -104   -0.0035%
	cover        564136      564056   -80    -0.0142%
	fix          895622      895546   -76    -0.0085%
	link         759460      759376   -84    -0.0111%
	preprofile   264960      264916   -44    -0.0166%
	vet          869964      869888   -76    -0.0087%
	go           1712990     1712890  -100   -0.0058%
	gofmt        346416      346368   -48    -0.0139%
	total        9465686     9464942  -744   -0.0079%

Change-Id: I32dfa7506d0458ca0b6de83b030c330cd2b82176
Reviewed-on: https://go-review.googlesource.com/c/go/+/725720
Auto-Submit: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
2026-01-23 08:38:00 -08:00
mohanson
c04335e33a math/pow10: remove overlapping boundary (n=0)
Both the first and second conditions include n=0, creating an
implicit logic that relies on order of evaluation.

Change-Id: Iefbc25a676242fabf272203a3e845363585bff56
Reviewed-on: https://go-review.googlesource.com/c/go/+/730060
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Griesemer <gri@google.com>
2026-01-23 08:26:22 -08:00
Ryan Diep
a1150b5017 cmd/compile/internal/pgo: error parsing profile (for pgo) after scaling
If a valid profile is scaled such that the samples/counts become 0,
an empty graph in which the compiler complain that we never saw a start line
since the graph has no nodes which is a misleading error message.

src/cmd/internal/pgo/pprof.go was modified to check if the graph is empty
return an empty profile.

GitHub-Pull-Request: golang/go#73640
Change-Id: If3f7ab8af6fcf77b2e29ae1df154f87bee377ab0
Reviewed-on: https://go-review.googlesource.com/c/go/+/725120
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Michael Pratt <mpratt@google.com>
2026-01-23 08:26:16 -08:00
Nick Ripley
6b7206feb2 runtime: remove logical stack sentinel for runtime lock stacks
When CL 533258 added frame pointer support for the block and mutex
profiles, it deferred skipping/inline expansion, similar to the
execution tracer. The first frame indicated whether this expansion was
needed by holding either the number of frames to skip (implying inline
expansion) or the logicalStackSentinel placeholder to indicate that no
extra handling is needed. However, CL 598515 switched to doing the
skipping/inline expansion at sample time. After this, the sentinel value
is unused. This CL removes the sentinel from runtime lock profiling,
correcting an oversight from that CL. This didn't cause any problems
since post-processing would just ignore the bogus sentinel value; this
is just a cleanup.

Change-Id: Idbec11f57ac7a57426cd8a064782c4fe6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/726040
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2026-01-23 08:26:04 -08:00
mohanson
23f7ba554d math: use shared signMask constant
In abs.go and copysign.go, magic numbers and local constants are
used for the sign bit mask (1 << 63), even though a shared constant
signMask already exists in bits.go.

Change-Id: Ic3aeb9b52674538443cbe074acfeb373a3c74a8e
Reviewed-on: https://go-review.googlesource.com/c/go/+/732060
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
2026-01-23 08:23:44 -08:00
Nick Ripley
84c8483e02 runtime: remove unused mutexevent linkname
CL 29650 added a sync.event linkname for mutexevent, but that does not
appear to have ever been used. This linkname isn't in the "hall of
shame", so we can just remove it.

Change-Id: I778b53ca089b5afda6c6074be9e43e3a6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/736220
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2026-01-23 05:36:57 -08:00
Ian Lance Taylor
13096a62e6 cmd/link: put type descriptors in .go.type section
This change rewrites and simplifies the relro handling.
We eliminate the separate relro SymKind values and the complex
shifting of symbol kinds. Instead, we put the possible relro data
into their own sections, and make those sections relro when appropriate.

We put type descriptors and their associated data into a
new .go.type section. As part of this we change the runtime.etypes
symbol to be the end of the new section, rather than the end of
rodata as it was before.

We put function descriptors into a new .go.func section.

Ordinary rodata relro stays in the .data.rel.ro section.

We stop making the typelink section relro, as it only contains
offsets and never has dynamic relocations.

We drop the typerel:* and go:funcdescrel symbols.

For #76038

Change-Id: I7aab7cfad3f2623ff06c09a70b756fe1e43f4169
Reviewed-on: https://go-review.googlesource.com/c/go/+/723580
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
2026-01-22 22:14:33 -08:00
Robert Griesemer
6edb9f9c51 go/types, types2: remove support for gotypesalias GODEBUG flag
For #76472.

Change-Id: Ia51b41639637b1de916625e73c26f625382be305
Reviewed-on: https://go-review.googlesource.com/c/go/+/736441
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Commit-Queue: Robert Griesemer <gri@google.com>
2026-01-22 21:37:55 -08:00
Keith Randall
819c53c25f cmd/compile: ensure ops have the expected argument widths
The generic SSA representation uses explicit extension and
truncation operations to change widths of values. The map
intrinsics were playing somewhat fast and loose with this
requirement. Fix that, and add a check to make sure we
don't regress.

I don't think there is a triggerable bug here, but I ran into
this with some prove pass modifications, where
cmd/compile/internal/ssa/prove.go:isCleanExt (and/or its uses)
is actually wrong when this invariant is not maintained.

Change-Id: Idb7be6e691e2dbf6d7af6584641c3227c5c64bf5
Reviewed-on: https://go-review.googlesource.com/c/go/+/731300
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2026-01-22 14:36:07 -08:00
Alexander Musman
c7258178cd cmd/compile: optimize small constant-sized MemEq
Add optimization patterns for MemEq with small constant sizes
(3-32 bytes). These patterns help to avoid runtime calls for
small sizes.

For sizes 3-16, combine two chunks loading and comparison.
For sizes 17-32, combine a 16-byte comparison with the remaining bytes.
This change may increase binary size slightly due to inline expansion,
but improves performance for code with many small memequals,
e.g. DecodehealingTracker benchmark on arm64:

shortname: minio
pkg: github.com/minio/minio/cmd
                               │  Orig.res   │              Uexp.res              │
                               │   sec/op    │   sec/op     vs base               │
DecodehealingTracker-4           842.5n ± 1%   794.0n ± 3%  -5.75% (p=0.000 n=10)
AppendMsgResyncTargetsInfo-4     8.472n ± 0%   8.472n ± 0%       ~ (p=0.582 n=10)
DataUpdateTracker-4              2.856µ ± 2%   2.804µ ± 3%       ~ (p=0.210 n=10)
MarshalMsgdataUsageCacheInfo-4   131.2n ± 1%   131.6n ± 2%       ~ (p=0.494 n=10)
geomean                          227.4n        223.2n       -1.86%

                             │   Orig.res   │              Uexp.res               │
                             │     B/s      │     B/s       vs base               │
DecodehealingTracker-4         352.0Mi ± 1%   373.5Mi ± 3%  +6.10% (p=0.000 n=10)
AppendMsgResyncTargetsInfo-4   1.099Gi ± 0%   1.099Gi ± 0%       ~ (p=0.183 n=10)
DataUpdateTracker-4            341.8Ki ± 3%   351.6Ki ± 3%       ~ (p=0.286 n=10)
geomean                        50.95Mi        52.46Mi       +2.96%

Change-Id: If3d7e7395656d5f36e3ab303a71044293d17bc3e
Reviewed-on: https://go-review.googlesource.com/c/go/+/688195
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
2026-01-22 14:34:09 -08:00
khr@golang.org
26ffe78b8c encoding/json: remove unneeded unsafe import
Followon for CL 721160.

Change-Id: I9c22c5e99c9084e24047c77d20717c5b46165cde
Reviewed-on: https://go-review.googlesource.com/c/go/+/732220
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Sean Liao <sean@liao.dev>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-22 14:29:44 -08:00
Nicholas S. Husin
e0c4ad77cf net/http: Add Server.DisableClientPriority field
The DisableClientPriority field is currently still a no-op, and will
only take effect once golang.org/x/net is bundled up into h2_bundle.go
again.

For #75500

Change-Id: I9e2135bed50b7f201aea93467e3f5f5f6c81cb1c
Reviewed-on: https://go-review.googlesource.com/c/go/+/738620
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Nicholas Husin <husin@google.com>
2026-01-22 14:02:25 -08:00
Russ Cox
dd39dfb534 all: update to Unicode 17
Process:
- Disable unicode TestProperties.
- Run UNICODE_VERSION=17.0.0 go -C ../src/golang.org/x/text generate
- Run go generate strconv
- Update unicode TestProperties by hand to add missing test cases.

This will break x/text using the main repo until the corresponding
x/text CL is submitted. It should not break anything else.

For #77266.

Change-Id: Ia3ffb5a81e212b991714eef70eebfca98a0c8aab
Reviewed-on: https://go-review.googlesource.com/c/go/+/737420
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
TryBot-Bypass: Russ Cox <rsc@golang.org>
2026-01-22 13:16:03 -08:00
Bill Morgan
a006e17162 syscall: document Sendfile semantics
syscall.Sendfile behavior differs significantly between operating
systems.

Document the platform-specific behavior for the offset argument and
partial write reporting on Linux versus BSD-derived systems.

Fixes #64044

Change-Id: I93f740c3e2df911a10bf0884ffab218d4bb4e5fc
GitHub-Last-Rev: a11b898bb9
GitHub-Pull-Request: golang/go#77224
Reviewed-on: https://go-review.googlesource.com/c/go/+/737122
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2026-01-22 13:07:52 -08:00
Mark F
858d4bf851 debug/elf: return FormatError when reading short files
NewFile returns the raw error from ReadAt when failing to read the
ELF identifier, typically io.EOF for empty or short files. This breaks
the API contract that all parsing failures should return *FormatError.

Wrap the error in FormatError for consistency with other error paths.

Fixes #76338

Change-Id: Ic4ed77316fcc459ce8cbe9e9506d7cf8e9286623
Reviewed-on: https://go-review.googlesource.com/c/go/+/736600
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
2026-01-22 13:04:53 -08:00
jjpinto
8e3104dc26 simd/archsimd/_gen/simdgen: fix typos in error messages
simdgen: fix typos in error messages

Change-Id: I921eea63c4847b2af43a1d5a1ea075e86f58aa77
GitHub-Last-Rev: 8c9dae51fd
GitHub-Pull-Request: golang/go#77012
Reviewed-on: https://go-review.googlesource.com/c/go/+/732880
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2026-01-22 12:57:43 -08:00
jjpinto
eaf6650c2b test: use lower-case error message in heapsampling.go
According to Go style guidelines, error strings should not be capitalized.

Change-Id: Iacfb3f5192b7be40da99b6b7e4801f1ae1169efc
GitHub-Last-Rev: 440396e094
GitHub-Pull-Request: golang/go#76999
Reviewed-on: https://go-review.googlesource.com/c/go/+/732760
Auto-Submit: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
2026-01-22 12:57:37 -08:00
Cuong Manh Le
1b7e5836ad cmd/compile: speedup large init function compile time
Fixes #77153

Change-Id: Ia3906e4d686281be78b65daf7a7a4fd1b2b2483d
Reviewed-on: https://go-review.googlesource.com/c/go/+/737880
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2026-01-22 12:55:00 -08:00
Gavin Lam
e9e05687de internal/runtime: remove math.Mul64
internal/runtime/math.Mul64 is a copy of math/bits.Mul64 and redundant.

Change-Id: I4dd2ab531a32da97839c6b45cf90df6430811967
GitHub-Last-Rev: 1a73e16049
GitHub-Pull-Request: golang/go#77187
Reviewed-on: https://go-review.googlesource.com/c/go/+/736500
Auto-Submit: Keith Randall <khr@google.com>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-22 12:48:33 -08:00
Tobias Klauser
1996c22f0a syscall: return early on error in Recvmsg
Currently, Recvmsg may access the rsa buffer even if the underlying syscall
returns an error.

Following the same change done for x/sys/unix.Recvmsg in CL 734740.

For golang/go#76848

Change-Id: I2a145d822442a2033a76f4717317a39010b17bd5
Reviewed-on: https://go-review.googlesource.com/c/go/+/735121
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Florian Lehner <lehner.florian86@gmail.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2026-01-22 12:40:23 -08:00
Guoqi Chen
c61a48619f cmd/compile: allow Bswap{64,32,16} on loong64
On Loong64, Bswap{64,32,16} has been implemented with REVB{2H, 2W,V} instruction

Change-Id: Ia7f40ef3b1a85bfb0b20563098cb792b00cec498
Reviewed-on: https://go-review.googlesource.com/c/go/+/737841
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
2026-01-22 12:34:32 -08:00
Josh Bleecher Snyder
6ba3494e16 cmd/go/internal/vcs: use 0o for octal
Change-Id: I011cd7e1c2c614e2c5c4a0fadf062ac9be2266aa
Reviewed-on: https://go-review.googlesource.com/c/go/+/736440
Reviewed-by: Florian Lehner <lehner.florian86@gmail.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2026-01-22 12:12:45 -08:00
Neal Patel
dcb42485ac cmd/cgo: add test for sanitizing smuggled doc comment code
Updates #76697

Change-Id: If24eec2bc2f8bfd903a4cc8f5499e77ea2f255c8
Reviewed-on: https://go-review.googlesource.com/c/go/+/736780
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-22 10:13:51 -08:00
jiahua wang
fde15bbfc1 strings: use bytealg.LastIndexRabinKarp on strings.LastIndex
Change-Id: I7eae15bf0b4d556763e1754e17031c880035d69c
Reviewed-on: https://go-review.googlesource.com/c/go/+/538737
Auto-Submit: Sean Liao <sean@liao.dev>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Sean Liao <sean@liao.dev>
2026-01-22 07:37:08 -08:00
1911860538
0f9cdc2fbc net/http: use math/rand/v2 instead of math/rand
math/rand/v2 provides a more modern, performant, and secure random number API.

Change-Id: Ic0c30ae40623508e3ed65c435be3c208704b5655
GitHub-Last-Rev: a8fa520b39
GitHub-Pull-Request: golang/go#76433
Reviewed-on: https://go-review.googlesource.com/c/go/+/723680
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
2026-01-22 07:35:48 -08:00
Michael Pratt
d2aad0df60 runtime: guard unexpected return pc gp.m dereference
If stack scanning reaches here while scanning a waiting goroutine, gp.m
will be nil. We are going to crash anyway because the stack is corrupt,
but we still want to reach the print below for context rather than dying
with a SIGSEGV here.

For #64030.

Change-Id: I6a6a636c378669dc45972e1eb8e06401a0fed223
Reviewed-on: https://go-review.googlesource.com/c/go/+/726522
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2026-01-22 07:33:17 -08:00
Keith Randall
bfb851c31e cmd/compile: reserve less memory for bitvectors
We only need 4 per block, not 7. That's almost 50% savings.

Update #77170

Change-Id: I6229a1137e7a03769e30bd4081078817de9a4f84
Reviewed-on: https://go-review.googlesource.com/c/go/+/736340
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
2026-01-22 07:31:38 -08:00
Joe Tsai
0152075d5a encoding/json/v2: remove issue reference in Duration formatting error
The json/v2 working group decided to commit to no default representation
for time.Duration for the foreseeable future.
Thus, we can remove the issue reference in the error message.

If JavaScript (TC39) formally adopts the Temporal.Duration type,
which uses ISO 8601 as the JSON representation for a duration,
we may consider changing the default.

Switching from no default to some default in the future
is generally a compatible change.

Updates #71631

Change-Id: I6f71a0fa97dcefba56aab0c0ddf445d9d38f6e58
Reviewed-on: https://go-review.googlesource.com/c/go/+/735080
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Joseph Tsai <joetsai@digital-static.net>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-22 07:31:33 -08:00
Cuong Manh Le
a535896627 cmd/compile: remove unnecessary code in keepAliveAt
TypeWord and SrcRType are only needed for interface expression
conversion. Since CL 725180, the kept alive nodes are passed directly to
runtime.KeepAlive, so there's no interface conversion anymore.

Change-Id: I37ad8016bf76a1bf8ba36efea043fc71341b33c7
Reviewed-on: https://go-review.googlesource.com/c/go/+/737840
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
2026-01-22 07:30:22 -08:00
Cuong Manh Le
dae71067ce cmd/compile: fix mis-compilation for static array initialization
The bug was first introduced when the compiler is still written in C,
with CL 2254041. The static array was laid out with the wrong context,
causing a stack pointer will be stored in global object.

Fixes #61730
Fixes #77193

Change-Id: I22c8393314d251beb53db537043a63714c84f36a
Reviewed-on: https://go-review.googlesource.com/c/go/+/737821
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Keith Randall <khr@golang.org>
2026-01-22 07:30:19 -08:00
Cuong Manh Le
adb64adfd7 cmd/compile: refactor preserveStmt
By breaking it into smaller functions with duplicated logic removed.

Change-Id: I710414e8d13d91c19fb4bf4da1a31b00ee88ccee
Reviewed-on: https://go-review.googlesource.com/c/go/+/728961
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2026-01-22 07:30:08 -08:00
Cuong Manh Le
540ccca0a7 cmd/compile: better name for BloopWalk
Use bloop.Walk instead of BloopWalk for better naming.

Change-Id: I60fb7abf8cdab2c7641c69d1cc06c1d6bef1600b
Reviewed-on: https://go-review.googlesource.com/c/go/+/728960
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
2026-01-22 07:30:05 -08:00
Robert Griesemer
2d37c20778 go/types, types2: better error when selecting field on type rather than value
Fixes #6814.

Change-Id: I659670998f8e89400d03d40189e8c54f7e705cdc
Reviewed-on: https://go-review.googlesource.com/c/go/+/738040
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
2026-01-21 16:01:08 -08:00
Carlos Amedee
455282911a doc/next: initialize
Initialize the doc/next directory for the next release by copying the
contents of doc/initial into it.

For #76474.

Change-Id: I52c826cf42aa93f1dea8bf8f7f386a77265bf31a
Reviewed-on: https://go-review.googlesource.com/c/go/+/737961
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Carlos Amedee <carlos@golang.org>
TryBot-Bypass: Carlos Amedee <carlos@golang.org>
2026-01-21 12:27:12 -08:00
Carlos Amedee
83c44ec032 internal/goversion: update Version to 1.27
Go 1.27 is in the process of being opened for development (to be
eventually released). This change marks the very beginning of its
development cycle, updating the Version value accordingly.

For #40705.
For #76474.

Change-Id: Id64ac75e6727715c32a842501b4318281dd8998f
Reviewed-on: https://go-review.googlesource.com/c/go/+/737960
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2026-01-21 12:25:21 -08:00
Youlin Feng
2baa1d1762 runtime: remove the unused scanIdx from mspan
After CL 700496, mspan.scanIdx is never used, this CL just remove it.

Change-Id: I41ce9902957c0cfa6fbf26b66a2a7787b179376a
Reviewed-on: https://go-review.googlesource.com/c/go/+/737220
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Carlos Amedee <carlos@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2026-01-21 07:22:46 -08:00
Alan Donovan
a8291eb614 cmd/compile/internal/staticinit: fix bug in global new(expr)
The StaticInit pass asserts that the operand of &v is a global,
but this is not so for the &autotemp desugaring of new(expr).

(The variable has by that point escaped to the heap, so
the object code calls runtime.newobject. A future optimization
would be to statically allocate the variable when it is safe
and advantageous to do so.)

Thanks to khr for suggesting the fix.

+ static test

Fixes #77237

Change-Id: I71b34a1353fe0f3e297beab9851f8f87d765d8f1
Reviewed-on: https://go-review.googlesource.com/c/go/+/737680
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-20 13:48:41 -08:00
Daniel Müllner
4edaaf2b52 strconv: don't call internal Atoi twice in Atoi
Change-Id: I89a41bbc83fdf473399527a933d57794ce83f68a
Reviewed-on: https://go-review.googlesource.com/c/go/+/737261
Reviewed-by: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Florian Lehner <lehner.florian86@gmail.com>
2026-01-20 10:18:00 -08:00
Michael Pratt
7251c9e0f0 doc: fix urlmaxqueryparams typos
Updates #77101.

Change-Id: I6a6a636cd58e1bd01943066368cb1424db6c6a92
Reviewed-on: https://go-review.googlesource.com/c/go/+/737040
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-16 09:40:45 -08:00
Alan Donovan
532e320349 go/types,cmd/compile/internal/types2: better diagnostic for type shadowing
This change causes the "x is not a type" diagnostic to describe
x's actual kind, helping to reveal when shadowing is at work.

(The kind description could improve other errors too.)

Fixes #76877

Change-Id: Ia3484998bb384ff570c20b6792cf8461c60aa38c
Reviewed-on: https://go-review.googlesource.com/c/go/+/731180
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Griesemer <gri@google.com>
2026-01-15 15:10:27 -08:00
Damien Neil
bb7c0c717c archive/zip: reduce CPU usage in index construction
Constructing the zip index (which is done once when first opening
a file in an archive) can consume large amounts of CPU when
processing deeply-nested directory paths.

Switch to a less inefficient algorithm.

Thanks to Jakub Ciolek for reporting this issue.

	goos: darwin
	goarch: arm64
	pkg: archive/zip
	cpu: Apple M4 Pro
	                          │  /tmp/bench.0  │            /tmp/bench.1            │
	                          │     sec/op     │   sec/op     vs base               │
	ReaderOneDeepDir-14         25983.62m ± 2%   46.01m ± 2%  -99.82% (p=0.000 n=8)
	ReaderManyDeepDirs-14          16.221 ± 1%    2.763 ± 6%  -82.96% (p=0.000 n=8)
	ReaderManyShallowFiles-14      130.3m ± 1%   128.8m ± 2%   -1.20% (p=0.003 n=8)
	geomean                         3.801        253.9m       -93.32%

Fixes #77102
Fixes CVE-2025-61728

Change-Id: I2c9c864be01b2a2769eb67fbab1b250aeb8f6c42
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3060
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Neal Patel <nealpatel@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/736713
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
2026-01-15 10:35:56 -08:00
Damien Neil
2dcaaa7512 net/url: add urlmaxqueryparams GODEBUG to limit the number of query parameters
net/url does not currently limit the number of query parameters parsed by
url.ParseQuery or URL.Query.

When parsing a application/x-www-form-urlencoded form,
net/http.Request.ParseForm will parse up to 10 MB of query parameters.
An input consisting of a large number of small, unique parameters can
cause excessive memory consumption.

We now limit the number of query parameters parsed to 10000 by default.
The limit can be adjusted by setting GODEBUG=urlmaxqueryparams=<n>.
Setting urlmaxqueryparams to 0 disables the limit.

Thanks to jub0bs for reporting this issue.

Fixes #77101
Fixes CVE-2025-61726

Change-Id: Iee3374c7ee2d8586dbf158536d3ade424203ff66
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3020
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Neal Patel <nealpatel@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/736712
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-15 10:35:53 -08:00
Neal Patel
5e1ad12db9 cmd/go/internal/work: sanitize flags before invoking 'pkg-config'
The addition of CgoPkgConfig allowed execution with flags not
matching the safelist. In order to prevent potential arbitrary
code execution at build time, ensure that flags are validated
prior to invoking the 'pkg-config' binary.

Thank you to RyotaK (https://ryotak.net) of GMO Flatt Security Inc.
for reporting this issue.

Fixes CVE-2025-61731
Fixes #77100

Change-Id: Ic51b41f1f7e697ab98c9c32c6fae35f217f7f364
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3240
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/736711
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-15 10:35:49 -08:00
Roland Shoemaker
94a1296a45 cmd/go: update VCS commands to use safer flag/argument syntax
In various situations, the toolchain invokes VCS commands. Some of these
commands take arbitrary input, either provided by users or fetched from
external sources. To prevent potential command injection vulnerabilities
or misinterpretation of arguments as flags, this change updates the VCS
commands to use various techniques to separate flags from positional
arguments, and to directly associate flags with their values.

Additionally, we update the environment variable for Mercurial to use
`HGPLAIN=+strictflags`, which is the more explicit way to disable user
configurations (intended or otherwise) that might interfere with command
execution.

We also now disallow version strings from being prefixed with '-' or
'/', as doing so opens us up to making the same mistake again in the
future. As far as we know there are currently ~0 public modules affected
by this.

While I was working on cmd/go/internal/vcs, I also noticed that a
significant portion of the commands being implemented were dead code.
In order to reduce the maintenance burden and surface area for potential
issues, I removed the dead code for unused commands.

We should probably follow up with a more structured change to make it
harder to accidentally re-introduce these issues in the future, but for
now this addresses the issue at hand.

Thanks to splitline (@splitline) from DEVCORE Research Team for
reporting this issue.

Fixes CVE-2025-68119
Fixes #77099

Change-Id: I9d9f4ee05b95be49fe14edf71a1b8e6c0784378e
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3260
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/736710
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-15 10:35:46 -08:00
Roland Shoemaker
bba24719a4 crypto/tls: don't copy auto-rotated session ticket keys in Config.Clone
Once a tls.Config is used, it is not safe to mutate. We provide the
Clone method in order to allow users to copy and modify a Config that
is in use.

If Config.SessionTicketKey is not populated, and if
Config.SetSessionTicketKeys has not been called, we automatically
populate and rotate session ticket keys. Clone was previously copying
these keys into the new Config, meaning that two Configs could share
the same auto-rotated session ticket keys. This could allow sessions to
be resumed across different Configs, which may have completely different
configurations.

This change updates Clone to not copy the auto-rotated session ticket
keys.

Additionally, when resuming a session, check that not just that the leaf
certificate is unexpired, but that the entire certificate chain is still
unexpired.

Fixes #77113
Fixes CVE-2025-68121

Change-Id: I011df7329de83068d11b3f0c793763692d018a98
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3300
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/736709
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-15 10:35:43 -08:00
Prateik Lohani
9ef26e96e3 sort: improve comment readability for Stable function
Change-Id: I3bc9f906f85e2b5f3d4ba6484e3c125065e36b57
GitHub-Last-Rev: 5d637c1325
GitHub-Pull-Request: golang/go#77190
Reviewed-on: https://go-review.googlesource.com/c/go/+/736501
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
2026-01-15 08:36:28 -08:00
Filippo Valsorda
2bc4315d92 crypto/internal/fips140test: add ML-DSA to FIPS 140-3 functional tests
Change-Id: I568d28d27d2bc55bbadcc678a2fcf9d36a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/731540
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-14 07:41:48 -08:00
Austin Clements
e242961960 simd/archsimd: 128- and 256-bit FMA operations do not require AVX-512
Currently, all FMA operations are marked as requiring AVX512, even on
smaller vector widths. This is happening because the narrower FMA
operations are marked as extension "FMA" in the XED. Since this
extension doesn't start with "AVX", we filter them out very early in
the XED process. However, this is just a quirk of naming: the FMA
feature depends on the AVX feature, so it is part of AVX, even if it
doesn't say so on the tin.

Fix this by accepting the FMA extension and adding FMA to the table of
CPU features. We also tweak internal/cpu slightly do it correctly
enforces that the logical FMA feature depends on both the FMA and AVX
CPUID flags.

This actually *deletes* a lot of generated code because we no longer
need the AVX-512 encoding of these 128- and 256-bit operations.

Change-Id: I744a18d0be888f536ac034fe88b110347622be7e
Reviewed-on: https://go-review.googlesource.com/c/go/+/736160
Auto-Submit: Austin Clements <austin@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/736201
Reviewed-by: Austin Clements <austin@google.com>
2026-01-13 12:33:31 -08:00
Austin Clements
9ef1692c93 simd/archsimd/_gen/simdgen: feature implications
This simplifies our handling of XED features, adds a table of which
features imply which other features, and adds this information to the
documentation of the CPU features APIs.

As part of this we fix an issue around the "AVXAES" feature. AVXAES is
defined as the combination of the AVX and AES CPUID flags. Several
other features also work like this, but have hand-written logic in
internal/cpu to compute logical feature flags from the underlying
CPUID bits. For these, we expose a single feature check function from
the SIMD API.

AVXAES currently doesn't work like this: it requires the user to check
both features. However, this forces the SIMD API to expose an "AES"
feature check, which really has nothing to do with SIMD. To make this
consistent, we introduce an AVXAES feature check function and use it
in feature requirement docs. Unlike the others combo features, this is
implemented in the simd package, but the difference is invisible to
the user.

Change-Id: I2985ebd361f0ecd45fd428903efe4c981a5ec65d
Reviewed-on: https://go-review.googlesource.com/c/go/+/736100
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/736200
Reviewed-by: Austin Clements <austin@google.com>
2026-01-13 12:17:09 -08:00
Michael Matloob
e2fef50def runtime: rename mallocTiny* to mallocgcTinySize*
This makes it easier to identify which functions are used for memory
allocation by looking for functions that start with mallocgc. The Size
suffix is added so that the isSpecializedMalloc function in
cmd/compile/internal/ssa can distinguish between the generated functions
and the mallocgcTiny function called by mallocgc, similar to the SC
suffixes for the mallocgcSmallNoScanSC* and mallocgcSmallScanNoHeaderSC*
functons.

Change-Id: I6ad7f15617bf6f18ae5d1bfa2a0b94e86a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/735780
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-13 09:52:54 -08:00
cuishuang
7f6418bb4e all: fix misspellings in comments
Change-Id: I121847e7f68c602dd8e9ecddfc41b547f8a86f10
Reviewed-on: https://go-review.googlesource.com/c/go/+/734361
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
2026-01-13 08:31:32 -08:00
Damien Neil
c16402d15b os/exec: move platform-specific LookPath docs to a common comment
We have four different LookPath variations (unix, windows, plan9, wasm),
each with slightly different doc comments. Unify the documentation and
move it to a single, common LookPath.

Change-Id: I56bae57e80887a73ef0f6933258ee0a48dbccdcf
Reviewed-on: https://go-review.googlesource.com/c/go/+/734320
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-12 14:47:02 -08:00
Ori Bernstein
b7e6d8b923 os/exec_test: fix test on Plan 9
Error strings vary across OSes when trying to execute a file
that does not exist. Since matching them is not the point of
the test, ignore them.

Fixes #76965

Change-Id: I6d220bc2d0289070f3441adb48983c13b2a3e597
Reviewed-on: https://go-review.googlesource.com/c/go/+/732940
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Richard Miller <millerresearch@gmail.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2026-01-12 13:57:21 -08:00
qmuntal
cbe153806e net: fix socket duplication error handling on Windows
Calls to dupSocket may fail, but the error is not properly handled
because the surrounding code incorrectly checks for nil error instead
of non-nil error.

I'm not aware of any code paths that would trigger this error, and
I haven't been able to create a test case that does so, but this
change fixes the error handling to correctly propagate any errors
from dupSocket.

Change-Id: I5ffd3cbe8ed58a83634f3b97c0878a7c73e0505e
Reviewed-on: https://go-review.googlesource.com/c/go/+/734821
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
2026-01-12 11:53:11 -08:00
qmuntal
30d0b40264 net: don't ignore getsockname errors in newFileFD
newFileFD is called when creating a net FD from an existing socket
handle. That socket might not be bound yet, in which case getsockname
returns a useful error that is currently ignored and replaced with a
potentially misleading EPROTONOSUPPORT error later on.

Updates #73696
Updates #74976
Updates #75282
Updates #75279
Updates #76537
Updates #76582
Updates #77038

Change-Id: I2a8b30ffbb037035669f65a95a923edc8b288145
Reviewed-on: https://go-review.googlesource.com/c/go/+/734820
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
2026-01-12 11:53:04 -08:00
qmuntal
5741608de2 net: don't ignore errors in TestUnixUnlink
TestUnixUnlink calls some functions and methods that can fail, but it
ignores the returned errors. This test is flaky on Windows, and those
errors should be checked to help diagnose the problem.

Updates #75282
Updates #76582
Updates #77038

Change-Id: Ia868762a4c0b94a7255d57add63777568caa6cd2
Reviewed-on: https://go-review.googlesource.com/c/go/+/734720
Reviewed-by: Florian Lehner <lehner.florian86@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-01-12 11:53:00 -08:00
Filippo Valsorda
df6c351aa4 crypto: use testenv.Executable(t) instead of os.Args[0] in tests
Change-Id: Ib0ec1f05e51a4295a9369d6e8c6b61976a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/735260
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
2026-01-12 10:59:46 -08:00
Robert Griesemer
cc1d7afb24 spec: slightly re-arrange composite literal section for readability
- introduce subtitles to make various sub-sections easier to find
- split rules for struct literals into two groups (literals without
  and with keys)
- move section on syntax ambiguity up as it pertains to the syntax
  introduced at the start
- move prose specific to map literals into its own section

No language changes.

Change-Id: If8895b869138693179ca6e4d8b1c6ebdc705eccf
Reviewed-on: https://go-review.googlesource.com/c/go/+/734322
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
2026-01-12 10:17:06 -08:00
jjpinto
fed3b0a298 cmd/dist: fix goroot typo in panic message
Change-Id: I636a029eedaab0967b774648670710d1303a1f7c
GitHub-Last-Rev: 519faedc5b
GitHub-Pull-Request: golang/go#77081
Reviewed-on: https://go-review.googlesource.com/c/go/+/734080
Reviewed-by: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2026-01-09 12:40:04 -08:00
Alan Donovan
55ab5bba17 path/filepath: Match: improve doc comment
Change-Id: Ic7a6e11ddeb79af67ece345405cdca6cf5199173
Reviewed-on: https://go-review.googlesource.com/c/go/+/735180
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-09 09:36:17 -08:00
Filippo Valsorda
088ba94439 crypto/rsa: log key on test failure
For #74326

Change-Id: If1e61db22c9e7192e5dd56cd36141e5b6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/734640
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
2026-01-09 08:08:53 -08:00
Michael Matloob
108b333d51 cmd/go: only use check cache action's dependencies to build vet config
We manipulate the dependencies of the build action when adding the
non-test variant of the package being tested as a dependency for the
test, so the set of deps of the build package doesn't correctly
represent the dependencies of the package that have been built. Restrict
the set of dependencies we use to populate the vet data to the actual
build dependencies depended on by the check cache action so we don't
check an action that we don't actually depend on (and which may not have
completed yet!)

Fixes #75380

Change-Id: I029080d00b3b10a837abcfb7039e00206a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/734961
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-09 07:54:33 -08:00
jjpinto
2bbb2ace34 runtime/trace: fix documentation comment
Correct documentation comment for mul function

Change-Id: I8b90f02bf0aaba9bb5813833d1b9dd1ebb7d71f4
GitHub-Last-Rev: e91af64af9
GitHub-Pull-Request: golang/go#77082
Reviewed-on: https://go-review.googlesource.com/c/go/+/734100
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2026-01-08 10:42:14 -08:00
Neal Patel
6b2505c79c cmd/go: remove user-content from doc strings in cgo ASTs.
Thank you to RyotaK (https://ryotak.net) of GMO Flatt Security Inc. for reporting this issue.

Updates golang/go#76697
Fixes CVE-2025-61732

Change-Id: I1121502f1bf1e91309eb4bd41cc3a09c39366d36
Reviewed-on: https://go-review.googlesource.com/c/go/+/734220
Reviewed-by: Agustin Hernandez <garisol1982@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-08 09:58:59 -08:00
Filippo Valsorda
4b89bcb8b7 lib/fips140: freeze v1.26.0 FIPS 140-3 module
Fixes #76770

Change-Id: Ia617f01ea9be0d1759147b6cca0403c56a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/731840
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
2026-01-08 09:58:32 -08:00
Cherry Mui
8ac4477d83 simd/archsimd: rename Broadcast methods
Currently the Broadcast128/256/512 methods broadcast the lowest
element of the input vector to a vector of the corresponding width.
There are also variations of broadcast operations that broadcast
the whole (128- or 256-bit) vector to a larger vector, which we
don't yet support. Our current naming is unclear which version it
is, though. Rename the current ones to Broadcast1ToN, to be clear
that they broadcast one element. The vector version probably will
be named BoradcastAllToN (not included in this CL).

Change-Id: I47a21e367f948ec0b578d63706a40d20f5a9f46d
Reviewed-on: https://go-review.googlesource.com/c/go/+/734840
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
2026-01-08 09:44:00 -08:00
Mark Freeman
5facb3b24b internal/types: add test for cycles in value context
Exposition is also added to outline a difference between syntax which
can / cannot produce values of incomplete types.

For us to enforce non-nilness of type RHS and remove the pending type
mechanism, I suspect we would need to add completeness guards to
the syntax which *can*.

Enforcing non-nilness of type RHS currently breaks the below test
cases, but I suspect that is simply an implementation artifact.
In other words, they just call Underlying at a bad time.

  - T0
  - T3
  - T6 / T7
  - T10
  - T12

If we also remove pendingType, all of these test cases break; again,
we would need guards in the appropriate syntax logic.

Change-Id: Ibe22042232e542de1d38b923dd1d5cc50dce08cb
Reviewed-on: https://go-review.googlesource.com/c/go/+/734600
TryBot-Bypass: Mark Freeman <markfreeman@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Mark Freeman <markfreeman@google.com>
2026-01-08 08:31:50 -08:00
Michael Matloob
28147b5283 cmd/go: guarantee a minimum of min(4,GOMAXPROCS) to compile -c
To allow this, we also increase the size of the pool to allow the
minimum number for each action, with an extra 2*GOMAXPROCS number of
tokens to boost -c when there are fewer concurrently running actions.
That means the pool will now have the size 6*GOMAXPROCS instead of the
previous 4*GOMAXPROCS. 

The goal is to maintain the boosting behavior added by the pool, while
guarding from starving compiles when there are too few tokens left, so
that the value of -c is always at least min(4,GOMAXPROCS), which is what
it was set to before Go 1.26.

Cq-Include-Trybots: luci.golang.try:gotip-linux-arm64_c4as16-perf_vs_parent,gotip-linux-arm64_c4ah72-perf_vs_parent,gotip-linux-amd64_c3h88-perf_vs_parent,gotip-linux-amd64_c2s16-perf_vs_parent
Change-Id: I113a38584514a6c025d3d1bc727ff8d86a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/734040
Commit-Queue: Michael Matloob <matloob@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Bypass: Michael Matloob <matloob@google.com>
Reviewed-by: Michael Matloob <matloob@google.com>
2026-01-07 12:45:22 -08:00
Michael Matloob
874d8b98eb cmd/go/internal/work: decrement concurrentProcesses when action finishes
This fixes a bug where we only incremented concurrentProcesses but never
decremented it, causing us to run out of tokens and give all compiles
-c=1 after a point.

Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64_c2s16-perf_vs_parent,gotip-linux-amd64_c3h88-perf_vs_parent,gotip-linux-arm64_c4ah72-perf_vs_parent,gotip-linux-arm64_c4as16-perf_vs_parent
Change-Id: I41f4c1edb77004cbc1772d6d672045946a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/734260
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Matloob <matloob@google.com>
TryBot-Bypass: Michael Matloob <matloob@google.com>
2026-01-07 12:44:45 -08:00
jjpinto
d1e7f49e3d internal/trace: fix recorder.Write return value for header-only buffers
Fix issue #77083

Change-Id: I9189d1e3a6efea8478224164e820f50c818abcd5
GitHub-Last-Rev: bb24cbda95
GitHub-Pull-Request: golang/go#77092
Reviewed-on: https://go-review.googlesource.com/c/go/+/734300
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Commit-Queue: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-07 12:07:56 -08:00
Dmitri Shuralyov
f6ebd91129 all: update vendored x/tools
Pull in the following x/tools changes:

- CL 732260: go/analysis/passes/modernize: disable BLoop analyzer
- CL 733340: gopls/internal/analysis/modernize: mapsloop: undefined loop-var

For #74967.
For #77008.

[git-generate]
go install golang.org/x/build/cmd/updatestd@latest
go install golang.org/x/tools/cmd/bundle@latest
updatestd -goroot=$(pwd) -branch=internal-branch.go1.26-vendor

Change-Id: Ic0c10569a4a3a292aec9164e6dd034e55d052904
Reviewed-on: https://go-review.googlesource.com/c/go/+/733780
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2026-01-07 11:30:02 -08:00
Alan Donovan
d1d0fc7a97 os/exec: avoid atomic.Bool for Cmd.startCalled
An atomic.Bool isn't necessary here since, unless otherwise
specified, the methods of an object are not concurrency-safe
w.r.t. each other. Using an atomic causes the copylocks vet
check to warn about copying of Cmd, which is not wrong, because
one shouldn't be copying opaque complex structs from other
packages, but it is a nuisance in the absence of any safe way
to copy a Cmd.

If and when we add a Clone method to Cmd (see #77075) then
it would be appropriate to revert this change so that we get
the benefit of the static check (though ideally we would make
a more explicit tool-readable declaration of the "do not copy"
attribute than merely happening to use an atomic.Bool).

For #77075

Change-Id: I982d4e86623ca165a3e76bbf648fd44041d5f6bb
Reviewed-on: https://go-review.googlesource.com/c/go/+/734200
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-06 12:26:39 -08:00
Cherry Mui
9b2e3b9a02 simd/archsimd: use V(P)MOVMSK for mask ToBits if possible
VPMOVMSKB, VMOVMSKPS, and VMOVMSKPD moves AVX1/2-style masks to
integer registers, similar to VPMOV[BWDQ]2M (which moves to mask
registers). The former is available on AVX1/2, the latter requires
AVX512. So use the former if it is supported, i.e. for 128- and
256-bit vectors with 8-, 32-, and 64-bit elements (16-bit elements
always require AVX512).

Change-Id: I972195116617ed2faaf95cee5cd6b250e671496c
Reviewed-on: https://go-review.googlesource.com/c/go/+/734060
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
2026-01-05 12:22:51 -08:00
Joel Sing
f8ee0f8475 cmd/go/testdata/vcstest/git: use git commands that work on older git versions
On older versions of git (such as 2.25.1), `git branch -M master`
fails after `git init` - use `git checkout -b master` instead, which
works across multiple versions.

Fixes tests on the rather outdated linux/mips* builders.

Change-Id: Id86ec82b37a8d2c3131f449276b13989d097d106
Reviewed-on: https://go-review.googlesource.com/c/go/+/729600
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-01-02 19:26:36 -08:00
Joel Sing
b094749bad test/codegen: codify bit related code generation for arm64
Also more consistently include commas after constants to increase
accuracy (i.e. "1," cannot inadvertantly match "10")

Change-Id: I480a73859d2e83354b8e9f94bc73c6563976d0e3
Reviewed-on: https://go-review.googlesource.com/c/go/+/733460
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2026-01-02 19:25:50 -08:00
Cherry Mui
e84983fa40 cmd/compile: optimize SIMD IsNaN.Or(IsNaN)
IsNaN's underlying instruction, VCMPPS (or VCMPPD), takes two
inputs, and computes either of them is NaN. Optimize the Or
pattern to generate two-operand form.

This implements the optimization mentioned in CL 733660.

Change-Id: I13943b377ee384864c913eed320763f333a03e41
Reviewed-on: https://go-review.googlesource.com/c/go/+/733680
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-02 12:16:34 -08:00
Cherry Mui
8244b85677 simd/archsimd: add tests for IsNaN
Change-Id: I374ce84fd21c41a04e2d5964d8aa872545c6a8a7
Reviewed-on: https://go-review.googlesource.com/c/go/+/733661
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2026-01-02 12:14:17 -08:00
Cherry Mui
13440fb518 simd/archsimd: make IsNaN unary
Currently, the IsNan API is defined as x.IsNan(y), which returns
a mask to represent, for each element, either x or y is NaN.
Albeit closer to the machine instruction, this is weird API, as
IsNaN is a unary operation. This CL changes it to unary, x.IsNaN().
It compiles to VCMPPS $3, x, x (or VCMPPD). For the two-operand
version, we can optimize x.IsNaN().Or(y.IsNaN()) to VCMPPS $3, x,
y (not done in this CL).

While here, change the name to IsNaN (uppercase both Ns), which
matches math.IsNaN.

Tests in the next CL.

Change-Id: Ib6e7afc2635e6c3c606db5ea16420ee673a6c6d6
Reviewed-on: https://go-review.googlesource.com/c/go/+/733660
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-02 12:13:40 -08:00
Cherry Mui
c3550b3352 simd/archsimd: correct documentation of Mask types
The documentation of Mask types currently describe vector types,
not masks. Correct them.

Change-Id: Ib2723310842c6d10cfdd772c7abb8d4c1e63b130
Reviewed-on: https://go-review.googlesource.com/c/go/+/733342
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-01-02 12:13:06 -08:00
jjpinto
34ad26341d net/rpc: correct comment for isExportedOrBuiltinType function
Change to follow the idiomatic Go doc comment style

Change-Id: I727801903c8fc1a66c8a71ab5455f12219b469d5
GitHub-Last-Rev: dd608c9cb9
GitHub-Pull-Request: golang/go#77015
Reviewed-on: https://go-review.googlesource.com/c/go/+/732902
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Rob Pike <r@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2026-01-02 10:00:27 -08:00
Michael Matloob
b28808d838 cmd/go/internal/modindex: fix obvious bug using failed type assertion
adonovan pointed out this bug in the review of CL 733320 and this seems
to be the cause of all those list_empty_importpath flakes. It makes
sense that something nondeterministic would be tied up with the module
index because the state of the cache could depend on the order tests are
run in.

Also remove the parts of the test that accept the flaky behavior so we
can verify the issue has been resolved.

For #73976

Change-Id: Ib64ce6b8eed1dc8d327b7c5e842c1e716a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/733321
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Michael Matloob <matloob@golang.org>
Reviewed-by: Michael Matloob <matloob@google.com>
2025-12-30 14:29:01 -08:00
Cherry Mui
d64add4d60 simd/archsimd: adjust documentations slightly
- Reword the documentation of Scale to mention parameter names.
- Correct the parameter name in Merge.
- Use proper a/an articles in some documentation.
- Add punctuations.
- Format code blocks for long expressions.

Change-Id: I8a31721503c1b155862255619a835895f3d5123a
Reviewed-on: https://go-review.googlesource.com/c/go/+/731560
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-12-30 14:04:55 -08:00
Daniel Morsing
1843cfbcd6 runtime/secret: make tests more sturdy
Technically, the garbage collector can take an arbitrary long time until
it finds a given value unreachable. Account for this fact in our zeroing
tests.

Updates #76586.

Change-Id: Ieaf3cec99afb9204a32524ea559c5f1a280a59e6
Reviewed-on: https://go-review.googlesource.com/c/go/+/732980
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-12-30 07:33:35 -08:00
cuishuang
fd45d70799 all: fix some minor grammatical issues in the comments
Change-Id: I0459f05e7f6abd9738813c65d993114e931720d5
Reviewed-on: https://go-review.googlesource.com/c/go/+/731000
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
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@golang.org>
2025-12-30 07:28:53 -08:00
Alexander Musman
df4e08ac65 test/codegen: fix a tab in comparisons.go to ensure pattern works
Fix a pattern in test/codegen/comparisons.go to use whitespace instead
of a tab. The test needs a whitespace to properly fail if the regalloc
change from CL686655 would be missing (in that case we would have a
spill immediately after call to memequal, which is supposed to be
captured by this pattern).

Change-Id: I5b6fb5e861b9327c7f071660592b8ffa265e0030
Reviewed-on: https://go-review.googlesource.com/c/go/+/727620
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
2025-12-30 07:28:47 -08:00
zuojunwei.1024
cd668d744f cmd/compile: disable inlining for functions using runtime.deferrangefunc
The rangefunc rewrite pass implements defer using deferrangefunc and
deferproccat. The loop body is rewritten into a closure, it cannot be
inlined due to defer call. But the outer function may still be inlined
in certain scenarios (e.g., with PGO), leading to the defer executing
at the wrong time.

Fixes #77033

Change-Id: I4649fad5cd1b65891832523522002d9352711123
Reviewed-on: https://go-review.googlesource.com/c/go/+/732140
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>
2025-12-30 07:26:35 -08:00
Cherry Mui
06eff0f7c3 simd/archsimd: add tests for Saturate-Concat operations
Change-Id: I9707b68e1ade9fd7c422cb34329edd648e4df7ab
Reviewed-on: https://go-review.googlesource.com/c/go/+/733160
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-12-29 16:23:19 -08:00
Cherry Mui
110aaf7137 simd/archsimd: add tests for Saturate operations
Change-Id: Iea095112310802b29b4ef9ca6e559ea3c5aa83ed
Reviewed-on: https://go-review.googlesource.com/c/go/+/733140
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-12-29 16:22:10 -08:00
Cherry Mui
22e7b94e7f simd/archsimd: add tests for ExtendLo operations
Change-Id: I77a5f0dc58e068882a177dc32d162821b38f34ef
Reviewed-on: https://go-review.googlesource.com/c/go/+/733101
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-12-29 16:21:28 -08:00
Cherry Mui
76dddce293 simd/archsimd: remove redundant suffix of ExtendLo operations
For methods like ExtendLo2ToInt64x2, the last "x2" is redundant, as
it is already mentioned in "Lo2". Remove it, so it is just
ExtendLo2ToInt64.

Change-Id: I490afd818c40bb7a4ef15c249723895735bd6488
Reviewed-on: https://go-review.googlesource.com/c/go/+/733100
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-12-29 16:20:42 -08:00
Cherry Mui
6ecdd2fc6e simd/archsimd: add more tests for Convert operations
Now include operations with input and output with different
lengths.

Change-Id: Idd5b88e67fa943a35a307e00e3348a20d79120a8
Reviewed-on: https://go-review.googlesource.com/c/go/+/733060
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-12-29 16:19:57 -08:00
Cherry Mui
e0c99fe285 simd/archsimd: add more tests for Truncate operations
Now include operations with input and output with different
lengths.

Change-Id: I5c9759e31ffae2d621a13f9cb3f5dd64e87a1c44
Reviewed-on: https://go-review.googlesource.com/c/go/+/732920
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-12-29 16:19:41 -08:00
qiulaidongfeng
08369369e5 reflect: document Call/CallSlice panic when v is unexported field
Fixes #74377

Change-Id: I250d67ef2a4bf4dac939be669eeaf1091523ac06
Reviewed-on: https://go-review.googlesource.com/c/go/+/690617
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2025-12-29 12:45:33 -08:00
jjpinto
ca8effbde1 internal/coverage/decodemeta: correct wording in unknown version error
Correct the wording in the error message returned by readFileHeader when
encountering a meta-data file with an unsupported version.

Change-Id: I49be1bb1509ccc64e8384103bd7f19382b536c26
GitHub-Last-Rev: 2ab8e05a21
GitHub-Pull-Request: golang/go#76981
Reviewed-on: https://go-review.googlesource.com/c/go/+/732581
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@golang.org>
2025-12-29 12:45:22 -08:00
Oleg Zaytsev
0b06b68e21 encoding/gob: clarify docs about pointers to zero values not being sent
The documentation on encoding/gob mentions that pointers are flattened,
and it also explicitly says that empty values are not sent.

A corollary of this, is that pointers to zero values are not sent, i.e.,
gob-encoding of *false becomes nil on the receiver side.

It is worth documenting this explicitly.

Change-Id: I1909203b8972e20791144bdda22e5f1b466aad97
GitHub-Last-Rev: 57764ec235
GitHub-Pull-Request: golang/go#77009
Reviewed-on: https://go-review.googlesource.com/c/go/+/732820
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2025-12-29 12:45:08 -08:00
jjpinto
9cb3edbfe9 regexp: standardize error message format in find_test.go
This change updates the test error messages in find_test.go to follow
the Go standard 'got, want' format.

It also replaces 'expected/should be' terminology with the project's
preferred style and improves the clarity of failure logs by using %q
to quote string values.

Change-Id: I17bfc60a06a879ce5e2c64d624c636e2c24135e9
GitHub-Last-Rev: e9613ac28c
GitHub-Pull-Request: golang/go#77005
Reviewed-on: https://go-review.googlesource.com/c/go/+/732780
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
2025-12-29 12:19:21 -08:00
jjpinto
b3ed0627ce tests: improve consistency and clarity of test diagnostics
Minor updates to test diagnostics for consistency and readability:
- Corrected an incorrect identifier
- Standardized float formatting

No behavior changes.

Change-Id: I3d3633a7cc487209341ea92101f8c67848212080
GitHub-Last-Rev: b2822e846a
GitHub-Pull-Request: golang/go#77001
Reviewed-on: https://go-review.googlesource.com/c/go/+/732762
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
2025-12-29 12:17:32 -08:00
jjpinto
3dcb48d298 test: follow got/want convention in uintptrescapes test
Standardize the output messages in uintptrescapes.dir/main.go

Change-Id: I7965bb9829c7b55ac03cb8b46b333e6b65acf755
GitHub-Last-Rev: d254e0e30e
GitHub-Pull-Request: golang/go#77000
Reviewed-on: https://go-review.googlesource.com/c/go/+/732761
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-12-29 11:21:12 -08:00
jjpinto
f7b7e94b0a test: clarify log message for surrogate UTF-8 check
The current log message "does not error" is slightly ambiguous.
This change clarifies the output.

Change-Id: I5c2327b9fa3d3e28ce43ce1189f8b1b7663fe0d3
GitHub-Last-Rev: bb2b03fc90
GitHub-Pull-Request: golang/go#76998
Reviewed-on: https://go-review.googlesource.com/c/go/+/732740
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2025-12-29 11:19:28 -08:00
Cherry Mui
e790d59674 simd/archsimd: add tests for Truncate operations
For now, only include operations that input and output vectors
have the same number of elements.

Change-Id: I933c800ace515d8d51834d20c134090470950042
Reviewed-on: https://go-review.googlesource.com/c/go/+/732860
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: David Chase <drchase@google.com>
2025-12-29 06:12:33 -08:00
Lin Lin
f4cec7917c cmd: fix unused errors reported by ineffassign
Updates golang/go#35136

Change-Id: I36d26089d29933e363d9fa50f3174530b698450e
Reviewed-on: https://go-review.googlesource.com/c/go/+/731040
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Florian Lehner <lehner.florian86@gmail.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2025-12-27 13:02:20 -08:00
Cherry Mui
ca13fe02c4 simd/archsimd: add more tests for Convert operations
For now, only include operations that input and output vectors
have the same number of elements.

Change-Id: If4722f1b0168eaf0e333bdcd218e394fa4ab440f
Reviewed-on: https://go-review.googlesource.com/c/go/+/732662
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-12-27 09:02:27 -08:00
Cherry Mui
037c047f2c simd/archsimd: add more tests for Extend operations
The operations that extend only low elements, ExtendLoNTo..., are
not yet included.

Change-Id: I93168889b92c56720344b443c1cff238f8cc096a
Reviewed-on: https://go-review.googlesource.com/c/go/+/732661
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-12-27 09:02:20 -08:00
Joel Sing
7971fcdf53 test/codegen: tidy tests for bits
Use Go idiomatic function names, use a common prefix, attempt to
maintain some consistency, avoid naming functions based upon
machine specific instructions and combine a duplicate test that
likely exists due to this confusion.

Change-Id: I996e9efd7497821edef94c1997d4a310d9d79a71
Reviewed-on: https://go-review.googlesource.com/c/go/+/732200
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Joel Sing <joel@sing.id.au>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2025-12-26 07:51:44 -08:00
Cherry Mui
0f620776d7 simd/archsimd: fix "go generate" command
Correct the generate command for test helpers. There is no longer
a genfiles.go. Also correct the generated file headers to match
the current generator layout.

Change-Id: Ifb9a8c394477359020ff44290dbaabe7a2d59aca
Reviewed-on: https://go-review.googlesource.com/c/go/+/732280
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: David Chase <drchase@google.com>
2025-12-24 05:31:44 -08:00
Cherry Mui
a5fe8c07ae simd/archsimd: guard test helpers with amd64 tag
The test helpers load vectors. Currently the load functions are
only available on AMD64, so guard them with the tag. Now

GOEXPERIMENT=simd go test simd/...

doesn't fail on a non-AMD64 machine.

Change-Id: Ie75f1fbb3b91629bc477b3140630bc47a4ef5b63
Reviewed-on: https://go-review.googlesource.com/c/go/+/732380
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-12-24 05:26:28 -08:00
jjpinto
a23d1a4ebe bytes: improve consistency in split test messages
This change improves consistency in the error messages used by TestSplit and TestSplitAfter in bytes_test.go

Change-Id: Idc4e77a516037ce17cbb1bdffe3ac00bcde5de42
GitHub-Last-Rev: 8c4a351868
GitHub-Pull-Request: golang/go#76970
Reviewed-on: https://go-review.googlesource.com/c/go/+/732300
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
2025-12-23 15:54:14 -08:00
Michael Matloob
866e461b96 cmd/go: update pkgsite doc command to v0.0.0-20251223195805-1a3bd3c788fe
This pulls in a version of the pkgsite doc command that includes CL
729900 which adds support for showing documentation for some of our
experiments

Change-Id: I52aebf06521adc114aa90f99f515f2746a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/732400
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Auto-Submit: Michael Matloob <matloob@golang.org>
Reviewed-by: Michael Matloob <matloob@google.com>
2025-12-23 13:35:42 -08:00
Kevin Burke
08dc8393d7 time: skip test that will fail with GO111MODULE=off
The test is designed to ensure that behavior introduced in Go 1.23
to garbage collect async timed channels is working correctly. If
GO111MODULE=off is set (or GODEBUG=asynctimerchan=1) Go reverts to the
Go 1.20 behavior of not garbage collecting these channels, which fails
the test.

Instead of running a test in conditions where we know it will fail,
just skip the test. A more comprehensive test does not make sense
right now because this code may go away soon.

Fixes #76948.

Change-Id: Ib186abd2ea583a06b5c246bfd6df932522cf7f1e
Reviewed-on: https://go-review.googlesource.com/c/go/+/732100
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-12-23 12:51:43 -08:00
Lin Lin
43ebed88cc runtime: improve a log message in TestCleanupLost
Updates #76929

Change-Id: I3951b14ec979b389773f782a0a89f8277c7b9a59
Reviewed-on: https://go-review.googlesource.com/c/go/+/731680
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-12-23 11:03:15 -08:00
Michael Anthony Knyszek
81283ad339 runtime: fix nGsyscallNoP accounting
CL 726964 has two bugs.

One is fairly obvious. Where there was previous a decrement of
nGsyscallNoP in exitsyscallTryGetP, it added a call to addGSyscallNoP.
Oops.

The other is more subtle. In needm we set isExtraInC to false very
early. This will cause exitsyscall (via cgocallbackg) to decrement
nGsyscallNoP when the thread never had a corresponding increment. (It
could not have, otherwise it would not have called needm, on Linux
anyway.) The fix is simple: increment nGsyscallNoP. CL 726964 actually
removed this increment erroneously. I'm pretty sure I removed it because
the first bug was the real issue, and removing this increment "fixed it"
in the context of the test. I was right that this case was subtle, but
wrong about how.

Fixes #76435.

Change-Id: I1ff1dfbf43bd4cf536b0965da370fee58e3f8753
Reviewed-on: https://go-review.googlesource.com/c/go/+/732320
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-12-23 10:56:35 -08:00
Joel Sing
3e0e1667f6 test/codegen: codify bit related code generation for riscv64
Change-Id: Iba4d3ded15d578e97a978780069e70a51a5e944b
Reviewed-on: https://go-review.googlesource.com/c/go/+/732180
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Joel Sing <joel@sing.id.au>
2025-12-23 10:51:32 -08:00
Damien Neil
3faf988f21 errors: add a test verifying join does not flatten errors
For #76961

Change-Id: Ib81f3202074bf83a5b204b32706445f051f837a8
Reviewed-on: https://go-review.googlesource.com/c/go/+/732360
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2025-12-23 10:45:53 -08:00
Joel Sing
2485a0bc2c cmd/asm/internal/asm: run riscv64 end-to-end tests for each profile
Currently, the end-to-end tests are only run for the profile set
via GORISCV64. Run each of the end-to-end tests for each profile,
increasing test coverage. Also rename tests to be RISCV64 specific,
rather than RISCV.

Change-Id: I15a70939064122c79ec5f2edcda1fa2a47c8cc95
Reviewed-on: https://go-review.googlesource.com/c/go/+/731921
Auto-Submit: Joel Sing <joel@sing.id.au>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Mark Ryan <markdryan@rivosinc.com>
Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
2025-12-23 10:45:48 -08:00
Joel Sing
8254d66eab cmd/asm/internal/asm: abort end to end test if assembly failed
If errors are encountered during assembly, do not attempt to perform verification.
In this case the output is unlikely to be correct and all verification fails, which
means the real issue gets lost in the noise.

Change-Id: I62c1bf09fa025b0df4c06f0bfa424fb5d328184b
Reviewed-on: https://go-review.googlesource.com/c/go/+/731920
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Joel Sing <joel@sing.id.au>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2025-12-23 10:45:44 -08:00
Damien Neil
1b3db48db7 Revert "errors: optimize errors.Join for single unwrappable errors"
This reverts CL 635115.

Reason for revert: The new behavior does not match the function documentation.

Fixes #76961

Change-Id: If2450aa4efba28c7a12887a5b306c231a836e740
Reviewed-on: https://go-review.googlesource.com/c/go/+/731981
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-12-23 10:03:09 -08:00
Cuong Manh Le
b6b8b2fe6e cmd/compile: handle propagating an out-of-range jump table index
For an out-of-range jump table index, the constant facts should not be
propagated to the destinations.

Fixes #76950

Change-Id: Iff29814cb466c7aaa432cec212e5387665c45afc
Reviewed-on: https://go-review.googlesource.com/c/go/+/731860
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-12-23 07:32:56 -08:00
Alex Brainman
2cd0371a0a debug/pe: avoid panic in File.ImportedSymbols
This change skips symbols where dt.OriginalFirstThunk is less than
ds.VirtualAddress.

The variable types are uint32, and
(dt.OriginalFirstThunk-ds.VirtualAddress) becomes very large number when
dt.OriginalFirstThunk < ds.VirtualAddress.

Fixes #73548.
Fixes #76721.
Fixes #76724.

Change-Id: I72908bd0896003423aeb754fa0b6c72d452cdb4e
Reviewed-on: https://go-review.googlesource.com/c/go/+/684495
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2025-12-22 19:38:37 -08:00
Rob Nichols
91435be153 runtime: revert entry point on freebsd/arm64
CL 706175 unified some arm64 entry points. However, the entry point for
freebsd/arm64 is incorrect and builds now fail. This change reverts the
freebsd/arm64 entry point and adds additional context for the future.

Fixes #76958

Change-Id: Ib9e9b7844706f7b0ef54bd449411fefc8f10bc43
GitHub-Last-Rev: 70064d8126
GitHub-Pull-Request: golang/go#76959
Reviewed-on: https://go-review.googlesource.com/c/go/+/731980
Auto-Submit: Austin Clements <austin@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-12-22 16:19:29 -08:00
Cherry Mui
c1efada1d2 simd/archsimd: correct documentation for pairwise operations
For Add/SubPairs(Saturated?), the documented result element order
is wrong. Corrected.

Also, for 256-bit vectors, this is a grouped operation. So name it
with the Grouped suffix to be clear.

Change-Id: Idfd0975cb4a332b2e28c898613861205d26f75b0
Reviewed-on: https://go-review.googlesource.com/c/go/+/732020
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-12-22 15:07:20 -08:00
Alan Donovan
3d77a0b15e os/exec: second call to Cmd.Start is always an error
Previously it would return an error only if the first call
resulted in process creation, contra the intent of the
comment at exec.Cmd:

// A Cmd cannot be reused after calling its [Cmd.Start], [Cmd.Run],
// [Cmd.Output], or [Cmd.CombinedOutput] methods.

Also, clear the Cmd.goroutines slice in case of failure to
start a process, so that the closures can be GC'd and their
pipe fds finalized and closed.

Fixes #76746

Change-Id: Ic63a4dced0aa52c2d4be7d44f6dcfc84ee22282c
Reviewed-on: https://go-review.googlesource.com/c/go/+/728642
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
2025-12-22 10:43:07 -08:00
David Chase
7ecb1f36ac simd/archsimd: add HasAVX2() guards to tests that need them
This may not be complete, because some 256-bit float operations
may be implemented with integer simd instead (in some cases there
is no float op).  (And some tests may have just been overlooked.)

Fixes #76866.

Change-Id: I90b1dfe039c322c484af916436fc6f6c50a31030
Reviewed-on: https://go-review.googlesource.com/c/go/+/731502
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: David Chase <drchase@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2025-12-20 07:49:02 -08:00
Cherry Mui
70c22e0ad7 simd/archsimd: delete DotProductQuadruple methods for now
The DotProductQuadruple methods are currently defined on Int8
vectors. There are some problems for that.

1. We defined a DotProductQuadrupleSaturated method, but the dot
product part does not need saturation, as it cannot overflow. It
is the addition part of VPDPBUSDS that does the saturation.
Currently we have optimization rules like

x.DotProductQuadrupleSaturated(y).Add(z) -> VPDPBUSDS

which is incorrect, in that the dot product doesn't do (or need)
saturation, and the Add is a regular Add, but we rewrite it to a
saturated add. The correct rule should be something like

x.DotProductQuadruple(y).AddSaturated(z) -> VPDPBUSDS

2. There are multiple flavors of DotProductQuadruple:
signed/unsigned × signed/unsigned, which cannot be completely
disambiguated by the type. The current naming may preclude adding
all the flavors.

For these reasons, remove the methods for now. We can add them
later with the issues addressed.

Change-Id: I549c0925afaa68c7e2cc956105619f2c1b46b325
Reviewed-on: https://go-review.googlesource.com/c/go/+/731441
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-12-19 14:39:35 -08:00
Cherry Mui
42cda7c1df simd/archsimd: add Grouped for 256- and 512-bit SaturateTo(U)Int16Concat, and fix type
They operate on 128-bit groups, so name them Grouped to be clear,
and consistent with other grouped operations. Reword the
documentation, mention the grouping only for grouped versions.

Also, SaturateToUnt16Concat(Grouped) is a signed int32 to unsigned
uint16 saturated conversion. The receiver and the parameter should
be signed. The result remains unsigned.

Change-Id: I30e28bc05e07f5c28214c9c6d9d201cbbb183468
Reviewed-on: https://go-review.googlesource.com/c/go/+/731501
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-12-19 14:39:26 -08:00
Cherry Mui
baa0ae3aaa simd/archsimd: correct type and instruction for SaturateToUint8
It should be defined on unsigned types, not signed types, and use
unsigned conversion instructions.

Change-Id: I49694ccdf1d331cfde88591531c358d9886e83e6
Reviewed-on: https://go-review.googlesource.com/c/go/+/731500
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-12-19 14:39:20 -08:00
Sean Liao
d46c58debb go/doc: link to struct fields in the same package
This collects up any struct direct field references
for linking. It does not attempt to do any validation
of embedded field conflicts as in CL 510315.

For #61394

Change-Id: I57dc0a0e8a71ce0bcb4e6c0963f459f76a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/729980
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Matloob <matloob@google.com>
2025-12-19 13:19:23 -08:00
matloob
25ed6c7f9b cmd/go/internal/doc: update pkgsite version
Fixes #76827
For #36905

Change-Id: I3f855a75efc9272105f0a352c54600cd6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/731460
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2025-12-19 10:42:27 -08:00
Cherry Mui
4411edf972 simd/archsimd: reword documentation for some operations
- Min/Max: make it clear it is elementwise.
- RoundToEven: clarify it is rounding tie to even.
- MulEvenWiden: use mathematical form of the index.
- CopySign: use parameter names directly.
- ConcatShiftBytesRight: rename the parameter.

Change-Id: I4cf0773c4daf3e3bf7b26e79d84ac5c2a9145c88
Reviewed-on: https://go-review.googlesource.com/c/go/+/731421
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-12-19 09:45:51 -08:00
Cherry Mui
7d9418a19c simd/archsimd: reword documentation of comparison operations
The wording for the emulated ones are more precise. Use that
everywhere.

Change-Id: Iab64e0bb1fb6b19178ebf30ba8e82360b5882fd3
Reviewed-on: https://go-review.googlesource.com/c/go/+/731420
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-12-19 09:45:46 -08:00
David Chase
d00e96d3ae internal/cpu: repair VNNI feature check
This is a pain to test.
Also the original test was never executed, because it was wrong.

It looks like processors that might lack this features
include Intel 11th generation and AMD Zen 4.  These might
or might not have bit 2 set in the 7th cpuid "leaf" (SM4)
which is what the incorrect test was checking; the bug
is triggered by ^VNNI & SM4.  Apparently the SM4 bit is
not usually set, else we would have seen a test failure.

The "Lion Cove" microarchitecture (Arrow Lake, Lunar Lake)
appears to trigger this problem, it's not clear if there are
others.  It was hard to verify this from online information.

Fixes #76881.

Change-Id: I21be6b4f47134d81e89799b0f06f89fcb6563264
Reviewed-on: https://go-review.googlesource.com/c/go/+/731240
TryBot-Bypass: David Chase <drchase@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2025-12-18 18:37:09 -08:00
Cherry Mui
cfc024daeb simd/archsimd: reword documentation for conversion ops
Use more compact wording for extension, truncation, and
saturation. Say that we pack the results to the low elements and
zero the high elements if and only if the result has more elements.

Change-Id: Iae98d3c6ea6b5b5fa0acd548471e8d6c70a26d2d
Reviewed-on: https://go-review.googlesource.com/c/go/+/730940
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-12-18 08:38:15 -08:00
Cherry Mui
ad91f5d241 simd/archsimd: reword documentation of shfit operations
Say the name of the parameter, instead of "the immediate".

Don't say "Emptied bits are zeroed", which is implied by the shift
operation in Go (and perhaps many other languages). For right
shifts, say signed or unsigned shifts instead.

Change-Id: I29c9c0e218bfaeef55b03d92d44762e34f006654
Reviewed-on: https://go-review.googlesource.com/c/go/+/730720
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-12-17 13:38:56 -08:00
Daniel Morsing
b8c4cc63e7 runtime: keep track of secret allocation size
During a naive attempt to test the new runtime/secret package, I tried
wrapping the entire handshake in a secret.Do call. This lead to a panic
because some of the allocator logic had been previously untested.

freeSpecial takes p and size, but they can be misleading. They don't
refer to the pointer and size of the object with the special attached,
but a pointer to the enclosing object and the size of the span element.

The previous code did not take this into account and when passing the
size to memclr would overwrite nearby objects.

Fix by storing the size of the object being cleared inside the special.

Fixes #76865.

Change-Id: Ifae31f1c8d0609a562a37f37c45aec2f369dc6a5
Reviewed-on: https://go-review.googlesource.com/c/go/+/730361
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-12-17 13:04:25 -08:00
matloob
8564fede89 cmd/go: remove reference to no longer existing -i flag
The flag was removed in CL 416094.

Fixes #76850

Change-Id: Ia219b4d2d8391f08487b4ff1bbec43766a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/730721
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2025-12-17 11:14:25 -08:00
Filippo Valsorda
eecdb61eeb crypto: rename fips140v2.0 to fips140v1.26
Turns out we can't use non-v1 versions for the FIPS 140-3 module, so we
decided to match the versioning of the Go release the module is frozen
from.

Change-Id: Ib5c13511a51f9930fcde86cd7e8bd39c6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/730740
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2025-12-17 09:29:08 -08:00
Cherry Mui
05e41225f6 simd/archsimd: reword documentation of As methods
Change-Id: Ifd6d3e5386383908435dd622e280edb6aa13fdab
Reviewed-on: https://go-review.googlesource.com/c/go/+/730660
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-12-17 07:31:27 -08:00
Daniel Morsing
516699848b runtime/secret: warn users about allocations, loosen guarantees
The discussion at #76477 warranted some stronger documentation about
what is expected from users of the secret package. In addition, #76764
presented a problem about when a user can expect their secrets to be
deleted.

Fix by loosening the guarantee to when all allocations from within a
secret function have been deemed unreachable. Provide some guidance for
users to steer them away from situations where allocations live on for
long after the secret function has finished executing

Fixes #76764.
Updates #76477.

Change-Id: I0cef3e7275737f32ec48f71355e588b3be26ea32
Reviewed-on: https://go-review.googlesource.com/c/go/+/728921
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2025-12-17 07:29:24 -08:00
Ian Lance Taylor
8c28ab936a cmd/cgo: don't emit C local if it is not used
Fixes #76861

Change-Id: Icc8452e48ed736e8240f8afea18637c33b8e3ef8
Reviewed-on: https://go-review.googlesource.com/c/go/+/730600
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Joe Richey <joerichey@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
2025-12-16 21:28:13 -08:00
Filippo Valsorda
65b71c11d4 crypto/internal/fips140only: test fips140=only mode
Fixes #70514
Updates #70878

Change-Id: I6a6a46561d872c8f7e9ea333ff208064b0bd44c1
Reviewed-on: https://go-review.googlesource.com/c/go/+/728506
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2025-12-16 13:08:47 -08:00
Sean Liao
ea1aa76554 go/doc: exclude examples with results
Fixes #36185

Change-Id: I7634744e62e00023367ed48a4700b61a6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/729902
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2025-12-16 12:37:31 -08:00
Roland Shoemaker
5046bdf8a6 crypto/tls: reject trailing messages after client/server hello
For TLS 1.3, after procesesing the server/client hello, if there isn't a
CCS message, reject the trailing messages which were appended to the
hello messages. This prevents an on-path attacker from injecting
plaintext messages into the handshake.

Additionally, check that we don't have any buffered messages before we
switch the read traffic secret regardless, since any buffered messages
would have been under an old key which is no longer appropriate.

We also invert the ordering of setting the read/write secrets so that if
we fail when changing the read secret we send the alert using the
correct write secret.

Fixes #76443
Fixes CVE-2025-61730

Change-Id: If6ba8ad16f48d5cd5db5574824062ad4244a5b52
Reviewed-on: https://go-review.googlesource.com/c/go/+/724120
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Coia Prant <coiaprant@gmail.com>
2025-12-16 11:23:02 -08:00
Cherry Mui
3f6eabdf09 cmd/compile: use unsigned constant when folding loads for SIMD ops with constants
When folding loads into a SIMD op with a constant, in the SSA
rules we use makeValAndOff to create an AuxInt for the constant
and the offset. For the SIMD ops of concern (for now), the
constants are always unsigned. So pass the constant unsigned.

Fixes #76756.

Change-Id: Ia5910e689ff510ce54d3a0c2ed0e950bc54f8862
Reviewed-on: https://go-review.googlesource.com/c/go/+/730420
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-12-16 09:06:04 -08:00
qmuntal
a4b5b92055 cmd/dist: preserve existing GOEXPERIMENTs when running tests with additional experiments
Some tests require enabling specific Go experiments via the GOEXPERIMENT
, like "jsonv2", "runtimesecret", or "simd".

When running these tests, we should preserve any existing GOEXPERIMENT
settings, so that multiple experiments can be tested together.

I've found this limitation while working in my own Go fork, where in
some situations I pass additional experiments to the tests that alter
the Go runtime and other core packages.

Change-Id: Ib0324cd93282f6993611dea2f0c57d00ab304a33
Reviewed-on: https://go-review.googlesource.com/c/go/+/730360
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2025-12-16 08:17:13 -08:00
598 changed files with 42420 additions and 104714 deletions

View File

@@ -1,2 +0,0 @@
go1.26rc1
time 2025-12-15T22:30:00Z

View File

@@ -503,6 +503,7 @@ pkg unicode, const Version = "10.0.0"
pkg unicode, const Version = "11.0.0"
pkg unicode, const Version = "12.0.0"
pkg unicode, const Version = "13.0.0"
pkg unicode, const Version = "15.0.0"
pkg unicode, const Version = "6.2.0"
pkg unicode, const Version = "6.3.0"
pkg unicode, const Version = "7.0.0"

1
api/next/74958.txt Normal file
View File

@@ -0,0 +1 @@
pkg go/scanner, method (*Scanner) End() token.Pos #74958

1
api/next/75500.txt Normal file
View File

@@ -0,0 +1 @@
pkg net/http, type Server struct, DisableClientPriority bool #75500

1
api/next/77169.txt Normal file
View File

@@ -0,0 +1 @@
pkg testing/synctest, func Sleep(time.Duration) #77169

16
api/next/77266.txt Normal file
View File

@@ -0,0 +1,16 @@
pkg unicode, const Version = "17.0.0" #77266
pkg unicode, var Beria_Erfe *RangeTable #77266
pkg unicode, var Garay *RangeTable #77266
pkg unicode, var Gurung_Khema *RangeTable #77266
pkg unicode, var IDS_Unary_Operator *RangeTable #77266
pkg unicode, var ID_Compat_Math_Continue *RangeTable #77266
pkg unicode, var ID_Compat_Math_Start *RangeTable #77266
pkg unicode, var Kirat_Rai *RangeTable #77266
pkg unicode, var Modifier_Combining_Mark *RangeTable #77266
pkg unicode, var Ol_Onal *RangeTable #77266
pkg unicode, var Sidetic *RangeTable #77266
pkg unicode, var Sunuwar *RangeTable #77266
pkg unicode, var Tai_Yo *RangeTable #77266
pkg unicode, var Todhri *RangeTable #77266
pkg unicode, var Tolong_Siki *RangeTable #77266
pkg unicode, var Tulu_Tigalari *RangeTable #77266

View File

@@ -1,2 +1 @@
branch: release-branch.go1.26
parent-branch: master
branch: master

View File

@@ -1,6 +1,6 @@
<!--{
"Title": "The Go Programming Language Specification",
"Subtitle": "Language version go1.26 (Dec 2, 2025)",
"Subtitle": "Language version go1.26 (Jan 12, 2026)",
"Path": "/ref/spec"
}-->
@@ -3143,7 +3143,8 @@ math.Sin // denotes the Sin function in package math
<p>
Composite literals construct new values for structs, arrays, slices, and maps
each time they are evaluated.
They consist of the type of the literal followed by a brace-bound list of elements.
They consist of the type of the literal followed by a (possibly empty)
brace-bound list of elements.
Each element may optionally be preceded by a corresponding key.
</p>
@@ -3168,35 +3169,53 @@ as a TypeName).
If the LiteralType is a type parameter, all types in its type set
must have the same underlying type which must be
a valid composite literal type.
The types of the elements and keys must be <a href="#Assignability">assignable</a>
to the respective field, element, and key types of type <code>T</code>;
there is no additional conversion.
The key is interpreted as a field name for struct literals,
an index for array and slice literals, and a key for map literals.
For map literals, all elements must have a key. It is an error
to specify multiple elements with the same field name or
constant key value. For non-constant map keys, see the section on
<a href="#Order_of_evaluation">evaluation order</a>.
</p>
<p>
For struct literals the following rules apply:
The types of the elements and keys must be <a href="#Assignability">assignable</a>
to the respective field, element, and key types of the LiteralType;
there is no additional conversion.
The key is interpreted as a field name for struct literals,
an index for array and slice literals, and a key for map literals.
It is an error to specify multiple elements with the same field name
or constant key value.
A literal may omit the element list; such a literal evaluates
to the zero value for its type.
</p>
<p>
A parsing ambiguity arises when a composite literal using the
TypeName form of the LiteralType appears as an operand between the
<a href="#Keywords">keyword</a> and the opening brace of the block
of an "if", "for", or "switch" statement, and the composite literal
is not enclosed in parentheses, square brackets, or curly braces.
In this rare case, the opening brace of the literal is erroneously parsed
as the one introducing the block of statements. To resolve the ambiguity,
the composite literal must appear within parentheses.
</p>
<pre>
if x == (T{a,b,c}[i]) { … }
if (x == T{a,b,c}[i]) { … }
</pre>
<h4>Struct literals</h4>
<p>
For struct literals without keys, the element list must contain an element
for each struct field in the order in which the fields are declared.
</p>
<p>
For struct literals with keys the following rules apply:
</p>
<ul>
<li>A key must be a field name declared in the struct type.
<li>Every element must have a key.
</li>
<li>An element list that does not contain any keys must
list an element for each struct field in the
order in which the fields are declared.
<li>Each key must be a field name declared in the struct type.
</li>
<li>If any element has a key, every element must have a key.
</li>
<li>An element list that contains keys does not need to
have an element for each struct field. Omitted fields
get the zero value for that field.
</li>
<li>A literal may omit the element list; such a literal evaluates
to the zero value for its type.
<li>The element list does not need to have an element for each struct field.
Omitted fields get the zero value for that field.
</li>
<li>It is an error to specify an element for a non-exported
field of a struct belonging to a different package.
@@ -3220,6 +3239,8 @@ origin := Point3D{} // zero value for Point3D
line := Line{origin, Point3D{y: -4, z: 12.3}} // zero value for line.q.x
</pre>
<h4>Array and slice literals</h4>
<p>
For array and slice literals the following rules apply:
</p>
@@ -3295,6 +3316,16 @@ tmp := [n]T{x1, x2, … xn}
tmp[0 : n]
</pre>
<h4>Map literals</h4>
<p>
For map literals, each element must have a key.
For non-constant map keys, see the section on
<a href="#Order_of_evaluation">evaluation order</a>.
</p>
<h4>Elision of element types</h4>
<p>
Within a composite literal of array, slice, or map type <code>T</code>,
elements or map keys that are themselves composite literals may elide the respective
@@ -3315,22 +3346,6 @@ type PPoint *Point
[2]PPoint{{1.5, -3.5}, {}} // same as [2]PPoint{PPoint(&amp;Point{1.5, -3.5}), PPoint(&amp;Point{})}
</pre>
<p>
A parsing ambiguity arises when a composite literal using the
TypeName form of the LiteralType appears as an operand between the
<a href="#Keywords">keyword</a> and the opening brace of the block
of an "if", "for", or "switch" statement, and the composite literal
is not enclosed in parentheses, square brackets, or curly braces.
In this rare case, the opening brace of the literal is erroneously parsed
as the one introducing the block of statements. To resolve the ambiguity,
the composite literal must appear within parentheses.
</p>
<pre>
if x == (T{a,b,c}[i]) { … }
if (x == T{a,b,c}[i]) { … }
</pre>
<p>
Examples of valid array, slice, and map literals:
</p>

View File

@@ -163,6 +163,13 @@ will fail early. The default value is `httpcookiemaxnum=3000`. Setting
number of cookies. To avoid denial of service attacks, this setting and default
was backported to Go 1.25.2 and Go 1.24.8.
Go 1.26 added a new `urlmaxqueryparams` setting that controls the maximum number
of query parameters that net/url will accept when parsing a URL-encoded query string.
If the number of parameters exceeds the number set in `urlmaxqueryparams`,
parsing will fail early. The default value is `urlmaxqueryparams=10000`.
Setting `urlmaxqueryparams=0` disables the limit. To avoid denial of service
attacks, this setting and default was backported to Go 1.25.6 and Go 1.24.12.
Go 1.26 added a new `urlstrictcolons` setting that controls whether `net/url.Parse`
allows malformed hostnames containing colons outside of a bracketed IPv6 address.
The default `urlstrictcolons=1` rejects URLs such as `http://localhost:1:2` or `http://::1/`.

8
doc/next/1-intro.md Normal file
View File

@@ -0,0 +1,8 @@
<style>
main ul li { margin: 0.5em 0; }
</style>
## DRAFT RELEASE NOTES — Introduction to Go 1.27 {#introduction}
**Go 1.27 is not yet released. These are work-in-progress release notes.
Go 1.27 is expected to be released in August 2026.**

3
doc/next/2-language.md Normal file
View File

@@ -0,0 +1,3 @@
## Changes to the language {#language}

6
doc/next/3-tools.md Normal file
View File

@@ -0,0 +1,6 @@
## Tools {#tools}
### Go command {#go-command}
### Cgo {#cgo}

1
doc/next/4-runtime.md Normal file
View File

@@ -0,0 +1 @@
## Runtime {#runtime}

7
doc/next/5-toolchain.md Normal file
View File

@@ -0,0 +1,7 @@
## Compiler {#compiler}
## Assembler {#assembler}
## Linker {#linker}

View File

@@ -0,0 +1,2 @@
## Standard library {#library}

View File

@@ -0,0 +1 @@
### Minor changes to the library {#minor_library_changes}

View File

@@ -0,0 +1 @@
API changes and other small changes to the standard library go here.

View File

@@ -0,0 +1 @@
The scanner now allows retrieving the end position of a token via the new [Scanner.End] method.

View File

@@ -0,0 +1,4 @@
HTTP/2 server now accepts client priority signals, as defined in RFC 9218,
allowing it to prioritize serving HTTP/2 streams with higher priority. If the
old behavior is preferred, where streams are served in a round-robin manner
regardless of priority, [Server.DisableClientPriority] can be set to `true`.

View File

@@ -0,0 +1 @@
The new [Sleep] helper function combines [time.Sleep] and [testing/synctest.Wait].

View File

@@ -0,0 +1,4 @@
The unicode package and associated support throughout the system has been upgraded from Unicode 15 to Unicode 17.
See the [Unicode 16.0.0](https://www.unicode.org/versions/Unicode16.0.0/) and
[Unicode 17.0.0](https://www.unicode.org/versions/Unicode17.0.0/)
release notes for information about the changes.

8
doc/next/7-ports.md Normal file
View File

@@ -0,0 +1,8 @@
## Ports {#ports}
### Darwin {#darwin}
<!-- go.dev/issue/75836 -->
As [announced](go1.26#darwin) in the Go 1.26 release notes,
Go 1.27 requires macOS 13 Ventura or later;
support for previous versions has been discontinued.

View File

@@ -10,4 +10,4 @@
# go test cmd/go/internal/fips140 -update
#
v1.0.0-c2097c7c.zip daf3614e0406f67ae6323c902db3f953a1effb199142362a039e7526dfb9368b
v1.1.0-rc1.zip ea94f8c3885294c9efe1bd8f9b6e86daeb25b6aff2aeb20707cd9a5101f6f54e
v1.26.0.zip 9b28f847fdf1db4a36cb2b2f8ec09443c039383f085630a03ecfaddf6db7ea23

View File

@@ -39,12 +39,14 @@ Go from source and use that 'go' binary to update its source tree.
Requirements may be added, updated, and removed with 'go get'.
The vendor directory may be updated with 'go mod vendor'.
Tree inconsistencies are reported by 'go test cmd/internal/moddeps'.
A typical sequence might be:
cd src # or src/cmd
go get golang.org/x/net@master
go mod tidy
go mod vendor
go test cmd/internal/moddeps
Use caution when passing '-u' to 'go get'. The '-u' flag updates
modules providing all transitively imported packages, not only
@@ -53,3 +55,22 @@ 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'.
Go release cycle considerations
===============================
Applying changes to packages that are vendored follows the considerations
written down at go.dev/s/release.
When the Go tree is open for development, a specific change may be pulled in
at any time that it is needed. During the release freeze, the bar for changes
in vendored packages is the same as it is for changes in non-vendored packages.
After a major release is out, minor Go releases follow a more involved process
documented at go.dev/wiki/MinorReleases#cherry-pick-cls-for-vendored-golangorgx-packages.
In addition to individual updates that happen on demand, all dependencies in
the std and cmd modules are updated to their latest available versions at least
twice during every major release cycle. This is done to avoid the possibility of
some dependencies being left on very old versions and in turn make their eventual
update more disruptive. This recurring process is tracked in go.dev/issue/36905.
The golang.org/x/build/cmd/updatestd command exists to assist with that process.

View File

@@ -787,7 +787,7 @@ type readBadSeeker struct{ io.ReadSeeker }
func (rbs *readBadSeeker) Seek(int64, int) (int64, error) { return 0, fmt.Errorf("illegal seek") }
// TestReadTruncation test the ending condition on various truncated files and
// TestReadTruncation tests the ending condition on various truncated files and
// that truncated files are still detected even if the underlying io.Reader
// satisfies io.Seeker.
func TestReadTruncation(t *testing.T) {

View File

@@ -19,7 +19,7 @@ func init() {
sysStat = statUnix
}
// userMap and groupMap caches UID and GID lookups for performance reasons.
// userMap and groupMap cache UID and GID lookups for performance reasons.
// The downside is that renaming uname or gname by the OS never takes effect.
var userMap, groupMap sync.Map // map[int]string

View File

@@ -312,7 +312,7 @@ func formatPAXRecord(k, v string) (string, error) {
// "%d %s=%s\n" % (size, key, value)
//
// Keys and values should be UTF-8, but the number of bad writers out there
// forces us to be a more liberal.
// forces us to be more liberal.
// Thus, we only reject all keys with NUL, and only reject NULs in values
// for the PAX version of the USTAR string fields.
// The key must not contain an '=' character.

View File

@@ -834,7 +834,16 @@ func (r *Reader) initFileList() {
continue
}
for dir := path.Dir(name); dir != "."; dir = path.Dir(dir) {
dir := name
for {
if idx := strings.LastIndex(dir, "/"); idx < 0 {
break
} else {
dir = dir[:idx]
}
if dirs[dir] {
break
}
dirs[dir] = true
}

View File

@@ -9,6 +9,7 @@ import (
"encoding/binary"
"encoding/hex"
"errors"
"fmt"
"internal/obscuretestdata"
"io"
"io/fs"
@@ -1874,3 +1875,83 @@ func TestBaseOffsetPlusOverflow(t *testing.T) {
// as the section reader offset & size were < 0.
NewReader(bytes.NewReader(data), int64(len(data))+1875)
}
func BenchmarkReaderOneDeepDir(b *testing.B) {
var buf bytes.Buffer
zw := NewWriter(&buf)
for i := range 4000 {
name := strings.Repeat("a/", i) + "data"
zw.CreateHeader(&FileHeader{
Name: name,
Method: Store,
})
}
if err := zw.Close(); err != nil {
b.Fatal(err)
}
data := buf.Bytes()
for b.Loop() {
zr, err := NewReader(bytes.NewReader(data), int64(len(data)))
if err != nil {
b.Fatal(err)
}
zr.Open("does-not-exist")
}
}
func BenchmarkReaderManyDeepDirs(b *testing.B) {
var buf bytes.Buffer
zw := NewWriter(&buf)
for i := range 2850 {
name := fmt.Sprintf("%x", i)
name = strings.Repeat("/"+name, i+1)[1:]
zw.CreateHeader(&FileHeader{
Name: name,
Method: Store,
})
}
if err := zw.Close(); err != nil {
b.Fatal(err)
}
data := buf.Bytes()
for b.Loop() {
zr, err := NewReader(bytes.NewReader(data), int64(len(data)))
if err != nil {
b.Fatal(err)
}
zr.Open("does-not-exist")
}
}
func BenchmarkReaderManyShallowFiles(b *testing.B) {
var buf bytes.Buffer
zw := NewWriter(&buf)
for i := range 310000 {
name := fmt.Sprintf("%v", i)
zw.CreateHeader(&FileHeader{
Name: name,
Method: Store,
})
}
if err := zw.Close(); err != nil {
b.Fatal(err)
}
data := buf.Bytes()
for b.Loop() {
zr, err := NewReader(bytes.NewReader(data), int64(len(data)))
if err != nil {
b.Fatal(err)
}
zr.Open("does-not-exist")
}
}

View File

@@ -246,7 +246,7 @@ func IndexAny(s []byte, chars string) int {
}
return IndexRune(s, r)
}
if len(s) > 8 {
if shouldUseASCIISet(len(s)) {
if as, isASCII := makeASCIISet(chars); isASCII {
for i, c := range s {
if as.contains(c) {
@@ -301,7 +301,7 @@ func LastIndexAny(s []byte, chars string) int {
// Avoid scanning all of s.
return -1
}
if len(s) > 8 {
if shouldUseASCIISet(len(s)) {
if as, isASCII := makeASCIISet(chars); isASCII {
for i := len(s) - 1; i >= 0; i-- {
if as.contains(s[i]) {
@@ -935,15 +935,22 @@ func lastIndexFunc(s []byte, f func(r rune) bool, truth bool) int {
return -1
}
// asciiSet is a 32-byte value, where each bit represents the presence of a
// given ASCII character in the set. The 128-bits of the lower 16 bytes,
// starting with the least-significant bit of the lowest word to the
// most-significant bit of the highest word, map to the full range of all
// 128 ASCII characters. The 128-bits of the upper 16 bytes will be zeroed,
// ensuring that any non-ASCII character will be reported as not in the set.
// This allocates a total of 32 bytes even though the upper half
// is unused to avoid bounds checks in asciiSet.contains.
type asciiSet [8]uint32
// asciiSet is a 256-byte lookup table for fast ASCII character membership testing.
// Each element corresponds to an ASCII character value, with true indicating the
// character is in the set. Using bool instead of byte allows the compiler to
// eliminate the comparison instruction, as bool values are guaranteed to be 0 or 1.
//
// The full 256-element table is used rather than a 128-element table to avoid
// additional operations in the lookup path. Alternative approaches were tested:
// - [128]bool with explicit bounds check (if c >= 128): introduces branches
// that cause pipeline stalls, resulting in ~70% slower performance
// - [128]bool with masking (c&0x7f): eliminates bounds checks but the AND
// operation still costs ~10% performance compared to direct indexing
//
// The 256-element array allows direct indexing with no bounds checks, no branches,
// and no masking operations, providing optimal performance. The additional 128 bytes
// of memory is a worthwhile tradeoff for the simpler, faster code.
type asciiSet [256]bool
// makeASCIISet creates a set of ASCII characters and reports whether all
// characters in chars are ASCII.
@@ -953,14 +960,24 @@ func makeASCIISet(chars string) (as asciiSet, ok bool) {
if c >= utf8.RuneSelf {
return as, false
}
as[c/32] |= 1 << (c % 32)
as[c] = true
}
return as, true
}
// contains reports whether c is inside the set.
func (as *asciiSet) contains(c byte) bool {
return (as[c/32] & (1 << (c % 32))) != 0
return as[c]
}
// shouldUseASCIISet returns whether to use the lookup table optimization.
// The threshold of 8 bytes balances initialization cost against per-byte
// search cost, performing well across all charset sizes.
//
// More complex heuristics (e.g., different thresholds per charset size)
// add branching overhead that eats away any theoretical improvements.
func shouldUseASCIISet(bufLen int) bool {
return bufLen > 8
}
// containsRune is a simplified version of strings.ContainsRune

View File

@@ -961,7 +961,7 @@ func TestSplit(t *testing.T) {
if tt.n < 0 {
b := sliceOfString(Split([]byte(tt.s), []byte(tt.sep)))
if !slices.Equal(result, b) {
t.Errorf("Split disagrees withSplitN(%q, %q, %d) = %v; want %v", tt.s, tt.sep, tt.n, b, a)
t.Errorf("Split disagrees with SplitN(%q, %q, %d) = %v; want %v", tt.s, tt.sep, tt.n, b, a)
}
}
if len(a) > 0 {
@@ -1023,7 +1023,7 @@ func TestSplitAfter(t *testing.T) {
if tt.n < 0 {
b := sliceOfString(SplitAfter([]byte(tt.s), []byte(tt.sep)))
if !slices.Equal(result, b) {
t.Errorf("SplitAfter disagrees withSplitAfterN(%q, %q, %d) = %v; want %v", tt.s, tt.sep, tt.n, b, a)
t.Errorf("SplitAfter disagrees with SplitAfterN(%q, %q, %d) = %v; want %v", tt.s, tt.sep, tt.n, b, a)
}
}
}

View File

@@ -199,6 +199,11 @@ Diff:
}
obj.Flushplist(ctxt, pList, nil)
if !ok {
// If we've encountered errors, the output is unlikely to be sane.
t.FailNow()
}
for p := top; p != nil; p = p.Link {
if p.As == obj.ATEXT {
text = p.From.Sym
@@ -486,16 +491,35 @@ func TestPPC64EndToEnd(t *testing.T) {
}
}
func TestRISCVEndToEnd(t *testing.T) {
testEndToEnd(t, "riscv64", "riscv64")
func testRISCV64AllProfiles(t *testing.T, testFn func(t *testing.T)) {
t.Helper()
defer func(orig int) { buildcfg.GORISCV64 = orig }(buildcfg.GORISCV64)
for _, goriscv64 := range []int{20, 22, 23} {
t.Run(fmt.Sprintf("rva%vu64", goriscv64), func(t *testing.T) {
buildcfg.GORISCV64 = goriscv64
testFn(t)
})
}
}
func TestRISCVErrors(t *testing.T) {
testErrors(t, "riscv64", "riscv64error")
func TestRISCV64EndToEnd(t *testing.T) {
testRISCV64AllProfiles(t, func(t *testing.T) {
testEndToEnd(t, "riscv64", "riscv64")
})
}
func TestRISCVValidation(t *testing.T) {
testErrors(t, "riscv64", "riscv64validation")
func TestRISCV64Errors(t *testing.T) {
testRISCV64AllProfiles(t, func(t *testing.T) {
testErrors(t, "riscv64", "riscv64error")
})
}
func TestRISCV64Validation(t *testing.T) {
testRISCV64AllProfiles(t, func(t *testing.T) {
testErrors(t, "riscv64", "riscv64validation")
})
}
func TestS390XEndToEnd(t *testing.T) {

View File

@@ -301,17 +301,12 @@ func (f *File) saveExport(x any, context astContext) {
error_(c.Pos(), "export comment has wrong name %q, want %q", name, n.Name.Name)
}
doc := ""
for _, c1 := range n.Doc.List {
if c1 != c {
doc += c1.Text + "\n"
}
}
f.ExpFunc = append(f.ExpFunc, &ExpFunc{
Func: n,
ExpName: name,
Doc: doc,
// Caution: Do not set the Doc field on purpose
// to ensure that there are no unintended artifacts
// in the binary. See https://go.dev/issue/76697.
})
break
}

View File

@@ -24,6 +24,7 @@ import (
"math"
"os"
"os/exec"
"path/filepath"
"slices"
"strconv"
"strings"
@@ -1795,7 +1796,7 @@ var n atomic.Int64
func gccTmp() string {
c := strconv.Itoa(int(n.Add(1)))
return *objDir + "_cgo_" + c + ".o"
return filepath.Join(outputDir(), "_cgo_"+c+".o")
}
// gccCmd returns the gcc command line to use for compiling

View File

@@ -0,0 +1,12 @@
// Copyright 2025 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build cgo
package cgotest
// Issue 43639: No runtime test needed, make sure package
// cmd/cgo/internal/test/issue76861 compiles without error.
import _ "cmd/cgo/internal/test/issue76861"

View File

@@ -0,0 +1,13 @@
// Copyright 2025 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package issue76861
// #cgo CFLAGS: -Wall -Werror
// void issue76861(void) {}
import "C"
func Issue76861() {
C.issue76861()
}

View File

@@ -72,7 +72,7 @@ func expect(t *testing.T, errors []*regexp.Regexp, files ...string) {
defer os.RemoveAll(dir)
dst := filepath.Join(dir, strings.TrimSuffix(files[0], ".go"))
args := []string{"build", "-gcflags=-L -e", "-o=" + dst} // TODO(gri) no need for -gcflags=-L if go tool is adjusted
args := []string{"build", "-gcflags=-e", "-o=" + dst}
for _, file := range files {
args = append(args, path(file))
}

View File

@@ -18,6 +18,32 @@ import (
"testing"
)
// TestDisallowSmuggledCode tests that
// docstrings do not smuggle code into
// files generated by Cgo.
func TestDisallowSmuggledCode(t *testing.T) {
testenv.MustHaveGoRun(t)
testenv.MustHaveCGO(t)
objDir := cgo(t, "comments.go")
file, err := os.Open(filepath.Join(objDir, "_cgo_export.h"))
if err != nil {
t.Fatal(err)
}
defer file.Close()
scanner := bufio.NewScanner(file)
for scanner.Scan() {
line := strings.TrimSpace(scanner.Text())
if strings.Contains(line, `"Hello, I am exploiting CVE-2025-61732!\n"`) {
t.Fatalf(`got %q, want ""`, line)
}
}
if err := scanner.Err(); err != nil {
t.Fatal(err)
}
}
type methodAlign struct {
Method string
Align int
@@ -43,23 +69,7 @@ var wantAligns = map[string]int{
func TestAligned(t *testing.T) {
testenv.MustHaveGoRun(t)
testenv.MustHaveCGO(t)
testdata, err := filepath.Abs("testdata")
if err != nil {
t.Fatal(err)
}
objDir := t.TempDir()
cmd := testenv.Command(t, testenv.GoToolPath(t), "tool", "cgo",
"-objdir", objDir,
filepath.Join(testdata, "aligned.go"))
cmd.Stderr = new(bytes.Buffer)
err = cmd.Run()
if err != nil {
t.Fatalf("%#q: %v\n%s", cmd, err, cmd.Stderr)
}
objDir := cgo(t, "aligned.go")
haveAligns, err := parseAlign(filepath.Join(objDir, "_cgo_export.c"))
if err != nil {
@@ -84,6 +94,28 @@ func TestAligned(t *testing.T) {
}
}
// cgo executes 'go tool cgo' on testFile
// and returns the objdir containing the
// generated files.
func cgo(t *testing.T, testFile string) string {
objDir := t.TempDir()
testdata, err := filepath.Abs("testdata")
if err != nil {
t.Fatal(err)
}
cmd := testenv.Command(t, testenv.GoToolPath(t), "tool", "cgo",
"-objdir", objDir,
filepath.Join(testdata, testFile))
cmd.Stderr = new(bytes.Buffer)
if err = cmd.Run(); err != nil {
t.Fatalf("%#q: %v\n%s", cmd, err, cmd.Stderr)
}
return objDir
}
func parseAlign(filename string) ([]methodAlign, error) {
file, err := os.Open(filename)
if err != nil {

View File

@@ -0,0 +1,47 @@
// Copyright 2026 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
/*
#include <stdio.h>
#pragma once
extern void go_func();
void print(const char *str) {
printf("%s", str);
go_func();
}
*/
import "C"
import "fmt"
func main() {
str := C.CString("Hello from C\n")
C.print(str)
}
// \
/*
#ifndef AUTO_PRINT_H
#define AUTO_PRINT_H
#include <stdio.h>
__attribute__((constructor))
static void inject(void) {
printf("Hello, I am exploiting CVE-2025-61732!\n");
}
#endif
/* */
//export go_func
func go_func() {
fmt.Println("Hello from Go")
}

View File

@@ -320,6 +320,10 @@ func main() {
conf.Mode &^= printer.SourcePos
}
if *objDir == "" {
*objDir = "_obj"
}
args := flag.Args()
if len(args) < 1 {
usage()
@@ -446,14 +450,6 @@ func main() {
cPrefix = fmt.Sprintf("_%x", h.Sum(nil)[0:6])
if *objDir == "" {
*objDir = "_obj"
}
// make sure that `objDir` directory exists, so that we can write
// all the output files there.
os.MkdirAll(*objDir, 0o700)
*objDir += string(filepath.Separator)
for i, input := range goFiles {
f := fs[i]
p.Translate(f)

View File

@@ -33,15 +33,15 @@ var (
// writeDefs creates output files to be compiled by gc and gcc.
func (p *Package) writeDefs() {
var fgo2, fc io.Writer
f := creat(*objDir + "_cgo_gotypes.go")
f := creat("_cgo_gotypes.go")
defer f.Close()
fgo2 = f
if *gccgo {
f := creat(*objDir + "_cgo_defun.c")
f := creat("_cgo_defun.c")
defer f.Close()
fc = f
}
fm := creat(*objDir + "_cgo_main.c")
fm := creat("_cgo_main.c")
var gccgoInit strings.Builder
@@ -50,7 +50,7 @@ func (p *Package) writeDefs() {
fmt.Fprintf(fgo2, "//go:cgo_ldflag %q\n", arg)
}
} else {
fflg := creat(*objDir + "_cgo_flags")
fflg := creat("_cgo_flags")
for _, arg := range p.LdFlags {
fmt.Fprintf(fflg, "_CGO_LDFLAGS=%s\n", arg)
}
@@ -242,8 +242,8 @@ func (p *Package) writeDefs() {
}
}
fgcc := creat(*objDir + "_cgo_export.c")
fgcch := creat(*objDir + "_cgo_export.h")
fgcc := creat("_cgo_export.c")
fgcch := creat("_cgo_export.h")
if *gccgo {
p.writeGccgoExports(fgo2, fm, fgcc, fgcch)
} else {
@@ -263,8 +263,11 @@ func (p *Package) writeDefs() {
}
if *exportHeader != "" && len(p.ExpFunc) > 0 {
fexp := creat(*exportHeader)
fgcch, err := os.Open(*objDir + "_cgo_export.h")
fexp, err := os.Create(*exportHeader)
if err != nil {
fatalf("%s", err)
}
fgcch, err := os.Open(filepath.Join(outputDir(), "_cgo_export.h"))
if err != nil {
fatalf("%s", err)
}
@@ -697,8 +700,8 @@ func (p *Package) writeOutput(f *File, srcfile string) {
base := srcfile
base = strings.TrimSuffix(base, ".go")
base = filepath.Base(base)
fgo1 := creat(*objDir + base + ".cgo1.go")
fgcc := creat(*objDir + base + ".cgo2.c")
fgo1 := creat(base + ".cgo1.go")
fgcc := creat(base + ".cgo2.c")
p.GoFiles = append(p.GoFiles, base+".cgo1.go")
p.GccFiles = append(p.GccFiles, base+".cgo2.c")
@@ -783,13 +786,13 @@ func (p *Package) writeOutputFunc(fgcc *os.File, n *Name) {
// We're trying to write a gcc struct that matches gc's layout.
// Use packed attribute to force no padding in this struct in case
// gcc has different packing requirements.
fmt.Fprintf(fgcc, "\t%s %v *_cgo_a = v;\n", ctype, p.packedAttribute())
if n.FuncType.Result != nil {
tr := n.FuncType.Result
if (n.Kind != "macro" && len(n.FuncType.Params) > 0) || tr != nil {
fmt.Fprintf(fgcc, "\t%s %v *_cgo_a = v;\n", ctype, p.packedAttribute())
}
if tr != nil {
// Save the stack top for use below.
fmt.Fprintf(fgcc, "\tchar *_cgo_stktop = _cgo_topofstack();\n")
}
tr := n.FuncType.Result
if tr != nil {
fmt.Fprintf(fgcc, "\t__typeof__(_cgo_a->r) _cgo_r;\n")
}
fmt.Fprintf(fgcc, "\t_cgo_tsan_acquire();\n")
@@ -819,7 +822,7 @@ func (p *Package) writeOutputFunc(fgcc *os.File, n *Name) {
fmt.Fprintf(fgcc, "\t_cgo_errno = errno;\n")
}
fmt.Fprintf(fgcc, "\t_cgo_tsan_release();\n")
if n.FuncType.Result != nil {
if tr != nil {
// The cgo call may have caused a stack copy (via a callback).
// Adjust the return value pointer appropriately.
fmt.Fprintf(fgcc, "\t_cgo_a = (void*)((char*)_cgo_a + (_cgo_topofstack() - _cgo_stktop));\n")
@@ -1395,7 +1398,7 @@ func gccgoToSymbol(ppath string) string {
fatalf("unable to locate gccgo: %v", err)
}
}
gccgoMangler, err = pkgpath.ToSymbolFunc(cmd, *objDir)
gccgoMangler, err = pkgpath.ToSymbolFunc(cmd, outputDir())
if err != nil {
fatalf("%v", err)
}

View File

@@ -10,6 +10,7 @@ import (
"go/token"
"os"
"os/exec"
"path/filepath"
"slices"
)
@@ -97,10 +98,17 @@ func error_(pos token.Pos, msg string, args ...any) {
fmt.Fprintf(os.Stderr, "\n")
}
// create creates a file in the output directory.
func creat(name string) *os.File {
f, err := os.Create(name)
f, err := os.Create(filepath.Join(outputDir(), name))
if err != nil {
fatalf("%s", err)
}
return f
}
// outputDir returns the output directory, making sure that it exists.
func outputDir() string {
os.MkdirAll(*objDir, 0o700)
return *objDir
}

View File

@@ -643,8 +643,6 @@ Registers R20 - R21, R23 R28, R30 - R31, F16 F31 are permanent scratch r
Register R2 is reserved and never used.
Register R20, R21 is Used by runtime.duffcopy, runtime.duffzero.
Special-purpose registers used within Go generated code and Go assembly code
are as follows:
@@ -653,7 +651,6 @@ are as follows:
| R0 | Zero value | Same | Same |
| R1 | Link register | Link register | Scratch |
| R3 | Stack pointer | Same | Same |
| R20,R21 | Scratch | Scratch | Used by duffcopy, duffzero |
| R22 | Current goroutine | Same | Same |
| R29 | Closure context pointer | Same | Same |
| R30, R31 | used by the assembler | Same | Same |

View File

@@ -1,4 +1,4 @@
// Code generated by x/arch/internal/simdgen using 'go run . -xedPath $XED_PATH -o godefs -goroot $GOROOT go.yaml types.yaml categories.yaml'; DO NOT EDIT.
// Code generated by 'simdgen -o godefs -goroot $GOROOT -xedPath $XED_PATH go.yaml types.yaml categories.yaml'; DO NOT EDIT.
package amd64
@@ -25,23 +25,23 @@ func ssaGenSIMDValue(s *ssagen.State, v *ssa.Value) bool {
ssa.OpAMD64VPABSQ128,
ssa.OpAMD64VPABSQ256,
ssa.OpAMD64VPABSQ512,
ssa.OpAMD64VBROADCASTSS128,
ssa.OpAMD64VPBROADCASTQ128,
ssa.OpAMD64VPBROADCASTB128,
ssa.OpAMD64VPBROADCASTW128,
ssa.OpAMD64VPBROADCASTD128,
ssa.OpAMD64VBROADCASTSS256,
ssa.OpAMD64VBROADCASTSS128,
ssa.OpAMD64VBROADCASTSD256,
ssa.OpAMD64VPBROADCASTB256,
ssa.OpAMD64VPBROADCASTW256,
ssa.OpAMD64VPBROADCASTD256,
ssa.OpAMD64VPBROADCASTD128,
ssa.OpAMD64VPBROADCASTQ256,
ssa.OpAMD64VBROADCASTSS512,
ssa.OpAMD64VBROADCASTSS256,
ssa.OpAMD64VBROADCASTSD512,
ssa.OpAMD64VPBROADCASTB512,
ssa.OpAMD64VPBROADCASTW512,
ssa.OpAMD64VPBROADCASTD512,
ssa.OpAMD64VPBROADCASTW128,
ssa.OpAMD64VPBROADCASTD256,
ssa.OpAMD64VPBROADCASTQ512,
ssa.OpAMD64VBROADCASTSS512,
ssa.OpAMD64VPBROADCASTB128,
ssa.OpAMD64VPBROADCASTW256,
ssa.OpAMD64VPBROADCASTD512,
ssa.OpAMD64VPBROADCASTB256,
ssa.OpAMD64VPBROADCASTW512,
ssa.OpAMD64VPBROADCASTB512,
ssa.OpAMD64VCVTPD2PSX128,
ssa.OpAMD64VCVTPD2PSY128,
ssa.OpAMD64VCVTPD2PS256,
@@ -175,7 +175,15 @@ func ssaGenSIMDValue(s *ssagen.State, v *ssa.Value) bool {
ssa.OpAMD64VPMOVSQD128_128,
ssa.OpAMD64VPMOVSQD128_256,
ssa.OpAMD64VPMOVSQD256,
ssa.OpAMD64VPMOVUSWB128_128,
ssa.OpAMD64VPMOVUSWB128_256,
ssa.OpAMD64VPMOVUSWB256,
ssa.OpAMD64VPMOVUSDB128_128,
ssa.OpAMD64VPMOVUSDB128_256,
ssa.OpAMD64VPMOVUSDB128_512,
ssa.OpAMD64VPMOVUSQB128_128,
ssa.OpAMD64VPMOVUSQB128_256,
ssa.OpAMD64VPMOVUSQB128_512,
ssa.OpAMD64VPMOVUSDW128_128,
ssa.OpAMD64VPMOVUSDW128_256,
ssa.OpAMD64VPMOVUSDW256,
@@ -242,12 +250,12 @@ func ssaGenSIMDValue(s *ssagen.State, v *ssa.Value) bool {
ssa.OpAMD64VPADDQ256,
ssa.OpAMD64VPADDQ512,
ssa.OpAMD64VHADDPS128,
ssa.OpAMD64VHADDPS256,
ssa.OpAMD64VHADDPD128,
ssa.OpAMD64VHADDPD256,
ssa.OpAMD64VPHADDW128,
ssa.OpAMD64VPHADDW256,
ssa.OpAMD64VPHADDD128,
ssa.OpAMD64VHADDPS256,
ssa.OpAMD64VHADDPD256,
ssa.OpAMD64VPHADDW256,
ssa.OpAMD64VPHADDD256,
ssa.OpAMD64VPHADDSW128,
ssa.OpAMD64VPHADDSW256,
@@ -512,12 +520,12 @@ func ssaGenSIMDValue(s *ssagen.State, v *ssa.Value) bool {
ssa.OpAMD64VPSUBQ256,
ssa.OpAMD64VPSUBQ512,
ssa.OpAMD64VHSUBPS128,
ssa.OpAMD64VHSUBPS256,
ssa.OpAMD64VHSUBPD128,
ssa.OpAMD64VHSUBPD256,
ssa.OpAMD64VPHSUBW128,
ssa.OpAMD64VPHSUBW256,
ssa.OpAMD64VPHSUBD128,
ssa.OpAMD64VHSUBPS256,
ssa.OpAMD64VHSUBPD256,
ssa.OpAMD64VPHSUBW256,
ssa.OpAMD64VPHSUBD256,
ssa.OpAMD64VPHSUBSW128,
ssa.OpAMD64VPHSUBSW256,
@@ -731,12 +739,12 @@ func ssaGenSIMDValue(s *ssagen.State, v *ssa.Value) bool {
ssa.OpAMD64VPRORVQMasked128,
ssa.OpAMD64VPRORVQMasked256,
ssa.OpAMD64VPRORVQMasked512,
ssa.OpAMD64VPACKSSDWMasked128,
ssa.OpAMD64VPACKSSDWMasked256,
ssa.OpAMD64VPACKSSDWMasked512,
ssa.OpAMD64VPACKUSDWMasked128,
ssa.OpAMD64VPACKSSDWMasked128,
ssa.OpAMD64VPACKUSDWMasked256,
ssa.OpAMD64VPACKUSDWMasked512,
ssa.OpAMD64VPACKUSDWMasked128,
ssa.OpAMD64VSCALEFPSMasked128,
ssa.OpAMD64VSCALEFPSMasked256,
ssa.OpAMD64VSCALEFPSMasked512,
@@ -824,23 +832,23 @@ func ssaGenSIMDValue(s *ssagen.State, v *ssa.Value) bool {
ssa.OpAMD64VPABSQMasked128,
ssa.OpAMD64VPABSQMasked256,
ssa.OpAMD64VPABSQMasked512,
ssa.OpAMD64VBROADCASTSSMasked128,
ssa.OpAMD64VPBROADCASTQMasked128,
ssa.OpAMD64VPBROADCASTBMasked128,
ssa.OpAMD64VPBROADCASTWMasked128,
ssa.OpAMD64VPBROADCASTDMasked128,
ssa.OpAMD64VBROADCASTSSMasked256,
ssa.OpAMD64VBROADCASTSSMasked128,
ssa.OpAMD64VBROADCASTSDMasked256,
ssa.OpAMD64VPBROADCASTBMasked256,
ssa.OpAMD64VPBROADCASTWMasked256,
ssa.OpAMD64VPBROADCASTDMasked256,
ssa.OpAMD64VPBROADCASTDMasked128,
ssa.OpAMD64VPBROADCASTQMasked256,
ssa.OpAMD64VBROADCASTSSMasked512,
ssa.OpAMD64VBROADCASTSSMasked256,
ssa.OpAMD64VBROADCASTSDMasked512,
ssa.OpAMD64VPBROADCASTBMasked512,
ssa.OpAMD64VPBROADCASTWMasked512,
ssa.OpAMD64VPBROADCASTDMasked512,
ssa.OpAMD64VPBROADCASTWMasked128,
ssa.OpAMD64VPBROADCASTDMasked256,
ssa.OpAMD64VPBROADCASTQMasked512,
ssa.OpAMD64VBROADCASTSSMasked512,
ssa.OpAMD64VPBROADCASTBMasked128,
ssa.OpAMD64VPBROADCASTWMasked256,
ssa.OpAMD64VPBROADCASTDMasked512,
ssa.OpAMD64VPBROADCASTBMasked256,
ssa.OpAMD64VPBROADCASTWMasked512,
ssa.OpAMD64VPBROADCASTBMasked512,
ssa.OpAMD64VCOMPRESSPSMasked128,
ssa.OpAMD64VCOMPRESSPSMasked256,
ssa.OpAMD64VCOMPRESSPSMasked512,
@@ -1010,7 +1018,15 @@ func ssaGenSIMDValue(s *ssagen.State, v *ssa.Value) bool {
ssa.OpAMD64VPMOVSQDMasked128_128,
ssa.OpAMD64VPMOVSQDMasked128_256,
ssa.OpAMD64VPMOVSQDMasked256,
ssa.OpAMD64VPMOVUSWBMasked128_128,
ssa.OpAMD64VPMOVUSWBMasked128_256,
ssa.OpAMD64VPMOVUSWBMasked256,
ssa.OpAMD64VPMOVUSDBMasked128_128,
ssa.OpAMD64VPMOVUSDBMasked128_256,
ssa.OpAMD64VPMOVUSDBMasked128_512,
ssa.OpAMD64VPMOVUSQBMasked128_128,
ssa.OpAMD64VPMOVUSQBMasked128_256,
ssa.OpAMD64VPMOVUSQBMasked128_512,
ssa.OpAMD64VPMOVUSDWMasked128_128,
ssa.OpAMD64VPMOVUSDWMasked128_256,
ssa.OpAMD64VPMOVUSDWMasked256,
@@ -1308,12 +1324,6 @@ func ssaGenSIMDValue(s *ssagen.State, v *ssa.Value) bool {
ssa.OpAMD64VPERMI2Q256,
ssa.OpAMD64VPERMI2PD512,
ssa.OpAMD64VPERMI2Q512,
ssa.OpAMD64VPDPBUSD128,
ssa.OpAMD64VPDPBUSD256,
ssa.OpAMD64VPDPBUSD512,
ssa.OpAMD64VPDPBUSDS128,
ssa.OpAMD64VPDPBUSDS256,
ssa.OpAMD64VPDPBUSDS512,
ssa.OpAMD64VFMADD213PS128,
ssa.OpAMD64VFMADD213PS256,
ssa.OpAMD64VFMADD213PS512,
@@ -1430,12 +1440,6 @@ func ssaGenSIMDValue(s *ssagen.State, v *ssa.Value) bool {
ssa.OpAMD64VPMADDUBSWMasked128Merging,
ssa.OpAMD64VPMADDUBSWMasked256Merging,
ssa.OpAMD64VPMADDUBSWMasked512Merging,
ssa.OpAMD64VPDPBUSDMasked128,
ssa.OpAMD64VPDPBUSDMasked256,
ssa.OpAMD64VPDPBUSDMasked512,
ssa.OpAMD64VPDPBUSDSMasked128,
ssa.OpAMD64VPDPBUSDSMasked256,
ssa.OpAMD64VPDPBUSDSMasked512,
ssa.OpAMD64VGF2P8MULBMasked128Merging,
ssa.OpAMD64VGF2P8MULBMasked256Merging,
ssa.OpAMD64VGF2P8MULBMasked512Merging,
@@ -1559,12 +1563,12 @@ func ssaGenSIMDValue(s *ssagen.State, v *ssa.Value) bool {
ssa.OpAMD64VPRORVQMasked128Merging,
ssa.OpAMD64VPRORVQMasked256Merging,
ssa.OpAMD64VPRORVQMasked512Merging,
ssa.OpAMD64VPACKSSDWMasked128Merging,
ssa.OpAMD64VPACKSSDWMasked256Merging,
ssa.OpAMD64VPACKSSDWMasked512Merging,
ssa.OpAMD64VPACKUSDWMasked128Merging,
ssa.OpAMD64VPACKSSDWMasked128Merging,
ssa.OpAMD64VPACKUSDWMasked256Merging,
ssa.OpAMD64VPACKUSDWMasked512Merging,
ssa.OpAMD64VPACKUSDWMasked128Merging,
ssa.OpAMD64VSCALEFPSMasked128Merging,
ssa.OpAMD64VSCALEFPSMasked256Merging,
ssa.OpAMD64VSCALEFPSMasked512Merging,
@@ -1955,25 +1959,11 @@ func ssaGenSIMDValue(s *ssagen.State, v *ssa.Value) bool {
ssa.OpAMD64VPERMI2Q256load,
ssa.OpAMD64VPERMI2PD512load,
ssa.OpAMD64VPERMI2Q512load,
ssa.OpAMD64VPDPBUSD512load,
ssa.OpAMD64VPDPBUSDS512load,
ssa.OpAMD64VFMADD213PS128load,
ssa.OpAMD64VFMADD213PS256load,
ssa.OpAMD64VFMADD213PS512load,
ssa.OpAMD64VFMADD213PD128load,
ssa.OpAMD64VFMADD213PD256load,
ssa.OpAMD64VFMADD213PD512load,
ssa.OpAMD64VFMADDSUB213PS128load,
ssa.OpAMD64VFMADDSUB213PS256load,
ssa.OpAMD64VFMADDSUB213PS512load,
ssa.OpAMD64VFMADDSUB213PD128load,
ssa.OpAMD64VFMADDSUB213PD256load,
ssa.OpAMD64VFMADDSUB213PD512load,
ssa.OpAMD64VFMSUBADD213PS128load,
ssa.OpAMD64VFMSUBADD213PS256load,
ssa.OpAMD64VFMSUBADD213PS512load,
ssa.OpAMD64VFMSUBADD213PD128load,
ssa.OpAMD64VFMSUBADD213PD256load,
ssa.OpAMD64VFMSUBADD213PD512load,
ssa.OpAMD64VPSHLDVD128load,
ssa.OpAMD64VPSHLDVD256load,
@@ -2004,12 +1994,6 @@ func ssaGenSIMDValue(s *ssagen.State, v *ssa.Value) bool {
ssa.OpAMD64VPERMI2QMasked256load,
ssa.OpAMD64VPERMI2PDMasked512load,
ssa.OpAMD64VPERMI2QMasked512load,
ssa.OpAMD64VPDPBUSDMasked128load,
ssa.OpAMD64VPDPBUSDMasked256load,
ssa.OpAMD64VPDPBUSDMasked512load,
ssa.OpAMD64VPDPBUSDSMasked128load,
ssa.OpAMD64VPDPBUSDSMasked256load,
ssa.OpAMD64VPDPBUSDSMasked512load,
ssa.OpAMD64VFMADD213PSMasked128load,
ssa.OpAMD64VFMADD213PSMasked256load,
ssa.OpAMD64VFMADD213PSMasked512load,
@@ -2146,12 +2130,12 @@ func ssaGenSIMDValue(s *ssagen.State, v *ssa.Value) bool {
ssa.OpAMD64VPRORVQMasked128load,
ssa.OpAMD64VPRORVQMasked256load,
ssa.OpAMD64VPRORVQMasked512load,
ssa.OpAMD64VPACKSSDWMasked128load,
ssa.OpAMD64VPACKSSDWMasked256load,
ssa.OpAMD64VPACKSSDWMasked512load,
ssa.OpAMD64VPACKUSDWMasked128load,
ssa.OpAMD64VPACKSSDWMasked128load,
ssa.OpAMD64VPACKUSDWMasked256load,
ssa.OpAMD64VPACKUSDWMasked512load,
ssa.OpAMD64VPACKUSDWMasked128load,
ssa.OpAMD64VSCALEFPSMasked128load,
ssa.OpAMD64VSCALEFPSMasked256load,
ssa.OpAMD64VSCALEFPSMasked512load,
@@ -2464,23 +2448,23 @@ func ssaGenSIMDValue(s *ssagen.State, v *ssa.Value) bool {
ssa.OpAMD64VPABSQMasked128Merging,
ssa.OpAMD64VPABSQMasked256Merging,
ssa.OpAMD64VPABSQMasked512Merging,
ssa.OpAMD64VBROADCASTSSMasked128Merging,
ssa.OpAMD64VPBROADCASTQMasked128Merging,
ssa.OpAMD64VPBROADCASTBMasked128Merging,
ssa.OpAMD64VPBROADCASTWMasked128Merging,
ssa.OpAMD64VPBROADCASTDMasked128Merging,
ssa.OpAMD64VBROADCASTSSMasked256Merging,
ssa.OpAMD64VBROADCASTSSMasked128Merging,
ssa.OpAMD64VBROADCASTSDMasked256Merging,
ssa.OpAMD64VPBROADCASTBMasked256Merging,
ssa.OpAMD64VPBROADCASTWMasked256Merging,
ssa.OpAMD64VPBROADCASTDMasked256Merging,
ssa.OpAMD64VPBROADCASTDMasked128Merging,
ssa.OpAMD64VPBROADCASTQMasked256Merging,
ssa.OpAMD64VBROADCASTSSMasked512Merging,
ssa.OpAMD64VBROADCASTSSMasked256Merging,
ssa.OpAMD64VBROADCASTSDMasked512Merging,
ssa.OpAMD64VPBROADCASTBMasked512Merging,
ssa.OpAMD64VPBROADCASTWMasked512Merging,
ssa.OpAMD64VPBROADCASTDMasked512Merging,
ssa.OpAMD64VPBROADCASTWMasked128Merging,
ssa.OpAMD64VPBROADCASTDMasked256Merging,
ssa.OpAMD64VPBROADCASTQMasked512Merging,
ssa.OpAMD64VBROADCASTSSMasked512Merging,
ssa.OpAMD64VPBROADCASTBMasked128Merging,
ssa.OpAMD64VPBROADCASTWMasked256Merging,
ssa.OpAMD64VPBROADCASTDMasked512Merging,
ssa.OpAMD64VPBROADCASTBMasked256Merging,
ssa.OpAMD64VPBROADCASTWMasked512Merging,
ssa.OpAMD64VPBROADCASTBMasked512Merging,
ssa.OpAMD64VRNDSCALEPSMasked128Merging,
ssa.OpAMD64VRNDSCALEPSMasked256Merging,
ssa.OpAMD64VRNDSCALEPSMasked512Merging,
@@ -2638,7 +2622,15 @@ func ssaGenSIMDValue(s *ssagen.State, v *ssa.Value) bool {
ssa.OpAMD64VPMOVSQDMasked128_128Merging,
ssa.OpAMD64VPMOVSQDMasked128_256Merging,
ssa.OpAMD64VPMOVSQDMasked256Merging,
ssa.OpAMD64VPMOVUSWBMasked128_128Merging,
ssa.OpAMD64VPMOVUSWBMasked128_256Merging,
ssa.OpAMD64VPMOVUSWBMasked256Merging,
ssa.OpAMD64VPMOVUSDBMasked128_128Merging,
ssa.OpAMD64VPMOVUSDBMasked128_256Merging,
ssa.OpAMD64VPMOVUSDBMasked128_512Merging,
ssa.OpAMD64VPMOVUSQBMasked128_128Merging,
ssa.OpAMD64VPMOVUSQBMasked128_256Merging,
ssa.OpAMD64VPMOVUSQBMasked128_512Merging,
ssa.OpAMD64VPMOVUSDWMasked128_128Merging,
ssa.OpAMD64VPMOVUSDWMasked128_256Merging,
ssa.OpAMD64VPMOVUSDWMasked256Merging,
@@ -2813,23 +2805,23 @@ func ssaGenSIMDValue(s *ssagen.State, v *ssa.Value) bool {
ssa.OpAMD64VPAVGWMasked128,
ssa.OpAMD64VPAVGWMasked256,
ssa.OpAMD64VPAVGWMasked512,
ssa.OpAMD64VBROADCASTSSMasked128,
ssa.OpAMD64VPBROADCASTQMasked128,
ssa.OpAMD64VPBROADCASTBMasked128,
ssa.OpAMD64VPBROADCASTWMasked128,
ssa.OpAMD64VPBROADCASTDMasked128,
ssa.OpAMD64VBROADCASTSSMasked256,
ssa.OpAMD64VBROADCASTSSMasked128,
ssa.OpAMD64VBROADCASTSDMasked256,
ssa.OpAMD64VPBROADCASTBMasked256,
ssa.OpAMD64VPBROADCASTWMasked256,
ssa.OpAMD64VPBROADCASTDMasked256,
ssa.OpAMD64VPBROADCASTDMasked128,
ssa.OpAMD64VPBROADCASTQMasked256,
ssa.OpAMD64VBROADCASTSSMasked512,
ssa.OpAMD64VBROADCASTSSMasked256,
ssa.OpAMD64VBROADCASTSDMasked512,
ssa.OpAMD64VPBROADCASTBMasked512,
ssa.OpAMD64VPBROADCASTWMasked512,
ssa.OpAMD64VPBROADCASTDMasked512,
ssa.OpAMD64VPBROADCASTWMasked128,
ssa.OpAMD64VPBROADCASTDMasked256,
ssa.OpAMD64VPBROADCASTQMasked512,
ssa.OpAMD64VBROADCASTSSMasked512,
ssa.OpAMD64VPBROADCASTBMasked128,
ssa.OpAMD64VPBROADCASTWMasked256,
ssa.OpAMD64VPBROADCASTDMasked512,
ssa.OpAMD64VPBROADCASTBMasked256,
ssa.OpAMD64VPBROADCASTWMasked512,
ssa.OpAMD64VPBROADCASTBMasked512,
ssa.OpAMD64VRNDSCALEPSMasked128,
ssa.OpAMD64VRNDSCALEPSMasked128load,
ssa.OpAMD64VRNDSCALEPSMasked256,
@@ -3021,18 +3013,6 @@ func ssaGenSIMDValue(s *ssagen.State, v *ssa.Value) bool {
ssa.OpAMD64VPMADDUBSWMasked128,
ssa.OpAMD64VPMADDUBSWMasked256,
ssa.OpAMD64VPMADDUBSWMasked512,
ssa.OpAMD64VPDPBUSDMasked128,
ssa.OpAMD64VPDPBUSDMasked128load,
ssa.OpAMD64VPDPBUSDMasked256,
ssa.OpAMD64VPDPBUSDMasked256load,
ssa.OpAMD64VPDPBUSDMasked512,
ssa.OpAMD64VPDPBUSDMasked512load,
ssa.OpAMD64VPDPBUSDSMasked128,
ssa.OpAMD64VPDPBUSDSMasked128load,
ssa.OpAMD64VPDPBUSDSMasked256,
ssa.OpAMD64VPDPBUSDSMasked256load,
ssa.OpAMD64VPDPBUSDSMasked512,
ssa.OpAMD64VPDPBUSDSMasked512load,
ssa.OpAMD64VEXPANDPSMasked128,
ssa.OpAMD64VEXPANDPSMasked256,
ssa.OpAMD64VEXPANDPSMasked512,
@@ -3415,12 +3395,12 @@ func ssaGenSIMDValue(s *ssagen.State, v *ssa.Value) bool {
ssa.OpAMD64VPMOVSQBMasked128_128,
ssa.OpAMD64VPMOVSQBMasked128_256,
ssa.OpAMD64VPMOVSQBMasked128_512,
ssa.OpAMD64VPACKSSDWMasked128,
ssa.OpAMD64VPACKSSDWMasked128load,
ssa.OpAMD64VPACKSSDWMasked256,
ssa.OpAMD64VPACKSSDWMasked256load,
ssa.OpAMD64VPACKSSDWMasked512,
ssa.OpAMD64VPACKSSDWMasked512load,
ssa.OpAMD64VPACKSSDWMasked128,
ssa.OpAMD64VPACKSSDWMasked128load,
ssa.OpAMD64VPMOVSDWMasked128_128,
ssa.OpAMD64VPMOVSDWMasked128_256,
ssa.OpAMD64VPMOVSDWMasked256,
@@ -3430,13 +3410,21 @@ func ssaGenSIMDValue(s *ssagen.State, v *ssa.Value) bool {
ssa.OpAMD64VPMOVSQDMasked128_128,
ssa.OpAMD64VPMOVSQDMasked128_256,
ssa.OpAMD64VPMOVSQDMasked256,
ssa.OpAMD64VPMOVUSWBMasked128_128,
ssa.OpAMD64VPMOVUSWBMasked128_256,
ssa.OpAMD64VPMOVUSWBMasked256,
ssa.OpAMD64VPACKUSDWMasked128,
ssa.OpAMD64VPACKUSDWMasked128load,
ssa.OpAMD64VPMOVUSDBMasked128_128,
ssa.OpAMD64VPMOVUSDBMasked128_256,
ssa.OpAMD64VPMOVUSDBMasked128_512,
ssa.OpAMD64VPMOVUSQBMasked128_128,
ssa.OpAMD64VPMOVUSQBMasked128_256,
ssa.OpAMD64VPMOVUSQBMasked128_512,
ssa.OpAMD64VPACKUSDWMasked256,
ssa.OpAMD64VPACKUSDWMasked256load,
ssa.OpAMD64VPACKUSDWMasked512,
ssa.OpAMD64VPACKUSDWMasked512load,
ssa.OpAMD64VPACKUSDWMasked128,
ssa.OpAMD64VPACKUSDWMasked128load,
ssa.OpAMD64VPMOVUSDWMasked128_128,
ssa.OpAMD64VPMOVUSDWMasked128_256,
ssa.OpAMD64VPMOVUSDWMasked256,

View File

@@ -43,6 +43,10 @@ func ssaMarkMoves(s *ssagen.State, b *ssa.Block) {
}
}
func isGPReg(r int16) bool {
return x86.REG_AL <= r && r <= x86.REG_R15
}
func isFPReg(r int16) bool {
return x86.REG_X0 <= r && r <= x86.REG_Z31
}
@@ -1225,14 +1229,23 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) {
if v.Type.IsMemory() {
return
}
x := v.Args[0].Reg()
arg := v.Args[0]
x := arg.Reg()
y := v.Reg()
if v.Type.IsSIMD() {
x = simdOrMaskReg(v.Args[0])
x = simdOrMaskReg(arg)
y = simdOrMaskReg(v)
}
if x != y {
opregreg(s, moveByRegsWidth(y, x, v.Type.Size()), y, x)
width := v.Type.Size()
if width == 8 && isGPReg(y) && ssa.ZeroUpper32Bits(arg, 3) {
// The source was naturally zext-ed from 32 to 64 bits,
// but we are asked to do a full 64-bit copy.
// Save the REX prefix byte in I-CACHE by using a 32-bit move,
// since it zeroes the upper 32 bits anyway.
width = 4
}
opregreg(s, moveByRegsWidth(y, x, width), y, x)
}
case ssa.OpLoadReg:
if v.Type.IsFlags() {
@@ -1845,7 +1858,13 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) {
ssa.OpAMD64VPMOVVec32x16ToM,
ssa.OpAMD64VPMOVVec64x2ToM,
ssa.OpAMD64VPMOVVec64x4ToM,
ssa.OpAMD64VPMOVVec64x8ToM:
ssa.OpAMD64VPMOVVec64x8ToM,
ssa.OpAMD64VPMOVMSKB128,
ssa.OpAMD64VPMOVMSKB256,
ssa.OpAMD64VMOVMSKPS128,
ssa.OpAMD64VMOVMSKPS256,
ssa.OpAMD64VMOVMSKPD128,
ssa.OpAMD64VMOVMSKPD256:
p := s.Prog(v.Op.Asm())
p.From.Type = obj.TYPE_REG
p.From.Reg = simdReg(v.Args[0])

View File

@@ -18,6 +18,7 @@ var Debug DebugFlags
type DebugFlags struct {
AlignHot int `help:"enable hot block alignment (currently requires -pgo)" concurrent:"ok"`
Append int `help:"print information about append compilation"`
AstDump string `help:"for specified function/method, dump AST/IR at interesting points in compilation, to file pkg.func.ast. Use leading ~ for regular expression match."`
Checkptr int `help:"instrument unsafe pointer conversions\n0: instrumentation disabled\n1: conversions involving unsafe.Pointer are instrumented\n2: conversions to unsafe.Pointer force heap allocation" concurrent:"ok"`
Closure int `help:"print information about closure compilation"`
CompressInstructions int `help:"use compressed instructions when possible (if supported by architecture)"`

View File

@@ -39,7 +39,6 @@ package bloop
import (
"cmd/compile/internal/base"
"cmd/compile/internal/ir"
"cmd/compile/internal/reflectdata"
"cmd/compile/internal/typecheck"
"cmd/compile/internal/types"
"cmd/internal/src"
@@ -81,39 +80,43 @@ func getAddressableNameFromNode(n ir.Node) *ir.Name {
return nil
}
// getKeepAliveNodes analyzes an IR node and returns a list of nodes that must be kept alive.
func getKeepAliveNodes(pos src.XPos, n ir.Node) ir.Nodes {
name := getAddressableNameFromNode(n)
if name != nil {
debugName(name, pos)
return ir.Nodes{name}
} else if deref := n.(*ir.StarExpr); deref != nil {
if base.Flag.LowerM > 1 {
base.WarnfAt(pos, "dereference will be kept alive")
}
return ir.Nodes{deref}
} else if base.Flag.LowerM > 1 {
base.WarnfAt(pos, "expr is unknown to bloop pass")
}
return nil
}
// keepAliveAt returns a statement that is either curNode, or a
// block containing curNode followed by a call to runtime.KeepAlive for each
// node in ns. These calls ensure that nodes in ns will be live until
// after curNode's execution.
func keepAliveAt(ns []ir.Node, curNode ir.Node) ir.Node {
func keepAliveAt(ns ir.Nodes, curNode ir.Node) ir.Node {
if len(ns) == 0 {
return curNode
}
pos := curNode.Pos()
calls := []ir.Node{curNode}
calls := ir.Nodes{curNode}
for _, n := range ns {
if n == nil {
continue
}
if n.Sym() == nil {
continue
}
if n.Sym().IsBlank() {
if n == nil || n.Sym() == nil || n.Sym().IsBlank() {
continue
}
if !ir.IsAddressable(n) {
base.FatalfAt(n.Pos(), "keepAliveAt: node %v is not addressable", n)
}
arg := ir.NewConvExpr(pos, ir.OCONV, types.Types[types.TUNSAFEPTR], typecheck.NodAddr(n))
if !n.Type().IsInterface() {
srcRType0 := reflectdata.TypePtrAt(pos, n.Type())
arg.TypeWord = srcRType0
arg.SrcRType = srcRType0
}
callExpr := typecheck.Call(pos,
typecheck.LookupRuntime("KeepAlive"),
[]ir.Node{arg}, false).(*ir.CallExpr)
callExpr := typecheck.Call(pos, typecheck.LookupRuntime("KeepAlive"), ir.Nodes{arg}, false).(*ir.CallExpr)
callExpr.IsCompilerVarLive = true
callExpr.NoInline = true
calls = append(calls, callExpr)
@@ -132,135 +135,105 @@ func debugName(name *ir.Name, pos src.XPos) {
}
}
// preserveCallResults assigns the results of a call statement to temporary variables to ensure they remain alive.
func preserveCallResults(curFn *ir.Func, call *ir.CallExpr) ir.Node {
var ns ir.Nodes
lhs := make(ir.Nodes, call.Fun.Type().NumResults())
for i, res := range call.Fun.Type().Results() {
tmp := typecheck.TempAt(call.Pos(), curFn, res.Type)
lhs[i] = tmp
ns = append(ns, tmp)
}
if base.Flag.LowerM > 1 {
plural := ""
if call.Fun.Type().NumResults() > 1 {
plural = "s"
}
base.WarnfAt(call.Pos(), "function result%s will be kept alive", plural)
}
assign := typecheck.AssignExpr(ir.NewAssignListStmt(call.Pos(), ir.OAS2, lhs, ir.Nodes{call})).(*ir.AssignListStmt)
assign.Def = true
for _, tmp := range lhs {
// Place temp declarations in the loop body to help escape analysis.
assign.PtrInit().Append(typecheck.Stmt(ir.NewDecl(assign.Pos(), ir.ODCL, tmp.(*ir.Name))))
}
return keepAliveAt(ns, assign)
}
// preserveCallArgs ensures the arguments of a call statement are kept alive by transforming them into temporaries if necessary.
func preserveCallArgs(curFn *ir.Func, call *ir.CallExpr) ir.Node {
var argTmps ir.Nodes
var names ir.Nodes
preserveTmp := func(pos src.XPos, n ir.Node) ir.Node {
tmp := typecheck.TempAt(pos, curFn, n.Type())
assign := ir.NewAssignStmt(pos, tmp, n)
assign.Def = true
// Place temp declarations in the loop body to help escape analysis.
assign.PtrInit().Append(typecheck.Stmt(ir.NewDecl(assign.Pos(), ir.ODCL, tmp)))
argTmps = append(argTmps, typecheck.AssignExpr(assign))
names = append(names, tmp)
if base.Flag.LowerM > 1 {
base.WarnfAt(call.Pos(), "function arg will be kept alive")
}
return tmp
}
for i, a := range call.Args {
if name := getAddressableNameFromNode(a); name != nil {
// If they are name, keep them alive directly.
debugName(name, call.Pos())
names = append(names, name)
} else if a.Op() == ir.OSLICELIT {
// variadic args are encoded as slice literal.
s := a.(*ir.CompLitExpr)
var ns ir.Nodes
for i, elem := range s.List {
if name := getAddressableNameFromNode(elem); name != nil {
debugName(name, call.Pos())
ns = append(ns, name)
} else {
// We need a temporary to save this arg.
s.List[i] = preserveTmp(elem.Pos(), elem)
}
}
names = append(names, ns...)
} else {
// expressions, we need to assign them to temps and change the original arg to reference them.
call.Args[i] = preserveTmp(call.Pos(), a)
}
}
if len(argTmps) > 0 {
argTmps = append(argTmps, call)
return keepAliveAt(names, ir.NewBlockStmt(call.Pos(), argTmps))
}
return keepAliveAt(names, call)
}
// preserveStmt transforms stmt so that any names defined/assigned within it
// are used after stmt's execution, preventing their dead code elimination
// and dead store elimination. The return value is the transformed statement.
func preserveStmt(curFn *ir.Func, stmt ir.Node) (ret ir.Node) {
ret = stmt
func preserveStmt(curFn *ir.Func, stmt ir.Node) ir.Node {
switch n := stmt.(type) {
case *ir.AssignStmt:
// Peel down struct and slice indexing to get the names
name := getAddressableNameFromNode(n.X)
if name != nil {
debugName(name, n.Pos())
ret = keepAliveAt([]ir.Node{name}, n)
} else if deref := n.X.(*ir.StarExpr); deref != nil {
ret = keepAliveAt([]ir.Node{deref}, n)
if base.Flag.LowerM > 1 {
base.WarnfAt(n.Pos(), "dereference will be kept alive")
}
} else if base.Flag.LowerM > 1 {
base.WarnfAt(n.Pos(), "expr is unknown to bloop pass")
}
return keepAliveAt(getKeepAliveNodes(n.Pos(), n.X), n)
case *ir.AssignListStmt:
ns := []ir.Node{}
var ns ir.Nodes
for _, lhs := range n.Lhs {
name := getAddressableNameFromNode(lhs)
if name != nil {
debugName(name, n.Pos())
ns = append(ns, name)
} else if deref := lhs.(*ir.StarExpr); deref != nil {
ns = append(ns, deref)
if base.Flag.LowerM > 1 {
base.WarnfAt(n.Pos(), "dereference will be kept alive")
}
} else if base.Flag.LowerM > 1 {
base.WarnfAt(n.Pos(), "expr is unknown to bloop pass")
}
ns = append(ns, getKeepAliveNodes(n.Pos(), lhs)...)
}
ret = keepAliveAt(ns, n)
return keepAliveAt(ns, n)
case *ir.AssignOpStmt:
name := getAddressableNameFromNode(n.X)
if name != nil {
debugName(name, n.Pos())
ret = keepAliveAt([]ir.Node{name}, n)
} else if deref := n.X.(*ir.StarExpr); deref != nil {
ret = keepAliveAt([]ir.Node{deref}, n)
if base.Flag.LowerM > 1 {
base.WarnfAt(n.Pos(), "dereference will be kept alive")
}
} else if base.Flag.LowerM > 1 {
base.WarnfAt(n.Pos(), "expr is unknown to bloop pass")
}
return keepAliveAt(getKeepAliveNodes(n.Pos(), n.X), n)
case *ir.CallExpr:
curNode := stmt
// The function's results are not assigned, preserve them.
if n.Fun != nil && n.Fun.Type() != nil && n.Fun.Type().NumResults() != 0 {
ns := []ir.Node{}
// This function's results are not assigned, assign them to
// auto tmps and then keepAliveAt these autos.
// Note: markStmt assumes the context that it's called - this CallExpr is
// not within another OAS2, which is guaranteed by the case above.
results := n.Fun.Type().Results()
lhs := make([]ir.Node, len(results))
for i, res := range results {
tmp := typecheck.TempAt(n.Pos(), curFn, res.Type)
lhs[i] = tmp
ns = append(ns, tmp)
}
// Create an assignment statement.
assign := typecheck.AssignExpr(
ir.NewAssignListStmt(n.Pos(), ir.OAS2, lhs,
[]ir.Node{n})).(*ir.AssignListStmt)
assign.Def = true
curNode = assign
plural := ""
if len(results) > 1 {
plural = "s"
}
if base.Flag.LowerM > 1 {
base.WarnfAt(n.Pos(), "function result%s will be kept alive", plural)
}
ret = keepAliveAt(ns, curNode)
} else {
// This function probably doesn't return anything, keep its args alive.
argTmps := []ir.Node{}
names := []ir.Node{}
for i, a := range n.Args {
if name := getAddressableNameFromNode(a); name != nil {
// If they are name, keep them alive directly.
debugName(name, n.Pos())
names = append(names, name)
} else if a.Op() == ir.OSLICELIT {
// variadic args are encoded as slice literal.
s := a.(*ir.CompLitExpr)
ns := []ir.Node{}
for i, elem := range s.List {
if name := getAddressableNameFromNode(elem); name != nil {
debugName(name, n.Pos())
ns = append(ns, name)
} else {
// We need a temporary to save this arg.
tmp := typecheck.TempAt(elem.Pos(), curFn, elem.Type())
argTmps = append(argTmps, typecheck.AssignExpr(ir.NewAssignStmt(elem.Pos(), tmp, elem)))
names = append(names, tmp)
s.List[i] = tmp
if base.Flag.LowerM > 1 {
base.WarnfAt(n.Pos(), "function arg will be kept alive")
}
}
}
names = append(names, ns...)
} else {
// expressions, we need to assign them to temps and change the original arg to reference
// them.
tmp := typecheck.TempAt(n.Pos(), curFn, a.Type())
argTmps = append(argTmps, typecheck.AssignExpr(ir.NewAssignStmt(n.Pos(), tmp, a)))
names = append(names, tmp)
n.Args[i] = tmp
if base.Flag.LowerM > 1 {
base.WarnfAt(n.Pos(), "function arg will be kept alive")
}
}
}
if len(argTmps) > 0 {
argTmps = append(argTmps, n)
curNode = ir.NewBlockStmt(n.Pos(), argTmps)
}
ret = keepAliveAt(names, curNode)
return preserveCallResults(curFn, n)
}
// This function doesn't return anything, keep its args alive.
return preserveCallArgs(curFn, n)
}
return
return stmt
}
func preserveStmts(curFn *ir.Func, list ir.Nodes) {
@@ -325,7 +298,7 @@ func (e editor) edit(n ir.Node) ir.Node {
return n
}
// BloopWalk performs a walk on all functions in the package
// Walk performs a walk on all functions in the package
// if it imports testing and wrap the results of all qualified
// statements in a runtime.KeepAlive intrinsic call. See package
// doc for more details.
@@ -333,7 +306,7 @@ func (e editor) edit(n ir.Node) ir.Node {
// for b.Loop() {...}
//
// loop's body.
func BloopWalk(pkg *ir.Package) {
func Walk(pkg *ir.Package) {
hasTesting := false
for _, i := range pkg.Imports {
if i.Path == "testing" {
@@ -347,5 +320,9 @@ func BloopWalk(pkg *ir.Package) {
for _, fn := range pkg.Funcs {
e := editor{false, fn}
ir.EditChildren(fn, e.edit)
if ir.MatchAstDump(fn, "bloop") {
ir.AstDump(fn, "bloop, "+ir.FuncName(fn))
}
}
}

View File

@@ -257,8 +257,8 @@ func EqStruct(t *types.Type, np, nq ir.Node) ([]ir.Node, bool) {
func EqString(s, t ir.Node) (eqlen *ir.BinaryExpr, eqmem *ir.CallExpr) {
s = typecheck.Conv(s, types.Types[types.TSTRING])
t = typecheck.Conv(t, types.Types[types.TSTRING])
sptr := ir.NewUnaryExpr(base.Pos, ir.OSPTR, s)
tptr := ir.NewUnaryExpr(base.Pos, ir.OSPTR, t)
sptr := ir.NewConvExpr(base.Pos, ir.OCONVNOP, types.Types[types.TUNSAFEPTR], ir.NewUnaryExpr(base.Pos, ir.OSPTR, s))
tptr := ir.NewConvExpr(base.Pos, ir.OCONVNOP, types.Types[types.TUNSAFEPTR], ir.NewUnaryExpr(base.Pos, ir.OSPTR, t))
slen := typecheck.Conv(ir.NewUnaryExpr(base.Pos, ir.OLEN, s), types.Types[types.TUINTPTR])
tlen := typecheck.Conv(ir.NewUnaryExpr(base.Pos, ir.OLEN, t), types.Types[types.TUINTPTR])
@@ -293,7 +293,7 @@ func EqString(s, t ir.Node) (eqlen *ir.BinaryExpr, eqmem *ir.CallExpr) {
cmplen = tlen
}
fn := typecheck.LookupRuntime("memequal", types.Types[types.TUINT8], types.Types[types.TUINT8])
fn := typecheck.LookupRuntime("memequal")
call := typecheck.Call(base.Pos, fn, []ir.Node{sptr, tptr, ir.Copy(cmplen)}, false).(*ir.CallExpr)
cmp := ir.NewBinaryExpr(base.Pos, ir.OEQ, slen, tlen)

View File

@@ -23,7 +23,11 @@ func Funcs(fns []*ir.Func) {
zero := ir.NewBasicLit(base.AutogeneratedPos, types.Types[types.TINT], constant.MakeInt64(0))
for _, fn := range fns {
if fn.IsClosure() {
if ir.MatchAstDump(fn, "deadlocals closure") {
ir.AstDump(fn, "deadlocals closure skipped, "+ir.FuncName(fn))
}
continue
}
@@ -50,6 +54,9 @@ func Funcs(fns []*ir.Func) {
k.Defn = nil
}
}
if ir.MatchAstDump(fn, "deadlocals") {
ir.AstDump(fn, "deadLocals, "+ir.FuncName(fn))
}
}
}

View File

@@ -380,6 +380,11 @@ func (b *batch) finish(fns []*ir.Func) {
}
}
for _, fn := range fns {
if ir.MatchAstDump(fn, "escape") {
ir.AstDump(fn, "escape, "+ir.FuncName(fn))
}
}
}
// inMutualBatch reports whether function fn is in the batch of

View File

@@ -121,6 +121,9 @@ func prepareFunc(fn *ir.Func) {
ir.CurFunc = fn
walk.Walk(fn)
if ir.MatchAstDump(fn, "walk") {
ir.AstDump(fn, "walk, "+ir.FuncName(fn))
}
ir.CurFunc = nil // enforce no further uses of CurFunc
base.Ctxt.DwTextCount++
@@ -142,73 +145,47 @@ func compileFunctions(profile *pgoir.Profile) {
// Compile the longest functions first,
// since they're most likely to be the slowest.
// This helps avoid stragglers.
// Since we remove from the end of the slice queue,
// that means shortest to longest.
slices.SortFunc(compilequeue, func(a, b *ir.Func) int {
return cmp.Compare(len(b.Body), len(a.Body))
return cmp.Compare(len(a.Body), len(b.Body))
})
}
// By default, we perform work right away on the current goroutine
// as the solo worker.
queue := func(work func(int)) {
work(0)
}
var mu sync.Mutex
var wg sync.WaitGroup
mu.Lock()
if nWorkers := base.Flag.LowerC; nWorkers > 1 {
// For concurrent builds, we allow the work queue
// to grow arbitrarily large, but only nWorkers work items
// can be running concurrently.
workq := make(chan func(int))
done := make(chan int)
for workerId := range base.Flag.LowerC {
// TODO: replace with wg.Go when the oldest bootstrap has it.
// With the current policy, that'd be go1.27.
wg.Add(1)
go func() {
ids := make([]int, nWorkers)
for i := range ids {
ids[i] = i
}
var pending []func(int)
defer wg.Done()
var closures []*ir.Func
for {
select {
case work := <-workq:
pending = append(pending, work)
case id := <-done:
ids = append(ids, id)
}
for len(pending) > 0 && len(ids) > 0 {
work := pending[len(pending)-1]
id := ids[len(ids)-1]
pending = pending[:len(pending)-1]
ids = ids[:len(ids)-1]
go func() {
work(id)
done <- id
}()
mu.Lock()
compilequeue = append(compilequeue, closures...)
remaining := len(compilequeue)
if remaining == 0 {
mu.Unlock()
return
}
fn := compilequeue[len(compilequeue)-1]
compilequeue = compilequeue[:len(compilequeue)-1]
mu.Unlock()
ssagen.Compile(fn, workerId, profile)
closures = fn.Closures
}
}()
queue = func(work func(int)) {
workq <- work
}
}
var wg sync.WaitGroup
var compile func([]*ir.Func)
compile = func(fns []*ir.Func) {
wg.Add(len(fns))
for _, fn := range fns {
fn := fn
queue(func(worker int) {
ssagen.Compile(fn, worker, profile)
compile(fn.Closures)
wg.Done()
})
}
}
types.CalcSizeDisabled = true // not safe to calculate sizes concurrently
base.Ctxt.InParallel = true
compile(compilequeue)
compilequeue = nil
mu.Unlock()
wg.Wait()
compilequeue = nil
base.Ctxt.InParallel = false
types.CalcSizeDisabled = false

View File

@@ -47,6 +47,7 @@ import (
// already been some compiler errors). It may also be invoked from the explicit panic in
// hcrash(), in which case, we pass the panic on through.
func handlePanic() {
ir.CloseHTMLWriters()
if err := recover(); err != nil {
if err == "-h" {
// Force real panic now with -h option (hcrash) - the error
@@ -243,13 +244,25 @@ func Main(archInit func(*ssagen.ArchInfo)) {
}
}
for _, fn := range typecheck.Target.Funcs {
if ir.MatchAstDump(fn, "start") {
ir.AstDump(fn, "start, "+ir.FuncName(fn))
}
}
// Apply bloop markings.
bloop.BloopWalk(typecheck.Target)
bloop.Walk(typecheck.Target)
// Interleaved devirtualization and inlining.
base.Timer.Start("fe", "devirtualize-and-inline")
interleaved.DevirtualizeAndInlinePackage(typecheck.Target, profile)
for _, fn := range typecheck.Target.Funcs {
if ir.MatchAstDump(fn, "devirtualize-and-inline") {
ir.AstDump(fn, "devirtualize-and-inline, "+ir.FuncName(fn))
}
}
noder.MakeWrappers(typecheck.Target) // must happen after inlining
// Get variable capture right in for loops.

View File

@@ -286,6 +286,8 @@ func CanInline(fn *ir.Func, profile *pgoir.Profile) {
// locals, and we use this map to produce a pruned Inline.Dcl
// list. See issue 25459 for more context.
dbg := ir.MatchAstDump(fn, "inline")
visitor := hairyVisitor{
curFunc: fn,
debug: isDebugFn(fn),
@@ -294,10 +296,17 @@ func CanInline(fn *ir.Func, profile *pgoir.Profile) {
maxBudget: budget,
extraCallCost: cc,
profile: profile,
dbg: dbg, // Useful for downstream debugging
}
if visitor.tooHairy(fn) {
reason = visitor.reason
if dbg {
ir.AstDump(fn, "inline, too hairy because "+visitor.reason+", "+ir.FuncName(fn))
}
return
} else if dbg {
ir.AstDump(fn, "inline, OK, "+ir.FuncName(fn))
}
n.Func.Inl = &ir.Inline{
@@ -441,6 +450,7 @@ type hairyVisitor struct {
usedLocals ir.NameSet
do func(ir.Node) bool
profile *pgoir.Profile
dbg bool
}
func isDebugFn(fn *ir.Func) bool {
@@ -516,6 +526,9 @@ opSwitch:
break opSwitch
case "panicrangestate":
cheap = true
case "deferrangefunc":
v.reason = "defer call in range func"
return true
}
}
}

View File

@@ -9,11 +9,16 @@
package ir
import (
"crypto/sha256"
"encoding/hex"
"fmt"
"io"
"net/url"
"os"
"reflect"
"regexp"
"strings"
"sync"
"cmd/compile/internal/base"
"cmd/compile/internal/types"
@@ -63,6 +68,164 @@ func FDumpAny(w io.Writer, root any, filter string, depth int) {
p.printf("\n")
}
// MatchAstDump returns true if the fn matches the value
// of the astdump debug flag. Fn matches in the following
// cases:
//
// - astdump == name(fn)
// - astdump == pkgname(fn).name(fn)
// - astdump == afterslash(pkgname(fn)).name(fn)
// - astdump begins with a "~" and what follows "~" is a
// regular expression matching pkgname(fn).name(fn)
//
// If MatchAstDump returns true, it also prints to os.Stderr
//
// \nir.Match(<fn>, <astdump>) for <where>\n
func MatchAstDump(fn *Func, where string) bool {
if len(base.Debug.AstDump) == 0 {
return false
}
return matchForDump(fn, base.Ctxt.Pkgpath, where)
}
var dbgRE *regexp.Regexp
var onceDbgRE sync.Once
func matchForDump(fn *Func, pkgPath, where string) bool {
dbg := false
flag := base.Debug.AstDump
if flag[0] == '~' {
onceDbgRE.Do(func() { dbgRE = regexp.MustCompile(flag[1:]) })
dbg = dbgRE.MatchString(pkgPath + "." + FuncName(fn))
} else {
dbg = matchPkgFn(pkgPath, FuncName(fn), flag)
}
return dbg
}
// matchPkgFn returns true if pkg and fnName "match" toMatch.
// "aFunc" matches "aFunc" (in any package)
// "aPkg.aFunc" matches "aPkg.aFunc"
// "aPkg/subPkg.aFunc" matches "subPkg.aFunc"
func matchPkgFn(pkgName, fnName, toMatch string) bool {
if fnName == toMatch {
return true
}
matchPkgDotName := func(pkg string) bool {
// Allocation-free equality check for toMatch == base.Ctxt.Pkgpath + "." + fnName
return len(toMatch) == len(pkg)+1+len(fnName) &&
strings.HasPrefix(toMatch, pkg) && toMatch[len(pkg)] == '.' && strings.HasSuffix(toMatch, fnName)
}
if matchPkgDotName(pkgName) {
return true
}
if l := strings.LastIndexByte(pkgName, '/'); l > 0 && matchPkgDotName(pkgName[l+1:]) {
return true
}
return false
}
// AstDump appends the ast dump for fn to the ast dump file for fn.
// The generated file name is
//
// url.PathEscape(PkgFuncName(fn)) + ".ast"
//
// It also prints
//
// Writing ast output to <astfilename>\n
//
// to os.Stderr.
func AstDump(fn *Func, why string) {
err := withLockAndFile(
fn,
func(w io.Writer) {
FDump(w, why, fn)
},
)
// strip text following comma, for phase names.
comma := strings.Index(why, ",")
if comma > 0 {
why = why[:comma]
}
DumpNodeHTML(fn, why, fn)
if err != nil {
fmt.Fprintf(os.Stderr, "Dump returned error %v\n", err)
}
}
var mu sync.Mutex
var astDumpFiles = make(map[string]bool)
// escapedFileName constructs a file name from fn and suffix,
// url-path-escaping the function part of the name and replacing it
// with a hash if it is too long. The suffix is neither escaped
// nor including in the length calculation, so an excessively
// creative suffix will result in problems.
func escapedFileName(fn *Func, suffix string) string {
name := url.PathEscape(PkgFuncName(fn))
if len(name) > 125 { // arbitrary limit on file names, as if anyone types these in by hand
hash := sha256.Sum256([]byte(name))
name = hex.EncodeToString(hash[:8])
}
return name + suffix
}
// withLockAndFile manages ast dump files for various function names
// and invokes a dumping function to write output, under a lock.
func withLockAndFile(fn *Func, dump func(io.Writer)) (err error) {
name := escapedFileName(fn, ".ast")
// Ensure that debugging output is not scrambled and is written promptly
mu.Lock()
defer mu.Unlock()
mode := os.O_APPEND | os.O_RDWR
if !astDumpFiles[name] {
astDumpFiles[name] = true
mode = os.O_CREATE | os.O_TRUNC | os.O_RDWR
fmt.Fprintf(os.Stderr, "Writing text ast output for %s to %s\n", PkgFuncName(fn), name)
}
fi, err := os.OpenFile(name, mode, 0777)
if err != nil {
return err
}
defer func() { err = fi.Close() }()
dump(fi)
return
}
var htmlWriters = make(map[*Func]*HTMLWriter)
var orderedFuncs = []*Func{}
// DumpNodeHTML dumps the node n to the HTML writer for fn.
// It uses the same phase name as the text dump.
func DumpNodeHTML(fn *Func, why string, n Node) {
mu.Lock()
defer mu.Unlock()
w, ok := htmlWriters[fn]
if !ok {
name := escapedFileName(fn, ".html")
w = NewHTMLWriter(name, fn, "")
htmlWriters[fn] = w
orderedFuncs = append(orderedFuncs, fn)
}
w.WritePhase(why, why)
}
// CloseHTMLWriter closes the HTML writer for fn, if one exists.
func CloseHTMLWriters() {
mu.Lock()
defer mu.Unlock()
for _, fn := range orderedFuncs {
if w, ok := htmlWriters[fn]; ok {
w.Close()
delete(htmlWriters, fn)
}
}
orderedFuncs = nil
}
type dumper struct {
output io.Writer
fieldrx *regexp.Regexp // field name filter

View File

@@ -0,0 +1,44 @@
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package ir
import (
"testing"
)
func testMatch(t *testing.T, pkgName, fnName, toMatch string, match bool) {
if matchPkgFn(pkgName, fnName, toMatch) != match {
t.Errorf("%v != matchPkgFn(%s, %s, %s)", match, pkgName, fnName, toMatch)
}
}
func TestMatchPkgFn(t *testing.T) {
// "aFunc" matches "aFunc" (in any package)
// "aPkg.aFunc" matches "aPkg.aFunc"
// "aPkg/subPkg.aFunc" matches "subPkg.aFunc"
match := func(pkgName, fnName, toMatch string) {
if !matchPkgFn(pkgName, fnName, toMatch) {
t.Errorf("matchPkgFn(%s, %s, %s) did not match", pkgName, fnName, toMatch)
}
}
match("aPkg", "AFunc", "AFunc")
match("aPkg", "AFunc", "AFunc")
match("aPkg", "AFunc", "aPkg.AFunc")
match("aPkg/sPkg", "AFunc", "aPkg/sPkg.AFunc")
match("aPkg/sPkg", "AFunc", "sPkg.AFunc")
notmatch := func(pkgName, fnName, toMatch string) {
if matchPkgFn(pkgName, fnName, toMatch) {
t.Errorf("matchPkgFn(%s, %s, %s) should not match", pkgName, fnName, toMatch)
}
}
notmatch("aPkg", "AFunc", "BFunc")
notmatch("aPkg", "AFunc", "aPkg.BFunc")
notmatch("aPkg", "AFunc", "bPkg.AFunc")
notmatch("aPkg", "AFunc", "aPkg_AFunc")
notmatch("aPkg/sPkg", "AFunc", "aPkg/ssPkg.AFunc")
notmatch("aPkg/sPkg", "AFunc", "XPkg.AFunc")
}

View File

@@ -897,11 +897,19 @@ func (l Nodes) Format(s fmt.State, verb rune) {
// Dump
// Dump prints the message s followed by a debug dump of n.
// This includes all the recursive structure under n.
func Dump(s string, n Node) {
fmt.Printf("%s%+v\n", s, n)
}
// Fdump prints to w the message s followed by a debug dump of n.
// This includes all the recursive structure under n.
func FDump(w io.Writer, s string, n Node) {
fmt.Fprintf(w, "%s%+v\n", s, n)
}
// DumpList prints the message s followed by a debug dump of each node in the list.
// This includes all the recursive structure under each node in the list.
func DumpList(s string, list Nodes) {
var buf bytes.Buffer
FDumpList(&buf, s, list)
@@ -909,6 +917,7 @@ func DumpList(s string, list Nodes) {
}
// FDumpList prints to w the message s followed by a debug dump of each node in the list.
// This includes all the recursive structure under each node in the list.
func FDumpList(w io.Writer, s string, list Nodes) {
io.WriteString(w, s)
dumpNodes(w, list, 1)

View File

@@ -315,7 +315,9 @@ func PkgFuncName(f *Func) string {
}
s := f.Sym()
pkg := s.Pkg
if pkg == nil {
return "<nil>." + s.Name
}
return pkg.Path + "." + s.Name
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,104 @@
// Copyright 2026 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package ir
import (
"cmd/compile/internal/base"
"cmd/compile/internal/types"
"cmd/internal/obj"
"cmd/internal/src"
"os"
"path/filepath"
"strings"
"testing"
)
func TestHTMLWriter(t *testing.T) {
// Initialize base.Ctxt to avoid panics
base.Ctxt = new(obj.Link)
// Setup a temporary directory for output
tmpDir := t.TempDir()
// Mock func
fn := &Func{
Nname: &Name{
sym: &types.Sym{Name: "TestFunc"},
},
}
// Func embeds miniExpr, so we might need to set op if checked
fn.op = ODCLFUNC
// Create HTMLWriter
outFile := filepath.Join(tmpDir, "test.html")
w := NewHTMLWriter(outFile, fn, "")
if w == nil {
t.Fatalf("Failed to create HTMLWriter")
}
// Write a phase
w.WritePhase("phase1", "Phase 1")
// Register a file/line
posBase := src.NewFileBase("test.go", "test.go")
// base.Ctxt.PosTable.Register(posBase) -- Not needed/doesn't exist
pos := src.MakePos(posBase, 10, 1)
// Create a dummy node
n := &Name{
sym: &types.Sym{Name: "VarX"},
Class: PAUTO,
}
n.op = ONAME
n.pos = base.Ctxt.PosTable.XPos(pos)
// Add another phase which actually dumps something interesting
fn.Body = []Node{n}
w.WritePhase("phase2", "Phase 2")
// Test escaping
n2 := &Name{
sym: &types.Sym{Name: "<Bad>"},
Class: PAUTO,
}
n2.op = ONAME
fn.Body = []Node{n2}
w.WritePhase("phase3", "Phase 3")
w.Close()
// Verify file exists and has content
content, err := os.ReadFile(outFile)
if err != nil {
t.Fatalf("Failed to read output file: %v", err)
}
s := string(content)
if len(s) == 0 {
t.Errorf("Output file is empty")
}
// Check for Expected strings
expected := []string{
"<html>",
"Phase 1",
"Phase 2",
"Phase 2",
"VarX",
"NAME",
"&lt;Bad&gt;",
"resizer",
"loc-",
"line-number",
"sym-",
"variable-name",
}
for _, e := range expected {
if !strings.Contains(s, e) {
t.Errorf("Output missing %q", e)
}
}
}

View File

@@ -18,6 +18,9 @@ import (
// A Node is the abstract interface to an IR node.
type Node interface {
// Formatting
// For debugging output, use one of
// Dump/FDump/DumpList/FDumplist (in fmt.go)
// DumpAny/FDumpAny (in dump.go)
Format(s fmt.State, verb rune)
// Source position.

View File

@@ -427,7 +427,7 @@ func newliveness(fn *ir.Func, f *ssa.Func, vars []*ir.Name, idx map[*ir.Name]int
nblocks := int32(len(f.Blocks))
nvars := int32(len(vars))
bulk := bitvec.NewBulk(nvars, nblocks*7, fn.Pos())
bulk := bitvec.NewBulk(nvars, nblocks*4, fn.Pos())
for _, b := range f.Blocks {
be := lv.blockEffects(b)

View File

@@ -529,6 +529,7 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) {
ssa.OpLOONG64BITREV4B,
ssa.OpLOONG64BITREVW,
ssa.OpLOONG64BITREVV,
ssa.OpLOONG64ABSF,
ssa.OpLOONG64ABSD:
p := s.Prog(v.Op.Asm())
p.From.Type = obj.TYPE_REG

View File

@@ -448,6 +448,11 @@ func ForCapture(fn *ir.Func) []VarAndLoop {
}
}
ir.WithFunc(fn, forCapture)
if ir.MatchAstDump(fn, "loopvar") {
ir.AstDump(fn, "loopvar, "+ir.FuncName(fn))
}
return transformed
}

View File

@@ -6,6 +6,7 @@ package loopvar_test
import (
"internal/testenv"
"os"
"os/exec"
"path/filepath"
"regexp"
@@ -381,3 +382,62 @@ func TestLoopVarVersionDisableGoBuild(t *testing.T) {
t.Errorf("err=%v == nil", err)
}
}
// TestLoopVarLineDirective tests that loopvar version detection works correctly
// with line directives. This is a regression test for a bug where FileBase() was
// used instead of Base(), causing incorrect version lookup when line directives
// were present.
func TestLoopVarLineDirective(t *testing.T) {
switch runtime.GOOS {
case "linux", "darwin":
default:
t.Skipf("Slow test, usually avoid it, os=%s not linux or darwin", runtime.GOOS)
}
switch runtime.GOARCH {
case "amd64", "arm64":
default:
t.Skipf("Slow test, usually avoid it, arch=%s not amd64 or arm64", runtime.GOARCH)
}
testenv.MustHaveGoBuild(t)
gocmd := testenv.GoToolPath(t)
tmpdir := t.TempDir()
output := filepath.Join(tmpdir, "foo.exe")
// Create a go.mod file with Go 1.21 to test compatibility behavior.
// When building with a higher Go compiler, the loopvar should be created per-loop.
gomodPath := filepath.Join(tmpdir, "go.mod")
if err := os.WriteFile(gomodPath, []byte("module test\n\ngo 1.21\n"), 0644); err != nil {
t.Fatal(err)
}
// Copy the test file (with line directive) to the temporary module
testFile := "range_esc_closure_linedir.go"
srcPath := filepath.Join("testdata", testFile)
dstPath := filepath.Join(tmpdir, testFile)
src, err := os.ReadFile(srcPath)
if err != nil {
t.Fatal(err)
}
if err := os.WriteFile(dstPath, src, 0644); err != nil {
t.Fatal(err)
}
// Build the module (not as a single file, so go.mod is respected)
cmd := testenv.Command(t, gocmd, "build", "-o", output, ".")
cmd.Dir = tmpdir
b, err := cmd.CombinedOutput()
if err != nil {
t.Logf("build output: %s", b)
t.Fatal(err)
}
t.Logf("build output: %s", b)
cmd = testenv.Command(t, output)
b, err = cmd.CombinedOutput()
t.Logf("run output: %s", b)
if err != nil {
t.Errorf("expected success (exit code 0), got: %v", err)
}
}

View File

@@ -0,0 +1,24 @@
// Copyright 2026 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//line range_esc_closure_linedir.go:5
package main
import "fmt"
var is []func() int
func main() {
var ints = []int{0, 0, 0}
for i := range ints {
is = append(is, func() int { return i })
}
for _, f := range is {
fmt.Println(f())
if f() != 2 {
panic("loop variable i: expected shared per-loop, but got distinct per-iteration")
}
}
}

View File

@@ -197,7 +197,6 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) {
ssa.OpMIPSANDconst,
ssa.OpMIPSORconst,
ssa.OpMIPSXORconst,
ssa.OpMIPSNORconst,
ssa.OpMIPSSLLconst,
ssa.OpMIPSSRLconst,
ssa.OpMIPSSRAconst,

View File

@@ -191,7 +191,6 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) {
ssa.OpMIPS64ANDconst,
ssa.OpMIPS64ORconst,
ssa.OpMIPS64XORconst,
ssa.OpMIPS64NORconst,
ssa.OpMIPS64SLLVconst,
ssa.OpMIPS64SRLVconst,
ssa.OpMIPS64SRAVconst,

View File

@@ -56,7 +56,6 @@ func checkFiles(m posMap, noders []*noder) (*types2.Package, *types2.Info, map[*
IgnoreBranchErrors: true, // parser already checked via syntax.CheckBranches mode
Importer: &importer,
Sizes: types2.SizesFor("gc", buildcfg.GOARCH),
EnableAlias: true,
}
if base.Flag.ErrorURL {
conf.ErrorURL = " [go.dev/e/%s]"

View File

@@ -3342,6 +3342,9 @@ func (r *reader) pkgInitOrder(target *ir.Package) {
// Outline (if legal/profitable) global map inits.
staticinit.OutlineMapInits(fn)
// Split large init function.
staticinit.SplitLargeInit(fn)
target.Inits = append(target.Inits, fn)
}

View File

@@ -1557,7 +1557,7 @@ func (w *writer) forStmt(stmt *syntax.ForStmt) {
func (w *writer) distinctVars(stmt *syntax.ForStmt) bool {
lv := base.Debug.LoopVar
fileVersion := w.p.info.FileVersions[stmt.Pos().Base()]
fileVersion := w.p.info.FileVersions[stmt.Pos().FileBase()]
is122 := fileVersion == "" || version.Compare(fileVersion, "go1.22") >= 0
// Turning off loopvar for 1.22 is only possible with loopvarhash=qn

View File

@@ -87,10 +87,7 @@ func MakeTask() {
// Record user init functions.
for _, fn := range typecheck.Target.Inits {
if fn.Sym().Name == "init" {
// Synthetic init function for initialization of package-scope
// variables. We can use staticinit to optimize away static
// assignments.
if staticinit.CanOptimize(fn) {
s := staticinit.Schedule{
Plans: make(map[ir.Node]*staticinit.Plan),
Temps: make(map[ir.Node]*ir.Name),

File diff suppressed because it is too large Load Diff

View File

@@ -271,10 +271,10 @@ func writeMapType(t *types.Type, lsym *obj.LSym, c rttype.Cursor) {
slotTyp := gtyp.Field(1).Type.Elem()
elemOff := slotTyp.Field(1).Offset
if AlgType(t.Key()) == types.AMEM64 && elemOff != 8 {
if types.AlgType(t.Key()) == types.AMEM && t.Key().Size() == 8 && elemOff != 8 {
base.Fatalf("runtime assumes elemOff for 8-byte keys is 8, got %d", elemOff)
}
if AlgType(t.Key()) == types.ASTRING && elemOff != int64(2*types.PtrSize) {
if types.AlgType(t.Key()) == types.ASTRING && elemOff != int64(2*types.PtrSize) {
base.Fatalf("runtime assumes elemOff for string keys is %d, got %d", 2*types.PtrSize, elemOff)
}

View File

@@ -756,6 +756,9 @@ func writeType(t *types.Type) *obj.LSym {
// | method list, if any | dextratype
// +--------------------------------+ - E
// runtime.moduleTypelinks is aware of this type layout,
// and must be changed if the layout change.
// UncommonType section is included if we have a name or a method.
extra := t.Sym() != nil || len(methods(t)) != 0

View File

@@ -124,6 +124,11 @@ func Funcs(all []*ir.Func) {
for _, fn := range all {
analyze(fn)
}
for _, fn := range all {
if ir.MatchAstDump(fn, "slice") {
ir.AstDump(fn, "slice, "+ir.FuncName(fn))
}
}
}
func analyze(fn *ir.Func) {

View File

@@ -598,30 +598,30 @@
// mutandis, for UGE and SETAE, and CC and SETCC.
((NE|EQ) (TESTL (SHLL (MOVLconst [1]) x) y)) => ((ULT|UGE) (BTL x y))
((NE|EQ) (TESTQ (SHLQ (MOVQconst [1]) x) y)) => ((ULT|UGE) (BTQ x y))
((NE|EQ) (TESTLconst [c] x)) && isUnsignedPowerOfTwo(uint32(c))
((NE|EQ) (TESTLconst [c] x)) && isPowerOfTwo(uint32(c))
=> ((ULT|UGE) (BTLconst [int8(log32u(uint32(c)))] x))
((NE|EQ) (TESTQconst [c] x)) && isUnsignedPowerOfTwo(uint64(c))
((NE|EQ) (TESTQconst [c] x)) && isPowerOfTwo(uint64(c))
=> ((ULT|UGE) (BTQconst [int8(log32u(uint32(c)))] x))
((NE|EQ) (TESTQ (MOVQconst [c]) x)) && isUnsignedPowerOfTwo(uint64(c))
((NE|EQ) (TESTQ (MOVQconst [c]) x)) && isPowerOfTwo(uint64(c))
=> ((ULT|UGE) (BTQconst [int8(log64u(uint64(c)))] x))
(SET(NE|EQ) (TESTL (SHLL (MOVLconst [1]) x) y)) => (SET(B|AE) (BTL x y))
(SET(NE|EQ) (TESTQ (SHLQ (MOVQconst [1]) x) y)) => (SET(B|AE) (BTQ x y))
(SET(NE|EQ) (TESTLconst [c] x)) && isUnsignedPowerOfTwo(uint32(c))
(SET(NE|EQ) (TESTLconst [c] x)) && isPowerOfTwo(uint32(c))
=> (SET(B|AE) (BTLconst [int8(log32u(uint32(c)))] x))
(SET(NE|EQ) (TESTQconst [c] x)) && isUnsignedPowerOfTwo(uint64(c))
(SET(NE|EQ) (TESTQconst [c] x)) && isPowerOfTwo(uint64(c))
=> (SET(B|AE) (BTQconst [int8(log32u(uint32(c)))] x))
(SET(NE|EQ) (TESTQ (MOVQconst [c]) x)) && isUnsignedPowerOfTwo(uint64(c))
(SET(NE|EQ) (TESTQ (MOVQconst [c]) x)) && isPowerOfTwo(uint64(c))
=> (SET(B|AE) (BTQconst [int8(log64u(uint64(c)))] x))
// SET..store variant
(SET(NE|EQ)store [off] {sym} ptr (TESTL (SHLL (MOVLconst [1]) x) y) mem)
=> (SET(B|AE)store [off] {sym} ptr (BTL x y) mem)
(SET(NE|EQ)store [off] {sym} ptr (TESTQ (SHLQ (MOVQconst [1]) x) y) mem)
=> (SET(B|AE)store [off] {sym} ptr (BTQ x y) mem)
(SET(NE|EQ)store [off] {sym} ptr (TESTLconst [c] x) mem) && isUnsignedPowerOfTwo(uint32(c))
(SET(NE|EQ)store [off] {sym} ptr (TESTLconst [c] x) mem) && isPowerOfTwo(uint32(c))
=> (SET(B|AE)store [off] {sym} ptr (BTLconst [int8(log32u(uint32(c)))] x) mem)
(SET(NE|EQ)store [off] {sym} ptr (TESTQconst [c] x) mem) && isUnsignedPowerOfTwo(uint64(c))
(SET(NE|EQ)store [off] {sym} ptr (TESTQconst [c] x) mem) && isPowerOfTwo(uint64(c))
=> (SET(B|AE)store [off] {sym} ptr (BTQconst [int8(log32u(uint32(c)))] x) mem)
(SET(NE|EQ)store [off] {sym} ptr (TESTQ (MOVQconst [c]) x) mem) && isUnsignedPowerOfTwo(uint64(c))
(SET(NE|EQ)store [off] {sym} ptr (TESTQ (MOVQconst [c]) x) mem) && isPowerOfTwo(uint64(c))
=> (SET(B|AE)store [off] {sym} ptr (BTQconst [int8(log64u(uint64(c)))] x) mem)
// Handle bit-testing in the form (a>>b)&1 != 0 by building the above rules
@@ -647,14 +647,14 @@
(XOR(Q|L) (SHL(Q|L) (MOV(Q|L)const [1]) y) x) => (BTC(Q|L) x y)
// Note: only convert OR/XOR to BTS/BTC if the constant wouldn't fit in
// the constant field of the OR/XOR instruction. See issue 61694.
((OR|XOR)Q (MOVQconst [c]) x) && isUnsignedPowerOfTwo(uint64(c)) && uint64(c) >= 1<<31 => (BT(S|C)Qconst [int8(log64u(uint64(c)))] x)
((OR|XOR)Q (MOVQconst [c]) x) && isPowerOfTwo(uint64(c)) && uint64(c) >= 1<<31 => (BT(S|C)Qconst [int8(log64u(uint64(c)))] x)
// Recognize bit clearing: a &^= 1<<b
(AND(Q|L) (NOT(Q|L) (SHL(Q|L) (MOV(Q|L)const [1]) y)) x) => (BTR(Q|L) x y)
(ANDN(Q|L) x (SHL(Q|L) (MOV(Q|L)const [1]) y)) => (BTR(Q|L) x y)
// Note: only convert AND to BTR if the constant wouldn't fit in
// the constant field of the AND instruction. See issue 61694.
(ANDQ (MOVQconst [c]) x) && isUnsignedPowerOfTwo(uint64(^c)) && uint64(^c) >= 1<<31 => (BTRQconst [int8(log64u(uint64(^c)))] x)
(ANDQ (MOVQconst [c]) x) && isPowerOfTwo(uint64(^c)) && uint64(^c) >= 1<<31 => (BTRQconst [int8(log64u(uint64(^c)))] x)
// Special-case bit patterns on first/last bit.
// generic.rules changes ANDs of high-part/low-part masks into a couple of shifts,
@@ -1679,21 +1679,21 @@
(Cvt8toMask64x8 <t> x) => (VPMOVMToVec64x8 <types.TypeVec512> (KMOVBk <t> x))
// masks to integers
(CvtMask8x16to16 <t> x) => (KMOVWi <t> (VPMOVVec8x16ToM <types.TypeMask> x))
(CvtMask8x32to32 <t> x) => (KMOVDi <t> (VPMOVVec8x32ToM <types.TypeMask> x))
(CvtMask8x64to64 <t> x) => (KMOVQi <t> (VPMOVVec8x64ToM <types.TypeMask> x))
(CvtMask8x16to16 ...) => (VPMOVMSKB128 ...)
(CvtMask8x32to32 ...) => (VPMOVMSKB256 ...)
(CvtMask8x64to64 x) => (KMOVQi (VPMOVVec8x64ToM <types.TypeMask> x))
(CvtMask16x8to8 <t> x) => (KMOVBi <t> (VPMOVVec16x8ToM <types.TypeMask> x))
(CvtMask16x16to16 <t> x) => (KMOVWi <t> (VPMOVVec16x16ToM <types.TypeMask> x))
(CvtMask16x32to32 <t> x) => (KMOVDi <t> (VPMOVVec16x32ToM <types.TypeMask> x))
(CvtMask16x8to8 x) => (KMOVBi (VPMOVVec16x8ToM <types.TypeMask> x))
(CvtMask16x16to16 x) => (KMOVWi (VPMOVVec16x16ToM <types.TypeMask> x))
(CvtMask16x32to32 x) => (KMOVDi (VPMOVVec16x32ToM <types.TypeMask> x))
(CvtMask32x4to8 <t> x) => (KMOVBi <t> (VPMOVVec32x4ToM <types.TypeMask> x))
(CvtMask32x8to8 <t> x) => (KMOVBi <t> (VPMOVVec32x8ToM <types.TypeMask> x))
(CvtMask32x16to16 <t> x) => (KMOVWi <t> (VPMOVVec32x16ToM <types.TypeMask> x))
(CvtMask32x4to8 ...) => (VMOVMSKPS128 ...)
(CvtMask32x8to8 ...) => (VMOVMSKPS256 ...)
(CvtMask32x16to16 x) => (KMOVWi (VPMOVVec32x16ToM <types.TypeMask> x))
(CvtMask64x2to8 <t> x) => (KMOVBi <t> (VPMOVVec64x2ToM <types.TypeMask> x))
(CvtMask64x4to8 <t> x) => (KMOVBi <t> (VPMOVVec64x4ToM <types.TypeMask> x))
(CvtMask64x8to8 <t> x) => (KMOVBi <t> (VPMOVVec64x8ToM <types.TypeMask> x))
(CvtMask64x2to8 ...) => (VMOVMSKPD128 ...)
(CvtMask64x4to8 ...) => (VMOVMSKPD256 ...)
(CvtMask64x8to8 x) => (KMOVBi (VPMOVVec64x8ToM <types.TypeMask> x))
// optimizations
(MOVBstore [off] {sym} ptr (KMOVBi mask) mem) => (KMOVBstore [off] {sym} ptr mask mem)
@@ -1730,6 +1730,13 @@
// Misc
(IsZeroVec x) => (SETEQ (VPTEST x x))
(IsNaNFloat32x4 x) => (VCMPPS128 [3] x x)
(IsNaNFloat32x8 x) => (VCMPPS256 [3] x x)
(IsNaNFloat32x16 x) => (VPMOVMToVec32x16 (VCMPPS512 [3] x x))
(IsNaNFloat64x2 x) => (VCMPPD128 [3] x x)
(IsNaNFloat64x4 x) => (VCMPPD256 [3] x x)
(IsNaNFloat64x8 x) => (VPMOVMToVec64x8 (VCMPPD512 [3] x x))
// SIMD vector K-masked loads and stores
(LoadMasked64 <t> ptr mask mem) && t.Size() == 64 => (VPMASK64load512 ptr (VPMOVVec64x8ToM <types.TypeMask> mask) mem)
@@ -1818,10 +1825,10 @@
(EQ (VPTEST x:(VPANDN(128|256) j k) y) yes no) && x == y && x.Uses == 2 => (ULT (VPTEST k j) yes no) // AndNot has swapped its operand order
(EQ (VPTEST x:(VPANDN(D|Q)512 j k) y) yes no) && x == y && x.Uses == 2 => (ULT (VPTEST k j) yes no) // AndNot has swapped its operand order
// DotProductQuadruple optimizations
(VPADDD128 (VPDPBUSD128 (Zero128 <t>) x y) z) => (VPDPBUSD128 <t> z x y)
(VPADDD256 (VPDPBUSD256 (Zero256 <t>) x y) z) => (VPDPBUSD256 <t> z x y)
(VPADDD512 (VPDPBUSD512 (Zero512 <t>) x y) z) => (VPDPBUSD512 <t> z x y)
(VPADDD128 (VPDPBUSDS128 (Zero128 <t>) x y) z) => (VPDPBUSDS128 <t> z x y)
(VPADDD256 (VPDPBUSDS256 (Zero256 <t>) x y) z) => (VPDPBUSDS256 <t> z x y)
(VPADDD512 (VPDPBUSDS512 (Zero512 <t>) x y) z) => (VPDPBUSDS512 <t> z x y)
// optimize x.IsNaN().Or(y.IsNaN())
(VPOR128 (VCMPP(S|D)128 [3] x x) (VCMPP(S|D)128 [3] y y)) => (VCMPP(S|D)128 [3] x y)
(VPOR256 (VCMPP(S|D)256 [3] x x) (VCMPP(S|D)256 [3] y y)) => (VCMPP(S|D)256 [3] x y)
(VPORD512 (VPMOVMToVec32x16 (VCMPPS512 [3] x x)) (VPMOVMToVec32x16 (VCMPPS512 [3] y y))) =>
(VPMOVMToVec32x16 (VCMPPS512 [3] x y))
(VPORD512 (VPMOVMToVec64x8 (VCMPPD512 [3] x x)) (VPMOVMToVec64x8 (VCMPPD512 [3] y y))) =>
(VPMOVMToVec64x8 (VCMPPD512 [3] x y))

View File

@@ -1368,6 +1368,7 @@ func init() {
{name: "VPMASK64load512", argLength: 3, reg: vloadk, asm: "VMOVDQU64", aux: "SymOff", faultOnNilArg0: true, symEffect: "Read"}, // load from arg0+auxint+aux, arg1=k mask, arg2 = mem
{name: "VPMASK64store512", argLength: 4, reg: vstorek, asm: "VMOVDQU64", aux: "SymOff", faultOnNilArg0: true, symEffect: "Write"}, // store, *(arg0+auxint+aux) = arg2, arg1=k mask, arg3 = mem
// AVX512 moves between int-vector and mask registers
{name: "VPMOVMToVec8x16", argLength: 1, reg: kv, asm: "VPMOVM2B"},
{name: "VPMOVMToVec8x32", argLength: 1, reg: kv, asm: "VPMOVM2B"},
{name: "VPMOVMToVec8x64", argLength: 1, reg: kw, asm: "VPMOVM2B"},
@@ -1400,6 +1401,14 @@ func init() {
{name: "VPMOVVec64x4ToM", argLength: 1, reg: vk, asm: "VPMOVQ2M"},
{name: "VPMOVVec64x8ToM", argLength: 1, reg: wk, asm: "VPMOVQ2M"},
// AVX1/2 moves from int-vector to bitmask (extracting sign bits)
{name: "VPMOVMSKB128", argLength: 1, reg: vgp, asm: "VPMOVMSKB"},
{name: "VPMOVMSKB256", argLength: 1, reg: vgp, asm: "VPMOVMSKB"},
{name: "VMOVMSKPS128", argLength: 1, reg: vgp, asm: "VMOVMSKPS"},
{name: "VMOVMSKPS256", argLength: 1, reg: vgp, asm: "VMOVMSKPS"},
{name: "VMOVMSKPD128", argLength: 1, reg: vgp, asm: "VMOVMSKPD"},
{name: "VMOVMSKPD256", argLength: 1, reg: vgp, asm: "VMOVMSKPD"},
// X15 is the zero register up to 128-bit. For larger values, we zero it on the fly.
{name: "Zero128", argLength: 0, reg: x15only, zeroWidth: true, fixedReg: true},
{name: "Zero256", argLength: 0, reg: v01, asm: "VPXOR"},

View File

@@ -8,6 +8,6 @@
(SHR(Q|L) x y) && buildcfg.GOAMD64 >= 3 => (SHRX(Q|L) x y)
// See comments in ARM64latelower.rules for why these are here.
(MOVLQZX x) && zeroUpper32Bits(x,3) => x
(MOVWQZX x) && zeroUpper48Bits(x,3) => x
(MOVBQZX x) && zeroUpper56Bits(x,3) => x
(MOVLQZX x) && ZeroUpper32Bits(x,3) => x
(MOVWQZX x) && ZeroUpper48Bits(x,3) => x
(MOVBQZX x) && ZeroUpper56Bits(x,3) => x

View File

@@ -29,7 +29,7 @@
(MOVBUreg x:((Equal|NotEqual|LessThan|LessThanU|LessThanF|LessEqual|LessEqualU|LessEqualF|GreaterThan|GreaterThanU|GreaterThanF|GreaterEqual|GreaterEqualU|GreaterEqualF) _)) => x
// omit unsigned extension
(MOVWUreg x) && zeroUpper32Bits(x, 3) => x
(MOVWUreg x) && ZeroUpper32Bits(x, 3) => x
// don't extend after proper load
(MOVBreg x:(MOVBload _ _)) => (MOVDreg x)

View File

@@ -773,6 +773,9 @@
(SUBF (NEGF (MULF x y)) z) && z.Block.Func.useFMA(v) => (FNMADDF x y z)
(SUBD (NEGD (MULD x y)) z) && z.Block.Func.useFMA(v) => (FNMADDD x y z)
// Absorb conversion between 32 bit and 64 bit if both src and dst are 32 bit.
(MOVDF ((ABS|SQRT)D (MOVFD x))) => ((ABS|SQRT)F x)
// generic simplifications
(ADDV x (NEGV y)) => (SUBV x y)
(SUBV x (NEGV y)) => (ADDV x y)
@@ -843,6 +846,11 @@
(MOVBUreg (ANDconst [c] x)) => (ANDconst [c&0xff] x)
// Avoid extending when already sufficiently shifted.
(MOVBUreg x:(SRLconst [c] y)) && c >= 24 => x
(MOVHUreg x:(SRLconst [c] y)) && c >= 16 => x
(MOVWUreg x:(SRLconst [c] y)) => x
// Avoid extending when already sufficiently masked.
(MOVBreg x:(ANDconst [c] y)) && c >= 0 && int64(int8(c)) == c => x
(MOVHreg x:(ANDconst [c] y)) && c >= 0 && int64(int16(c)) == c => x

View File

@@ -169,6 +169,7 @@ func init() {
{name: "SQRTD", argLength: 1, reg: fp11, asm: "SQRTD"}, // sqrt(arg0), float64
{name: "SQRTF", argLength: 1, reg: fp11, asm: "SQRTF"}, // sqrt(arg0), float32
{name: "ABSF", argLength: 1, reg: fp11, asm: "ABSF"}, // abs(arg0), float32
{name: "ABSD", argLength: 1, reg: fp11, asm: "ABSD"}, // abs(arg0), float64
{name: "CLZW", argLength: 1, reg: gp11, asm: "CLZW"}, // Count leading (high order) zeroes (returns 0-32)

View File

@@ -127,7 +127,7 @@
(Neg(32|16|8) ...) => (NEG ...)
(Neg(32|64)F ...) => (NEG(F|D) ...)
(Com(32|16|8) x) => (NORconst [0] x)
(Com(32|16|8) x) => (NOR (MOVWconst [0]) x)
(Sqrt ...) => (SQRTD ...)
(Sqrt32 ...) => (SQRTF ...)
@@ -382,7 +382,7 @@
(OR <typ.UInt32> (SLL <typ.UInt32> (ZeroExt8to32 val)
(SLLconst <typ.UInt32> [3]
(ANDconst <typ.UInt32> [3] ptr)))
(NORconst [0] <typ.UInt32> (SLL <typ.UInt32>
(NOR (MOVWconst [0]) <typ.UInt32> (SLL <typ.UInt32>
(MOVWconst [0xff]) (SLLconst <typ.UInt32> [3]
(ANDconst <typ.UInt32> [3] ptr))))) mem)
@@ -401,7 +401,7 @@
(SLLconst <typ.UInt32> [3]
(ANDconst <typ.UInt32> [3]
(XORconst <typ.UInt32> [3] ptr))))
(NORconst [0] <typ.UInt32> (SLL <typ.UInt32>
(NOR (MOVWconst [0]) <typ.UInt32> (SLL <typ.UInt32>
(MOVWconst [0xff]) (SLLconst <typ.UInt32> [3]
(ANDconst <typ.UInt32> [3]
(XORconst <typ.UInt32> [3] ptr)))))) mem)
@@ -599,7 +599,6 @@
(AND x (MOVWconst [c])) => (ANDconst [c] x)
(OR x (MOVWconst [c])) => (ORconst [c] x)
(XOR x (MOVWconst [c])) => (XORconst [c] x)
(NOR x (MOVWconst [c])) => (NORconst [c] x)
(SLL x (MOVWconst [c])) => (SLLconst x [c&31])
(SRL x (MOVWconst [c])) => (SRLconst x [c&31])
@@ -617,13 +616,13 @@
(Select0 (MULTU (MOVWconst [1]) _ )) => (MOVWconst [0])
(Select1 (MULTU (MOVWconst [-1]) x )) => (NEG <x.Type> x)
(Select0 (MULTU (MOVWconst [-1]) x )) => (CMOVZ (ADDconst <x.Type> [-1] x) (MOVWconst [0]) x)
(Select1 (MULTU (MOVWconst [c]) x )) && isUnsignedPowerOfTwo(uint32(c)) => (SLLconst [int32(log32u(uint32(c)))] x)
(Select0 (MULTU (MOVWconst [c]) x )) && isUnsignedPowerOfTwo(uint32(c)) => (SRLconst [int32(32-log32u(uint32(c)))] x)
(Select1 (MULTU (MOVWconst [c]) x )) && isPowerOfTwo(uint32(c)) => (SLLconst [int32(log32u(uint32(c)))] x)
(Select0 (MULTU (MOVWconst [c]) x )) && isPowerOfTwo(uint32(c)) => (SRLconst [int32(32-log32u(uint32(c)))] x)
(MUL (MOVWconst [0]) _ ) => (MOVWconst [0])
(MUL (MOVWconst [1]) x ) => x
(MUL (MOVWconst [-1]) x ) => (NEG x)
(MUL (MOVWconst [c]) x ) && isUnsignedPowerOfTwo(uint32(c)) => (SLLconst [int32(log32u(uint32(c)))] x)
(MUL (MOVWconst [c]) x ) && isPowerOfTwo(uint32(c)) => (SLLconst [int32(log32u(uint32(c)))] x)
// generic simplifications
(ADD x (NEG y)) => (SUB x y)
@@ -648,7 +647,6 @@
(ORconst [0] x) => x
(ORconst [-1] _) => (MOVWconst [-1])
(XORconst [0] x) => x
(XORconst [-1] x) => (NORconst [0] x)
// generic constant folding
(ADDconst [c] (MOVWconst [d])) => (MOVWconst [int32(c+d)])
@@ -673,7 +671,6 @@
(ORconst [c] (ORconst [d] x)) => (ORconst [c|d] x)
(XORconst [c] (MOVWconst [d])) => (MOVWconst [c^d])
(XORconst [c] (XORconst [d] x)) => (XORconst [c^d] x)
(NORconst [c] (MOVWconst [d])) => (MOVWconst [^(c|d)])
(NEG (MOVWconst [c])) => (MOVWconst [-c])
(MOVBreg (MOVWconst [c])) => (MOVWconst [int32(int8(c))])
(MOVBUreg (MOVWconst [c])) => (MOVWconst [int32(uint8(c))])

View File

@@ -433,7 +433,7 @@
(OR <typ.UInt64> (SLLV <typ.UInt32> (ZeroExt8to32 val)
(SLLVconst <typ.UInt64> [3]
(ANDconst <typ.UInt64> [3] ptr)))
(NORconst [0] <typ.UInt64> (SLLV <typ.UInt64>
(NOR (MOVVconst [0]) <typ.UInt64> (SLLV <typ.UInt64>
(MOVVconst [0xff]) (SLLVconst <typ.UInt64> [3]
(ANDconst <typ.UInt64> [3] ptr))))) mem)
@@ -452,7 +452,7 @@
(SLLVconst <typ.UInt64> [3]
(ANDconst <typ.UInt64> [3]
(XORconst <typ.UInt64> [3] ptr))))
(NORconst [0] <typ.UInt64> (SLLV <typ.UInt64>
(NOR (MOVVconst [0]) <typ.UInt64> (SLLV <typ.UInt64>
(MOVVconst [0xff]) (SLLVconst <typ.UInt64> [3]
(ANDconst <typ.UInt64> [3]
(XORconst <typ.UInt64> [3] ptr)))))) mem)
@@ -668,7 +668,6 @@
(AND x (MOVVconst [c])) && is32Bit(c) => (ANDconst [c] x)
(OR x (MOVVconst [c])) && is32Bit(c) => (ORconst [c] x)
(XOR x (MOVVconst [c])) && is32Bit(c) => (XORconst [c] x)
(NOR x (MOVVconst [c])) && is32Bit(c) => (NORconst [c] x)
(SLLV _ (MOVVconst [c])) && uint64(c)>=64 => (MOVVconst [0])
(SRLV _ (MOVVconst [c])) && uint64(c)>=64 => (MOVVconst [0])
@@ -711,7 +710,6 @@
(ORconst [0] x) => x
(ORconst [-1] _) => (MOVVconst [-1])
(XORconst [0] x) => x
(XORconst [-1] x) => (NORconst [0] x)
// generic constant folding
(ADDVconst [c] (MOVVconst [d])) => (MOVVconst [c+d])
@@ -734,7 +732,6 @@
(ORconst [c] (ORconst [d] x)) && is32Bit(c|d) => (ORconst [c|d] x)
(XORconst [c] (MOVVconst [d])) => (MOVVconst [c^d])
(XORconst [c] (XORconst [d] x)) && is32Bit(c^d) => (XORconst [c^d] x)
(NORconst [c] (MOVVconst [d])) => (MOVVconst [^(c|d)])
(NEGV (MOVVconst [c])) => (MOVVconst [-c])
(MOVBreg (MOVVconst [c])) => (MOVVconst [int64(int8(c))])
(MOVBUreg (MOVVconst [c])) => (MOVVconst [int64(uint8(c))])

View File

@@ -189,7 +189,6 @@ func init() {
{name: "XOR", argLength: 2, reg: gp21, asm: "XOR", commutative: true, typ: "UInt64"}, // arg0 ^ arg1
{name: "XORconst", argLength: 1, reg: gp11, asm: "XOR", aux: "Int64", typ: "UInt64"}, // arg0 ^ auxInt
{name: "NOR", argLength: 2, reg: gp21, asm: "NOR", commutative: true}, // ^(arg0 | arg1)
{name: "NORconst", argLength: 1, reg: gp11, asm: "NOR", aux: "Int64"}, // ^(arg0 | auxInt)
{name: "NEGV", argLength: 1, reg: gp11}, // -arg0
{name: "NEGF", argLength: 1, reg: fp11, asm: "NEGF"}, // -arg0, float32

View File

@@ -173,7 +173,6 @@ func init() {
{name: "XOR", argLength: 2, reg: gp21, asm: "XOR", commutative: true, typ: "UInt32"}, // arg0 ^ arg1
{name: "XORconst", argLength: 1, reg: gp11, asm: "XOR", aux: "Int32", typ: "UInt32"}, // arg0 ^ auxInt
{name: "NOR", argLength: 2, reg: gp21, asm: "NOR", commutative: true}, // ^(arg0 | arg1)
{name: "NORconst", argLength: 1, reg: gp11, asm: "NOR", aux: "Int32"}, // ^(arg0 | auxInt)
{name: "NEG", argLength: 1, reg: gp11}, // -arg0
{name: "NEGF", argLength: 1, reg: fp11, asm: "NEGF"}, // -arg0, float32

View File

@@ -118,6 +118,7 @@ func init() {
regCtxt := regNamed["X26"]
callerSave := gpMask | fpMask | regNamed["g"]
r5toR6 := regNamed["X5"] | regNamed["X6"]
regX5 := regNamed["X5"]
var (
gpstore = regInfo{inputs: []regMask{gpspsbMask, gpspMask, 0}} // SB in first input so we can load from a global, but not in second to avoid using SB as a temporary register
@@ -142,9 +143,13 @@ func init() {
fpload = regInfo{inputs: []regMask{gpspsbMask, 0}, outputs: []regMask{fpMask}}
fp2gp = regInfo{inputs: []regMask{fpMask, fpMask}, outputs: []regMask{gpMask}}
call = regInfo{clobbers: callerSave}
callClosure = regInfo{inputs: []regMask{gpspMask, regCtxt, 0}, clobbers: callerSave}
callInter = regInfo{inputs: []regMask{gpMask}, clobbers: callerSave}
call = regInfo{clobbers: callerSave}
// Avoid using X5 as the source register of calls. Using X5 here triggers
// RAS pop-then-push behavior which is not correct for function calls.
// Please refer to section 2.5.1 of the RISC-V ISA
// (https://docs.riscv.org/reference/isa/unpriv/rv32.html#rashints) for details.
callClosure = regInfo{inputs: []regMask{gpspMask ^ regX5, regCtxt, 0}, clobbers: callerSave}
callInter = regInfo{inputs: []regMask{gpMask ^ regX5}, clobbers: callerSave}
)
RISCV64ops := []opData{

View File

@@ -223,7 +223,7 @@
(Rsh64Ux64 <typ.UInt64>
(Avg64u
(Lsh64x64 <typ.UInt64> (ZeroExt32to64 x) (Const64 <typ.UInt64> [32]))
(Mul64 <typ.UInt64> (ZeroExt32to64 x) (Const64 <typ.UInt32> [int64(umagic32(c).m)])))
(Mul64 <typ.UInt64> (ZeroExt32to64 x) (Const64 <typ.UInt64> [int64(umagic32(c).m)])))
(Const64 <typ.UInt64> [32 + umagic32(c).s - 1])))
(Div32u <t> x (Const32 [c])) && umagicOK32(c) && config.RegSize == 4 =>
(Rsh32Ux64 <t>

View File

@@ -1063,10 +1063,10 @@
(Div64 <t> x (Const64 [-1<<63])) => (Rsh64Ux64 (And64 <t> x (Neg64 <t> x)) (Const64 <typ.UInt64> [63]))
// Unsigned divide by power of 2. Strength reduce to a shift.
(Div8u n (Const8 [c])) && isUnsignedPowerOfTwo(uint8(c)) => (Rsh8Ux64 n (Const64 <typ.UInt64> [log8u(uint8(c))]))
(Div16u n (Const16 [c])) && isUnsignedPowerOfTwo(uint16(c)) => (Rsh16Ux64 n (Const64 <typ.UInt64> [log16u(uint16(c))]))
(Div32u n (Const32 [c])) && isUnsignedPowerOfTwo(uint32(c)) => (Rsh32Ux64 n (Const64 <typ.UInt64> [log32u(uint32(c))]))
(Div64u n (Const64 [c])) && isUnsignedPowerOfTwo(uint64(c)) => (Rsh64Ux64 n (Const64 <typ.UInt64> [log64u(uint64(c))]))
(Div8u n (Const8 [c])) && isPowerOfTwo(uint8(c)) => (Rsh8Ux64 n (Const64 <typ.UInt64> [log8u(uint8(c))]))
(Div16u n (Const16 [c])) && isPowerOfTwo(uint16(c)) => (Rsh16Ux64 n (Const64 <typ.UInt64> [log16u(uint16(c))]))
(Div32u n (Const32 [c])) && isPowerOfTwo(uint32(c)) => (Rsh32Ux64 n (Const64 <typ.UInt64> [log32u(uint32(c))]))
(Div64u n (Const64 [c])) && isPowerOfTwo(uint64(c)) => (Rsh64Ux64 n (Const64 <typ.UInt64> [log64u(uint64(c))]))
// Strength reduce multiplication by a power of two to a shift.
// Excluded from early opt so that prove can recognize mod
@@ -1090,13 +1090,13 @@
(Neg64 (Lsh64x64 <t> x (Const64 <typ.UInt64> [log64(-c)])))
// Strength reduction of mod to div.
// Strength reduction of div to mul is delayed to genericlateopt.rules.
// Strength reduction of div to mul is delayed to divmod.rules.
// Unsigned mod by power of 2 constant.
(Mod8u <t> n (Const8 [c])) && isUnsignedPowerOfTwo(uint8(c)) => (And8 n (Const8 <t> [c-1]))
(Mod16u <t> n (Const16 [c])) && isUnsignedPowerOfTwo(uint16(c)) => (And16 n (Const16 <t> [c-1]))
(Mod32u <t> n (Const32 [c])) && isUnsignedPowerOfTwo(uint32(c)) => (And32 n (Const32 <t> [c-1]))
(Mod64u <t> n (Const64 [c])) && isUnsignedPowerOfTwo(uint64(c)) => (And64 n (Const64 <t> [c-1]))
(Mod8u <t> n (Const8 [c])) && isPowerOfTwo(uint8(c)) => (And8 n (Const8 <t> [c-1]))
(Mod16u <t> n (Const16 [c])) && isPowerOfTwo(uint16(c)) => (And16 n (Const16 <t> [c-1]))
(Mod32u <t> n (Const32 [c])) && isPowerOfTwo(uint32(c)) => (And32 n (Const32 <t> [c-1]))
(Mod64u <t> n (Const64 [c])) && isPowerOfTwo(uint64(c)) => (And64 n (Const64 <t> [c-1]))
// Signed non-negative mod by power of 2 constant.
// TODO: Replace ModN with ModNu in prove.
@@ -1560,6 +1560,43 @@
(MemEq p q _ _) && isSamePtr(p, q) => (ConstBool <typ.Bool> [true])
// 3-32 bytes memeq (enabled only with support of unaligned loads and 8-byte max word size)
(MemEq p q (Const64 [c]) mem)
&& (c == 3 || c == 5 || c == 9 || c == 17)
&& canLoadUnaligned(config)
&& config.RegSize == 8
=> (AndB (MemEq p q (Const64 <typ.Int64> [c-1]) mem)
(Eq8 (Load <typ.Int8> (OffPtr <p.Type> p [c-1]) mem) (Load <typ.Int8> (OffPtr <q.Type> q [c-1]) mem)))
(MemEq p q (Const64 [c]) mem)
&& (c == 6 || c == 10 || c == 18)
&& canLoadUnaligned(config)
&& config.RegSize == 8
=> (AndB (MemEq p q (Const64 <typ.Int64> [c-2]) mem)
(Eq16 (Load <typ.Int16> (OffPtr <p.Type> p [c-2]) mem) (Load <typ.Int16> (OffPtr <q.Type> q [c-2]) mem)))
(MemEq p q (Const64 [c]) mem)
&& (c == 7 || c == 11 || c == 19 || c == 20)
&& canLoadUnaligned(config)
&& config.RegSize == 8
=> (AndB (MemEq p q (Const64 <typ.Int64> [min(c-3,16)]) mem)
(Eq32 (Load <typ.Int32> (OffPtr <p.Type> p [c-4]) mem) (Load <typ.Int32> (OffPtr <q.Type> q [c-4]) mem)))
(MemEq p q (Const64 [c]) mem)
&& ((c >= 12 && c <= 16) || (c >= 21 && c <= 24))
&& canLoadUnaligned(config)
&& config.RegSize == 8
=> (AndB (MemEq p q (Const64 <typ.Int64> [8 + int64(bool2int(c>16))*8]) mem)
(Eq64 (Load <typ.Int64> (OffPtr <p.Type> p [c-8]) mem) (Load <typ.Int64> (OffPtr <q.Type> q [c-8]) mem)))
(MemEq p q (Const64 [c]) mem)
&& c >= 25 && c <= 32
&& canLoadUnaligned(config)
&& config.RegSize == 8
=> (AndB (MemEq p q (Const64 <typ.Int64> [16]) mem)
(MemEq (OffPtr <p.Type> p [16]) (OffPtr <q.Type> q [16]) (Const64 <typ.Int64> [c-16]) mem))
// Turn known-size calls to memclrNoHeapPointers into a Zero.
// Note that we are using types.Types[types.TUINT8] instead of sptr.Type.Elem() - see issue 55122 and CL 431496 for more details.
(SelectN [0] call:(StaticCall {sym} sptr (Const(64|32) [c]) mem))

View File

@@ -715,6 +715,14 @@ var genericOps = []opData{
// Returns true if arg0 is all zero.
{name: "IsZeroVec", argLength: 1},
// Returns a mask indicating whether arg0's elements are NaN.
{name: "IsNaNFloat32x4", argLength: 1},
{name: "IsNaNFloat32x8", argLength: 1},
{name: "IsNaNFloat32x16", argLength: 1},
{name: "IsNaNFloat64x2", argLength: 1},
{name: "IsNaNFloat64x4", argLength: 1},
{name: "IsNaNFloat64x8", argLength: 1},
}
// kind controls successors implicit exit

View File

@@ -1,4 +1,4 @@
// Code generated by x/arch/internal/simdgen using 'go run . -xedPath $XED_PATH -o godefs -goroot $GOROOT go.yaml types.yaml categories.yaml'; DO NOT EDIT.
// Code generated by 'simdgen -o godefs -goroot $GOROOT -xedPath $XED_PATH go.yaml types.yaml categories.yaml'; DO NOT EDIT.
(AESDecryptLastRoundUint8x16 ...) => (VAESDECLAST128 ...)
(AESDecryptLastRoundUint8x32 ...) => (VAESDECLAST256 ...)
@@ -57,19 +57,19 @@
(AddUint64x4 ...) => (VPADDQ256 ...)
(AddUint64x8 ...) => (VPADDQ512 ...)
(AddPairsFloat32x4 ...) => (VHADDPS128 ...)
(AddPairsFloat32x8 ...) => (VHADDPS256 ...)
(AddPairsFloat64x2 ...) => (VHADDPD128 ...)
(AddPairsFloat64x4 ...) => (VHADDPD256 ...)
(AddPairsInt16x8 ...) => (VPHADDW128 ...)
(AddPairsInt16x16 ...) => (VPHADDW256 ...)
(AddPairsInt32x4 ...) => (VPHADDD128 ...)
(AddPairsInt32x8 ...) => (VPHADDD256 ...)
(AddPairsUint16x8 ...) => (VPHADDW128 ...)
(AddPairsUint16x16 ...) => (VPHADDW256 ...)
(AddPairsUint32x4 ...) => (VPHADDD128 ...)
(AddPairsUint32x8 ...) => (VPHADDD256 ...)
(AddPairsGroupedFloat32x8 ...) => (VHADDPS256 ...)
(AddPairsGroupedFloat64x4 ...) => (VHADDPD256 ...)
(AddPairsGroupedInt16x16 ...) => (VPHADDW256 ...)
(AddPairsGroupedInt32x8 ...) => (VPHADDD256 ...)
(AddPairsGroupedUint16x16 ...) => (VPHADDW256 ...)
(AddPairsGroupedUint32x8 ...) => (VPHADDD256 ...)
(AddPairsSaturatedInt16x8 ...) => (VPHADDSW128 ...)
(AddPairsSaturatedInt16x16 ...) => (VPHADDSW256 ...)
(AddPairsSaturatedGroupedInt16x16 ...) => (VPHADDSW256 ...)
(AddSaturatedInt8x16 ...) => (VPADDSB128 ...)
(AddSaturatedInt8x32 ...) => (VPADDSB256 ...)
(AddSaturatedInt8x64 ...) => (VPADDSB512 ...)
@@ -140,36 +140,36 @@
(AverageUint16x8 ...) => (VPAVGW128 ...)
(AverageUint16x16 ...) => (VPAVGW256 ...)
(AverageUint16x32 ...) => (VPAVGW512 ...)
(Broadcast128Float32x4 ...) => (VBROADCASTSS128 ...)
(Broadcast128Float64x2 ...) => (VPBROADCASTQ128 ...)
(Broadcast128Int8x16 ...) => (VPBROADCASTB128 ...)
(Broadcast128Int16x8 ...) => (VPBROADCASTW128 ...)
(Broadcast128Int32x4 ...) => (VPBROADCASTD128 ...)
(Broadcast128Int64x2 ...) => (VPBROADCASTQ128 ...)
(Broadcast128Uint8x16 ...) => (VPBROADCASTB128 ...)
(Broadcast128Uint16x8 ...) => (VPBROADCASTW128 ...)
(Broadcast128Uint32x4 ...) => (VPBROADCASTD128 ...)
(Broadcast128Uint64x2 ...) => (VPBROADCASTQ128 ...)
(Broadcast256Float32x4 ...) => (VBROADCASTSS256 ...)
(Broadcast256Float64x2 ...) => (VBROADCASTSD256 ...)
(Broadcast256Int8x16 ...) => (VPBROADCASTB256 ...)
(Broadcast256Int16x8 ...) => (VPBROADCASTW256 ...)
(Broadcast256Int32x4 ...) => (VPBROADCASTD256 ...)
(Broadcast256Int64x2 ...) => (VPBROADCASTQ256 ...)
(Broadcast256Uint8x16 ...) => (VPBROADCASTB256 ...)
(Broadcast256Uint16x8 ...) => (VPBROADCASTW256 ...)
(Broadcast256Uint32x4 ...) => (VPBROADCASTD256 ...)
(Broadcast256Uint64x2 ...) => (VPBROADCASTQ256 ...)
(Broadcast512Float32x4 ...) => (VBROADCASTSS512 ...)
(Broadcast512Float64x2 ...) => (VBROADCASTSD512 ...)
(Broadcast512Int8x16 ...) => (VPBROADCASTB512 ...)
(Broadcast512Int16x8 ...) => (VPBROADCASTW512 ...)
(Broadcast512Int32x4 ...) => (VPBROADCASTD512 ...)
(Broadcast512Int64x2 ...) => (VPBROADCASTQ512 ...)
(Broadcast512Uint8x16 ...) => (VPBROADCASTB512 ...)
(Broadcast512Uint16x8 ...) => (VPBROADCASTW512 ...)
(Broadcast512Uint32x4 ...) => (VPBROADCASTD512 ...)
(Broadcast512Uint64x2 ...) => (VPBROADCASTQ512 ...)
(Broadcast1To2Float64x2 ...) => (VPBROADCASTQ128 ...)
(Broadcast1To2Int64x2 ...) => (VPBROADCASTQ128 ...)
(Broadcast1To2Uint64x2 ...) => (VPBROADCASTQ128 ...)
(Broadcast1To4Float32x4 ...) => (VBROADCASTSS128 ...)
(Broadcast1To4Float64x2 ...) => (VBROADCASTSD256 ...)
(Broadcast1To4Int32x4 ...) => (VPBROADCASTD128 ...)
(Broadcast1To4Int64x2 ...) => (VPBROADCASTQ256 ...)
(Broadcast1To4Uint32x4 ...) => (VPBROADCASTD128 ...)
(Broadcast1To4Uint64x2 ...) => (VPBROADCASTQ256 ...)
(Broadcast1To8Float32x4 ...) => (VBROADCASTSS256 ...)
(Broadcast1To8Float64x2 ...) => (VBROADCASTSD512 ...)
(Broadcast1To8Int16x8 ...) => (VPBROADCASTW128 ...)
(Broadcast1To8Int32x4 ...) => (VPBROADCASTD256 ...)
(Broadcast1To8Int64x2 ...) => (VPBROADCASTQ512 ...)
(Broadcast1To8Uint16x8 ...) => (VPBROADCASTW128 ...)
(Broadcast1To8Uint32x4 ...) => (VPBROADCASTD256 ...)
(Broadcast1To8Uint64x2 ...) => (VPBROADCASTQ512 ...)
(Broadcast1To16Float32x4 ...) => (VBROADCASTSS512 ...)
(Broadcast1To16Int8x16 ...) => (VPBROADCASTB128 ...)
(Broadcast1To16Int16x8 ...) => (VPBROADCASTW256 ...)
(Broadcast1To16Int32x4 ...) => (VPBROADCASTD512 ...)
(Broadcast1To16Uint8x16 ...) => (VPBROADCASTB128 ...)
(Broadcast1To16Uint16x8 ...) => (VPBROADCASTW256 ...)
(Broadcast1To16Uint32x4 ...) => (VPBROADCASTD512 ...)
(Broadcast1To32Int8x16 ...) => (VPBROADCASTB256 ...)
(Broadcast1To32Int16x8 ...) => (VPBROADCASTW512 ...)
(Broadcast1To32Uint8x16 ...) => (VPBROADCASTB256 ...)
(Broadcast1To32Uint16x8 ...) => (VPBROADCASTW512 ...)
(Broadcast1To64Int8x16 ...) => (VPBROADCASTB512 ...)
(Broadcast1To64Uint8x16 ...) => (VPBROADCASTB512 ...)
(CeilFloat32x4 x) => (VROUNDPS128 [2] x)
(CeilFloat32x8 x) => (VROUNDPS256 [2] x)
(CeilFloat64x2 x) => (VROUNDPD128 [2] x)
@@ -316,12 +316,6 @@
(DotProductPairsSaturatedUint8x16 ...) => (VPMADDUBSW128 ...)
(DotProductPairsSaturatedUint8x32 ...) => (VPMADDUBSW256 ...)
(DotProductPairsSaturatedUint8x64 ...) => (VPMADDUBSW512 ...)
(DotProductQuadrupleInt32x4 ...) => (VPDPBUSD128 ...)
(DotProductQuadrupleInt32x8 ...) => (VPDPBUSD256 ...)
(DotProductQuadrupleInt32x16 ...) => (VPDPBUSD512 ...)
(DotProductQuadrupleSaturatedInt32x4 ...) => (VPDPBUSDS128 ...)
(DotProductQuadrupleSaturatedInt32x8 ...) => (VPDPBUSDS256 ...)
(DotProductQuadrupleSaturatedInt32x16 ...) => (VPDPBUSDS512 ...)
(EqualFloat32x4 x y) => (VCMPPS128 [0] x y)
(EqualFloat32x8 x y) => (VCMPPS256 [0] x y)
(EqualFloat32x16 x y) => (VPMOVMToVec32x16 (VCMPPS512 [0] x y))
@@ -382,26 +376,26 @@
(ExpandUint64x2 x mask) => (VPEXPANDQMasked128 x (VPMOVVec64x2ToM <types.TypeMask> mask))
(ExpandUint64x4 x mask) => (VPEXPANDQMasked256 x (VPMOVVec64x4ToM <types.TypeMask> mask))
(ExpandUint64x8 x mask) => (VPEXPANDQMasked512 x (VPMOVVec64x8ToM <types.TypeMask> mask))
(ExtendLo2ToInt64x2Int8x16 ...) => (VPMOVSXBQ128 ...)
(ExtendLo2ToInt64x2Int16x8 ...) => (VPMOVSXWQ128 ...)
(ExtendLo2ToInt64x2Int32x4 ...) => (VPMOVSXDQ128 ...)
(ExtendLo2ToUint64x2Uint8x16 ...) => (VPMOVZXBQ128 ...)
(ExtendLo2ToUint64x2Uint16x8 ...) => (VPMOVZXWQ128 ...)
(ExtendLo2ToUint64x2Uint32x4 ...) => (VPMOVZXDQ128 ...)
(ExtendLo4ToInt32x4Int8x16 ...) => (VPMOVSXBD128 ...)
(ExtendLo4ToInt32x4Int16x8 ...) => (VPMOVSXWD128 ...)
(ExtendLo4ToInt64x4Int8x16 ...) => (VPMOVSXBQ256 ...)
(ExtendLo4ToInt64x4Int16x8 ...) => (VPMOVSXWQ256 ...)
(ExtendLo4ToUint32x4Uint8x16 ...) => (VPMOVZXBD128 ...)
(ExtendLo4ToUint32x4Uint16x8 ...) => (VPMOVZXWD128 ...)
(ExtendLo4ToUint64x4Uint8x16 ...) => (VPMOVZXBQ256 ...)
(ExtendLo4ToUint64x4Uint16x8 ...) => (VPMOVZXWQ256 ...)
(ExtendLo8ToInt16x8Int8x16 ...) => (VPMOVSXBW128 ...)
(ExtendLo8ToInt32x8Int8x16 ...) => (VPMOVSXBD256 ...)
(ExtendLo8ToInt64x8Int8x16 ...) => (VPMOVSXBQ512 ...)
(ExtendLo8ToUint16x8Uint8x16 ...) => (VPMOVZXBW128 ...)
(ExtendLo8ToUint32x8Uint8x16 ...) => (VPMOVZXBD256 ...)
(ExtendLo8ToUint64x8Uint8x16 ...) => (VPMOVZXBQ512 ...)
(ExtendLo2ToInt64Int8x16 ...) => (VPMOVSXBQ128 ...)
(ExtendLo2ToInt64Int16x8 ...) => (VPMOVSXWQ128 ...)
(ExtendLo2ToInt64Int32x4 ...) => (VPMOVSXDQ128 ...)
(ExtendLo2ToUint64Uint8x16 ...) => (VPMOVZXBQ128 ...)
(ExtendLo2ToUint64Uint16x8 ...) => (VPMOVZXWQ128 ...)
(ExtendLo2ToUint64Uint32x4 ...) => (VPMOVZXDQ128 ...)
(ExtendLo4ToInt32Int8x16 ...) => (VPMOVSXBD128 ...)
(ExtendLo4ToInt32Int16x8 ...) => (VPMOVSXWD128 ...)
(ExtendLo4ToInt64Int8x16 ...) => (VPMOVSXBQ256 ...)
(ExtendLo4ToInt64Int16x8 ...) => (VPMOVSXWQ256 ...)
(ExtendLo4ToUint32Uint8x16 ...) => (VPMOVZXBD128 ...)
(ExtendLo4ToUint32Uint16x8 ...) => (VPMOVZXWD128 ...)
(ExtendLo4ToUint64Uint8x16 ...) => (VPMOVZXBQ256 ...)
(ExtendLo4ToUint64Uint16x8 ...) => (VPMOVZXWQ256 ...)
(ExtendLo8ToInt16Int8x16 ...) => (VPMOVSXBW128 ...)
(ExtendLo8ToInt32Int8x16 ...) => (VPMOVSXBD256 ...)
(ExtendLo8ToInt64Int8x16 ...) => (VPMOVSXBQ512 ...)
(ExtendLo8ToUint16Uint8x16 ...) => (VPMOVZXBW128 ...)
(ExtendLo8ToUint32Uint8x16 ...) => (VPMOVZXBD256 ...)
(ExtendLo8ToUint64Uint8x16 ...) => (VPMOVZXBQ512 ...)
(ExtendToInt16Int8x16 ...) => (VPMOVSXBW256 ...)
(ExtendToInt16Int8x32 ...) => (VPMOVSXBW512 ...)
(ExtendToInt32Int8x16 ...) => (VPMOVSXBD512 ...)
@@ -565,12 +559,6 @@
(InterleaveLoGroupedUint32x16 ...) => (VPUNPCKLDQ512 ...)
(InterleaveLoGroupedUint64x4 ...) => (VPUNPCKLQDQ256 ...)
(InterleaveLoGroupedUint64x8 ...) => (VPUNPCKLQDQ512 ...)
(IsNanFloat32x4 x y) => (VCMPPS128 [3] x y)
(IsNanFloat32x8 x y) => (VCMPPS256 [3] x y)
(IsNanFloat32x16 x y) => (VPMOVMToVec32x16 (VCMPPS512 [3] x y))
(IsNanFloat64x2 x y) => (VCMPPD128 [3] x y)
(IsNanFloat64x4 x y) => (VCMPPD256 [3] x y)
(IsNanFloat64x8 x y) => (VPMOVMToVec64x8 (VCMPPD512 [3] x y))
(LeadingZerosInt32x4 ...) => (VPLZCNTD128 ...)
(LeadingZerosInt32x8 ...) => (VPLZCNTD256 ...)
(LeadingZerosInt32x16 ...) => (VPLZCNTD512 ...)
@@ -914,29 +902,29 @@
(SaturateToInt16Int64x4 ...) => (VPMOVSQW128_256 ...)
(SaturateToInt16Int64x8 ...) => (VPMOVSQW128_512 ...)
(SaturateToInt16ConcatInt32x4 ...) => (VPACKSSDW128 ...)
(SaturateToInt16ConcatInt32x8 ...) => (VPACKSSDW256 ...)
(SaturateToInt16ConcatInt32x16 ...) => (VPACKSSDW512 ...)
(SaturateToInt16ConcatGroupedInt32x8 ...) => (VPACKSSDW256 ...)
(SaturateToInt16ConcatGroupedInt32x16 ...) => (VPACKSSDW512 ...)
(SaturateToInt32Int64x2 ...) => (VPMOVSQD128_128 ...)
(SaturateToInt32Int64x4 ...) => (VPMOVSQD128_256 ...)
(SaturateToInt32Int64x8 ...) => (VPMOVSQD256 ...)
(SaturateToUint8Int16x8 ...) => (VPMOVSWB128_128 ...)
(SaturateToUint8Int16x16 ...) => (VPMOVSWB128_256 ...)
(SaturateToUint8Int32x4 ...) => (VPMOVSDB128_128 ...)
(SaturateToUint8Int32x8 ...) => (VPMOVSDB128_256 ...)
(SaturateToUint8Int32x16 ...) => (VPMOVSDB128_512 ...)
(SaturateToUint8Int64x2 ...) => (VPMOVSQB128_128 ...)
(SaturateToUint8Int64x4 ...) => (VPMOVSQB128_256 ...)
(SaturateToUint8Int64x8 ...) => (VPMOVSQB128_512 ...)
(SaturateToUint8Uint16x8 ...) => (VPMOVUSWB128_128 ...)
(SaturateToUint8Uint16x16 ...) => (VPMOVUSWB128_256 ...)
(SaturateToUint8Uint16x32 ...) => (VPMOVUSWB256 ...)
(SaturateToUint8Uint32x4 ...) => (VPMOVUSDB128_128 ...)
(SaturateToUint8Uint32x8 ...) => (VPMOVUSDB128_256 ...)
(SaturateToUint8Uint32x16 ...) => (VPMOVUSDB128_512 ...)
(SaturateToUint8Uint64x2 ...) => (VPMOVUSQB128_128 ...)
(SaturateToUint8Uint64x4 ...) => (VPMOVUSQB128_256 ...)
(SaturateToUint8Uint64x8 ...) => (VPMOVUSQB128_512 ...)
(SaturateToUint16Uint32x4 ...) => (VPMOVUSDW128_128 ...)
(SaturateToUint16Uint32x8 ...) => (VPMOVUSDW128_256 ...)
(SaturateToUint16Uint32x16 ...) => (VPMOVUSDW256 ...)
(SaturateToUint16Uint64x2 ...) => (VPMOVUSQW128_128 ...)
(SaturateToUint16Uint64x4 ...) => (VPMOVUSQW128_256 ...)
(SaturateToUint16Uint64x8 ...) => (VPMOVUSQW128_512 ...)
(SaturateToUint16ConcatUint32x4 ...) => (VPACKUSDW128 ...)
(SaturateToUint16ConcatUint32x8 ...) => (VPACKUSDW256 ...)
(SaturateToUint16ConcatUint32x16 ...) => (VPACKUSDW512 ...)
(SaturateToUint16ConcatInt32x4 ...) => (VPACKUSDW128 ...)
(SaturateToUint16ConcatGroupedInt32x8 ...) => (VPACKUSDW256 ...)
(SaturateToUint16ConcatGroupedInt32x16 ...) => (VPACKUSDW512 ...)
(SaturateToUint32Uint64x2 ...) => (VPMOVUSQD128_128 ...)
(SaturateToUint32Uint64x4 ...) => (VPMOVUSQD128_256 ...)
(SaturateToUint32Uint64x8 ...) => (VPMOVUSQD256 ...)
@@ -1223,19 +1211,19 @@
(SubUint64x4 ...) => (VPSUBQ256 ...)
(SubUint64x8 ...) => (VPSUBQ512 ...)
(SubPairsFloat32x4 ...) => (VHSUBPS128 ...)
(SubPairsFloat32x8 ...) => (VHSUBPS256 ...)
(SubPairsFloat64x2 ...) => (VHSUBPD128 ...)
(SubPairsFloat64x4 ...) => (VHSUBPD256 ...)
(SubPairsInt16x8 ...) => (VPHSUBW128 ...)
(SubPairsInt16x16 ...) => (VPHSUBW256 ...)
(SubPairsInt32x4 ...) => (VPHSUBD128 ...)
(SubPairsInt32x8 ...) => (VPHSUBD256 ...)
(SubPairsUint16x8 ...) => (VPHSUBW128 ...)
(SubPairsUint16x16 ...) => (VPHSUBW256 ...)
(SubPairsUint32x4 ...) => (VPHSUBD128 ...)
(SubPairsUint32x8 ...) => (VPHSUBD256 ...)
(SubPairsGroupedFloat32x8 ...) => (VHSUBPS256 ...)
(SubPairsGroupedFloat64x4 ...) => (VHSUBPD256 ...)
(SubPairsGroupedInt16x16 ...) => (VPHSUBW256 ...)
(SubPairsGroupedInt32x8 ...) => (VPHSUBD256 ...)
(SubPairsGroupedUint16x16 ...) => (VPHSUBW256 ...)
(SubPairsGroupedUint32x8 ...) => (VPHSUBD256 ...)
(SubPairsSaturatedInt16x8 ...) => (VPHSUBSW128 ...)
(SubPairsSaturatedInt16x16 ...) => (VPHSUBSW256 ...)
(SubPairsSaturatedGroupedInt16x16 ...) => (VPHSUBSW256 ...)
(SubSaturatedInt8x16 ...) => (VPSUBSB128 ...)
(SubSaturatedInt8x32 ...) => (VPSUBSB256 ...)
(SubSaturatedInt8x64 ...) => (VPSUBSB512 ...)
@@ -1436,23 +1424,23 @@
(VMOVDQU16Masked128 (VPAVGW128 x y) mask) => (VPAVGWMasked128 x y mask)
(VMOVDQU16Masked256 (VPAVGW256 x y) mask) => (VPAVGWMasked256 x y mask)
(VMOVDQU16Masked512 (VPAVGW512 x y) mask) => (VPAVGWMasked512 x y mask)
(VMOVDQU32Masked128 (VBROADCASTSS128 x) mask) => (VBROADCASTSSMasked128 x mask)
(VMOVDQU64Masked128 (VPBROADCASTQ128 x) mask) => (VPBROADCASTQMasked128 x mask)
(VMOVDQU8Masked128 (VPBROADCASTB128 x) mask) => (VPBROADCASTBMasked128 x mask)
(VMOVDQU16Masked128 (VPBROADCASTW128 x) mask) => (VPBROADCASTWMasked128 x mask)
(VMOVDQU32Masked128 (VPBROADCASTD128 x) mask) => (VPBROADCASTDMasked128 x mask)
(VMOVDQU32Masked256 (VBROADCASTSS256 x) mask) => (VBROADCASTSSMasked256 x mask)
(VMOVDQU32Masked128 (VBROADCASTSS128 x) mask) => (VBROADCASTSSMasked128 x mask)
(VMOVDQU64Masked256 (VBROADCASTSD256 x) mask) => (VBROADCASTSDMasked256 x mask)
(VMOVDQU8Masked256 (VPBROADCASTB256 x) mask) => (VPBROADCASTBMasked256 x mask)
(VMOVDQU16Masked256 (VPBROADCASTW256 x) mask) => (VPBROADCASTWMasked256 x mask)
(VMOVDQU32Masked256 (VPBROADCASTD256 x) mask) => (VPBROADCASTDMasked256 x mask)
(VMOVDQU32Masked128 (VPBROADCASTD128 x) mask) => (VPBROADCASTDMasked128 x mask)
(VMOVDQU64Masked256 (VPBROADCASTQ256 x) mask) => (VPBROADCASTQMasked256 x mask)
(VMOVDQU32Masked512 (VBROADCASTSS512 x) mask) => (VBROADCASTSSMasked512 x mask)
(VMOVDQU32Masked256 (VBROADCASTSS256 x) mask) => (VBROADCASTSSMasked256 x mask)
(VMOVDQU64Masked512 (VBROADCASTSD512 x) mask) => (VBROADCASTSDMasked512 x mask)
(VMOVDQU8Masked512 (VPBROADCASTB512 x) mask) => (VPBROADCASTBMasked512 x mask)
(VMOVDQU16Masked512 (VPBROADCASTW512 x) mask) => (VPBROADCASTWMasked512 x mask)
(VMOVDQU32Masked512 (VPBROADCASTD512 x) mask) => (VPBROADCASTDMasked512 x mask)
(VMOVDQU16Masked128 (VPBROADCASTW128 x) mask) => (VPBROADCASTWMasked128 x mask)
(VMOVDQU32Masked256 (VPBROADCASTD256 x) mask) => (VPBROADCASTDMasked256 x mask)
(VMOVDQU64Masked512 (VPBROADCASTQ512 x) mask) => (VPBROADCASTQMasked512 x mask)
(VMOVDQU32Masked512 (VBROADCASTSS512 x) mask) => (VBROADCASTSSMasked512 x mask)
(VMOVDQU8Masked128 (VPBROADCASTB128 x) mask) => (VPBROADCASTBMasked128 x mask)
(VMOVDQU16Masked256 (VPBROADCASTW256 x) mask) => (VPBROADCASTWMasked256 x mask)
(VMOVDQU32Masked512 (VPBROADCASTD512 x) mask) => (VPBROADCASTDMasked512 x mask)
(VMOVDQU8Masked256 (VPBROADCASTB256 x) mask) => (VPBROADCASTBMasked256 x mask)
(VMOVDQU16Masked512 (VPBROADCASTW512 x) mask) => (VPBROADCASTWMasked512 x mask)
(VMOVDQU8Masked512 (VPBROADCASTB512 x) mask) => (VPBROADCASTBMasked512 x mask)
(VMOVDQU32Masked128 (VRNDSCALEPS128 [a] x) mask) => (VRNDSCALEPSMasked128 [a] x mask)
(VMOVDQU32Masked256 (VRNDSCALEPS256 [a] x) mask) => (VRNDSCALEPSMasked256 [a] x mask)
(VMOVDQU32Masked512 (VRNDSCALEPS512 [a] x) mask) => (VRNDSCALEPSMasked512 [a] x mask)
@@ -1547,12 +1535,6 @@
(VMOVDQU16Masked128 (VPMADDUBSW128 x y) mask) => (VPMADDUBSWMasked128 x y mask)
(VMOVDQU16Masked256 (VPMADDUBSW256 x y) mask) => (VPMADDUBSWMasked256 x y mask)
(VMOVDQU16Masked512 (VPMADDUBSW512 x y) mask) => (VPMADDUBSWMasked512 x y mask)
(VMOVDQU32Masked128 (VPDPBUSD128 x y z) mask) => (VPDPBUSDMasked128 x y z mask)
(VMOVDQU32Masked256 (VPDPBUSD256 x y z) mask) => (VPDPBUSDMasked256 x y z mask)
(VMOVDQU32Masked512 (VPDPBUSD512 x y z) mask) => (VPDPBUSDMasked512 x y z mask)
(VMOVDQU32Masked128 (VPDPBUSDS128 x y z) mask) => (VPDPBUSDSMasked128 x y z mask)
(VMOVDQU32Masked256 (VPDPBUSDS256 x y z) mask) => (VPDPBUSDSMasked256 x y z mask)
(VMOVDQU32Masked512 (VPDPBUSDS512 x y z) mask) => (VPDPBUSDSMasked512 x y z mask)
(VMOVDQU8Masked128 (VPMOVSXBQ128 x) mask) => (VPMOVSXBQMasked128 x mask)
(VMOVDQU16Masked128 (VPMOVSXWQ128 x) mask) => (VPMOVSXWQMasked128 x mask)
(VMOVDQU32Masked128 (VPMOVSXDQ128 x) mask) => (VPMOVSXDQMasked128 x mask)
@@ -1775,9 +1757,9 @@
(VMOVDQU64Masked128 (VPMOVSQB128_128 x) mask) => (VPMOVSQBMasked128_128 x mask)
(VMOVDQU64Masked256 (VPMOVSQB128_256 x) mask) => (VPMOVSQBMasked128_256 x mask)
(VMOVDQU64Masked512 (VPMOVSQB128_512 x) mask) => (VPMOVSQBMasked128_512 x mask)
(VMOVDQU32Masked128 (VPACKSSDW128 x y) mask) => (VPACKSSDWMasked128 x y mask)
(VMOVDQU32Masked256 (VPACKSSDW256 x y) mask) => (VPACKSSDWMasked256 x y mask)
(VMOVDQU32Masked512 (VPACKSSDW512 x y) mask) => (VPACKSSDWMasked512 x y mask)
(VMOVDQU32Masked128 (VPACKSSDW128 x y) mask) => (VPACKSSDWMasked128 x y mask)
(VMOVDQU32Masked128 (VPMOVSDW128_128 x) mask) => (VPMOVSDWMasked128_128 x mask)
(VMOVDQU32Masked256 (VPMOVSDW128_256 x) mask) => (VPMOVSDWMasked128_256 x mask)
(VMOVDQU32Masked256 (VPMOVSDW256 x) mask) => (VPMOVSDWMasked256 x mask)
@@ -1787,10 +1769,18 @@
(VMOVDQU64Masked128 (VPMOVSQD128_128 x) mask) => (VPMOVSQDMasked128_128 x mask)
(VMOVDQU64Masked256 (VPMOVSQD128_256 x) mask) => (VPMOVSQDMasked128_256 x mask)
(VMOVDQU64Masked256 (VPMOVSQD256 x) mask) => (VPMOVSQDMasked256 x mask)
(VMOVDQU16Masked128 (VPMOVUSWB128_128 x) mask) => (VPMOVUSWBMasked128_128 x mask)
(VMOVDQU16Masked256 (VPMOVUSWB128_256 x) mask) => (VPMOVUSWBMasked128_256 x mask)
(VMOVDQU16Masked256 (VPMOVUSWB256 x) mask) => (VPMOVUSWBMasked256 x mask)
(VMOVDQU32Masked128 (VPACKUSDW128 x y) mask) => (VPACKUSDWMasked128 x y mask)
(VMOVDQU32Masked128 (VPMOVUSDB128_128 x) mask) => (VPMOVUSDBMasked128_128 x mask)
(VMOVDQU32Masked256 (VPMOVUSDB128_256 x) mask) => (VPMOVUSDBMasked128_256 x mask)
(VMOVDQU32Masked512 (VPMOVUSDB128_512 x) mask) => (VPMOVUSDBMasked128_512 x mask)
(VMOVDQU64Masked128 (VPMOVUSQB128_128 x) mask) => (VPMOVUSQBMasked128_128 x mask)
(VMOVDQU64Masked256 (VPMOVUSQB128_256 x) mask) => (VPMOVUSQBMasked128_256 x mask)
(VMOVDQU64Masked512 (VPMOVUSQB128_512 x) mask) => (VPMOVUSQBMasked128_512 x mask)
(VMOVDQU32Masked256 (VPACKUSDW256 x y) mask) => (VPACKUSDWMasked256 x y mask)
(VMOVDQU32Masked512 (VPACKUSDW512 x y) mask) => (VPACKUSDWMasked512 x y mask)
(VMOVDQU32Masked128 (VPACKUSDW128 x y) mask) => (VPACKUSDWMasked128 x y mask)
(VMOVDQU32Masked128 (VPMOVUSDW128_128 x) mask) => (VPMOVUSDWMasked128_128 x mask)
(VMOVDQU32Masked256 (VPMOVUSDW128_256 x) mask) => (VPMOVUSDWMasked128_256 x mask)
(VMOVDQU32Masked256 (VPMOVUSDW256 x) mask) => (VPMOVUSDWMasked256 x mask)
@@ -2018,6 +2008,7 @@
(VPBLENDMDMasked512 dst (VPMOVDW256 x) mask) => (VPMOVDWMasked256Merging dst x mask)
(VPBLENDMDMasked512 dst (VPMOVSDB128_512 x) mask) => (VPMOVSDBMasked128_512Merging dst x mask)
(VPBLENDMDMasked512 dst (VPMOVSDW256 x) mask) => (VPMOVSDWMasked256Merging dst x mask)
(VPBLENDMDMasked512 dst (VPMOVUSDB128_512 x) mask) => (VPMOVUSDBMasked128_512Merging dst x mask)
(VPBLENDMDMasked512 dst (VPMOVUSDW256 x) mask) => (VPMOVUSDWMasked256Merging dst x mask)
(VPBLENDMDMasked512 dst (VPMULLD512 x y) mask) => (VPMULLDMasked512Merging dst x y mask)
(VPBLENDMDMasked512 dst (VPOPCNTD512 x) mask) => (VPOPCNTDMasked512Merging dst x mask)
@@ -2071,6 +2062,7 @@
(VPBLENDMQMasked512 dst (VPMOVSQB128_512 x) mask) => (VPMOVSQBMasked128_512Merging dst x mask)
(VPBLENDMQMasked512 dst (VPMOVSQD256 x) mask) => (VPMOVSQDMasked256Merging dst x mask)
(VPBLENDMQMasked512 dst (VPMOVSQW128_512 x) mask) => (VPMOVSQWMasked128_512Merging dst x mask)
(VPBLENDMQMasked512 dst (VPMOVUSQB128_512 x) mask) => (VPMOVUSQBMasked128_512Merging dst x mask)
(VPBLENDMQMasked512 dst (VPMOVUSQD256 x) mask) => (VPMOVUSQDMasked256Merging dst x mask)
(VPBLENDMQMasked512 dst (VPMOVUSQW128_512 x) mask) => (VPMOVUSQWMasked128_512Merging dst x mask)
(VPBLENDMQMasked512 dst (VPMULLQ512 x y) mask) => (VPMULLQMasked512Merging dst x y mask)
@@ -2235,9 +2227,12 @@
(VPBLENDVB128 dst (VPMOVSXWQ128 x) mask) && v.Block.CPUfeatures.hasFeature(CPUavx512) => (VPMOVSXWQMasked128Merging dst x (VPMOVVec16x8ToM <types.TypeMask> mask))
(VPBLENDVB128 dst (VPMOVSXWQ256 x) mask) && v.Block.CPUfeatures.hasFeature(CPUavx512) => (VPMOVSXWQMasked256Merging dst x (VPMOVVec16x8ToM <types.TypeMask> mask))
(VPBLENDVB128 dst (VPMOVSXWQ512 x) mask) && v.Block.CPUfeatures.hasFeature(CPUavx512) => (VPMOVSXWQMasked512Merging dst x (VPMOVVec16x8ToM <types.TypeMask> mask))
(VPBLENDVB128 dst (VPMOVUSDB128_128 x) mask) && v.Block.CPUfeatures.hasFeature(CPUavx512) => (VPMOVUSDBMasked128_128Merging dst x (VPMOVVec32x4ToM <types.TypeMask> mask))
(VPBLENDVB128 dst (VPMOVUSDW128_128 x) mask) && v.Block.CPUfeatures.hasFeature(CPUavx512) => (VPMOVUSDWMasked128_128Merging dst x (VPMOVVec32x4ToM <types.TypeMask> mask))
(VPBLENDVB128 dst (VPMOVUSQB128_128 x) mask) && v.Block.CPUfeatures.hasFeature(CPUavx512) => (VPMOVUSQBMasked128_128Merging dst x (VPMOVVec64x2ToM <types.TypeMask> mask))
(VPBLENDVB128 dst (VPMOVUSQD128_128 x) mask) && v.Block.CPUfeatures.hasFeature(CPUavx512) => (VPMOVUSQDMasked128_128Merging dst x (VPMOVVec64x2ToM <types.TypeMask> mask))
(VPBLENDVB128 dst (VPMOVUSQW128_128 x) mask) && v.Block.CPUfeatures.hasFeature(CPUavx512) => (VPMOVUSQWMasked128_128Merging dst x (VPMOVVec64x2ToM <types.TypeMask> mask))
(VPBLENDVB128 dst (VPMOVUSWB128_128 x) mask) && v.Block.CPUfeatures.hasFeature(CPUavx512) => (VPMOVUSWBMasked128_128Merging dst x (VPMOVVec16x8ToM <types.TypeMask> mask))
(VPBLENDVB128 dst (VPMOVWB128_128 x) mask) && v.Block.CPUfeatures.hasFeature(CPUavx512) => (VPMOVWBMasked128_128Merging dst x (VPMOVVec16x8ToM <types.TypeMask> mask))
(VPBLENDVB128 dst (VPMOVZXBD128 x) mask) && v.Block.CPUfeatures.hasFeature(CPUavx512) => (VPMOVZXBDMasked128Merging dst x (VPMOVVec8x16ToM <types.TypeMask> mask))
(VPBLENDVB128 dst (VPMOVZXBD256 x) mask) && v.Block.CPUfeatures.hasFeature(CPUavx512) => (VPMOVZXBDMasked256Merging dst x (VPMOVVec8x16ToM <types.TypeMask> mask))
@@ -2396,9 +2391,12 @@
(VPBLENDVB256 dst (VPMOVSXBW512 x) mask) && v.Block.CPUfeatures.hasFeature(CPUavx512) => (VPMOVSXBWMasked512Merging dst x (VPMOVVec8x32ToM <types.TypeMask> mask))
(VPBLENDVB256 dst (VPMOVSXDQ512 x) mask) && v.Block.CPUfeatures.hasFeature(CPUavx512) => (VPMOVSXDQMasked512Merging dst x (VPMOVVec32x8ToM <types.TypeMask> mask))
(VPBLENDVB256 dst (VPMOVSXWD512 x) mask) && v.Block.CPUfeatures.hasFeature(CPUavx512) => (VPMOVSXWDMasked512Merging dst x (VPMOVVec16x16ToM <types.TypeMask> mask))
(VPBLENDVB256 dst (VPMOVUSDB128_256 x) mask) && v.Block.CPUfeatures.hasFeature(CPUavx512) => (VPMOVUSDBMasked128_256Merging dst x (VPMOVVec32x8ToM <types.TypeMask> mask))
(VPBLENDVB256 dst (VPMOVUSDW128_256 x) mask) && v.Block.CPUfeatures.hasFeature(CPUavx512) => (VPMOVUSDWMasked128_256Merging dst x (VPMOVVec32x8ToM <types.TypeMask> mask))
(VPBLENDVB256 dst (VPMOVUSQB128_256 x) mask) && v.Block.CPUfeatures.hasFeature(CPUavx512) => (VPMOVUSQBMasked128_256Merging dst x (VPMOVVec64x4ToM <types.TypeMask> mask))
(VPBLENDVB256 dst (VPMOVUSQD128_256 x) mask) && v.Block.CPUfeatures.hasFeature(CPUavx512) => (VPMOVUSQDMasked128_256Merging dst x (VPMOVVec64x4ToM <types.TypeMask> mask))
(VPBLENDVB256 dst (VPMOVUSQW128_256 x) mask) && v.Block.CPUfeatures.hasFeature(CPUavx512) => (VPMOVUSQWMasked128_256Merging dst x (VPMOVVec64x4ToM <types.TypeMask> mask))
(VPBLENDVB256 dst (VPMOVUSWB128_256 x) mask) && v.Block.CPUfeatures.hasFeature(CPUavx512) => (VPMOVUSWBMasked128_256Merging dst x (VPMOVVec16x16ToM <types.TypeMask> mask))
(VPBLENDVB256 dst (VPMOVWB128_256 x) mask) && v.Block.CPUfeatures.hasFeature(CPUavx512) => (VPMOVWBMasked128_256Merging dst x (VPMOVVec16x16ToM <types.TypeMask> mask))
(VPBLENDVB256 dst (VPMOVZXBW512 x) mask) && v.Block.CPUfeatures.hasFeature(CPUavx512) => (VPMOVZXBWMasked512Merging dst x (VPMOVVec8x32ToM <types.TypeMask> mask))
(VPBLENDVB256 dst (VPMOVZXDQ512 x) mask) && v.Block.CPUfeatures.hasFeature(CPUavx512) => (VPMOVZXDQMasked512Merging dst x (VPMOVVec32x8ToM <types.TypeMask> mask))
@@ -2511,30 +2509,30 @@
(VPANDNQMasked128 x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPANDNQMasked128load {sym} [off] x ptr mask mem)
(VPANDNQMasked256 x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPANDNQMasked256load {sym} [off] x ptr mask mem)
(VPANDNQMasked512 x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPANDNQMasked512load {sym} [off] x ptr mask mem)
(VRNDSCALEPS128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VRNDSCALEPS128load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VRNDSCALEPS256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VRNDSCALEPS256load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VRNDSCALEPS512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VRNDSCALEPS512load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VRNDSCALEPD128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VRNDSCALEPD128load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VRNDSCALEPD256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VRNDSCALEPD256load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VRNDSCALEPD512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VRNDSCALEPD512load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VRNDSCALEPSMasked128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VRNDSCALEPSMasked128load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VRNDSCALEPSMasked256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VRNDSCALEPSMasked256load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VRNDSCALEPSMasked512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VRNDSCALEPSMasked512load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VRNDSCALEPDMasked128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VRNDSCALEPDMasked128load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VRNDSCALEPDMasked256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VRNDSCALEPDMasked256load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VRNDSCALEPDMasked512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VRNDSCALEPDMasked512load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VREDUCEPS128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VREDUCEPS128load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VREDUCEPS256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VREDUCEPS256load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VREDUCEPS512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VREDUCEPS512load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VREDUCEPD128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VREDUCEPD128load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VREDUCEPD256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VREDUCEPD256load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VREDUCEPD512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VREDUCEPD512load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VREDUCEPSMasked128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VREDUCEPSMasked128load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VREDUCEPSMasked256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VREDUCEPSMasked256load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VREDUCEPSMasked512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VREDUCEPSMasked512load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VREDUCEPDMasked128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VREDUCEPDMasked128load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VREDUCEPDMasked256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VREDUCEPDMasked256load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VREDUCEPDMasked512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VREDUCEPDMasked512load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VRNDSCALEPS128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VRNDSCALEPS128load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VRNDSCALEPS256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VRNDSCALEPS256load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VRNDSCALEPS512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VRNDSCALEPS512load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VRNDSCALEPD128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VRNDSCALEPD128load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VRNDSCALEPD256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VRNDSCALEPD256load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VRNDSCALEPD512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VRNDSCALEPD512load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VRNDSCALEPSMasked128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VRNDSCALEPSMasked128load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VRNDSCALEPSMasked256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VRNDSCALEPSMasked256load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VRNDSCALEPSMasked512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VRNDSCALEPSMasked512load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VRNDSCALEPDMasked128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VRNDSCALEPDMasked128load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VRNDSCALEPDMasked256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VRNDSCALEPDMasked256load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VRNDSCALEPDMasked512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VRNDSCALEPDMasked512load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VREDUCEPS128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VREDUCEPS128load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VREDUCEPS256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VREDUCEPS256load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VREDUCEPS512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VREDUCEPS512load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VREDUCEPD128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VREDUCEPD128load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VREDUCEPD256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VREDUCEPD256load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VREDUCEPD512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VREDUCEPD512load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VREDUCEPSMasked128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VREDUCEPSMasked128load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VREDUCEPSMasked256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VREDUCEPSMasked256load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VREDUCEPSMasked512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VREDUCEPSMasked512load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VREDUCEPDMasked128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VREDUCEPDMasked128load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VREDUCEPDMasked256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VREDUCEPDMasked256load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VREDUCEPDMasked512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VREDUCEPDMasked512load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPERMI2PS128 x y l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPERMI2PS128load {sym} [off] x y ptr mem)
(VPERMI2D128 x y l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPERMI2D128load {sym} [off] x y ptr mem)
(VPERMI2PS256 x y l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPERMI2PS256load {sym} [off] x y ptr mem)
@@ -2655,54 +2653,46 @@
(VDIVPDMasked128 x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VDIVPDMasked128load {sym} [off] x ptr mask mem)
(VDIVPDMasked256 x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VDIVPDMasked256load {sym} [off] x ptr mask mem)
(VDIVPDMasked512 x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VDIVPDMasked512load {sym} [off] x ptr mask mem)
(VPDPBUSD512 x y l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPDPBUSD512load {sym} [off] x y ptr mem)
(VPDPBUSDMasked128 x y l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPDPBUSDMasked128load {sym} [off] x y ptr mask mem)
(VPDPBUSDMasked256 x y l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPDPBUSDMasked256load {sym} [off] x y ptr mask mem)
(VPDPBUSDMasked512 x y l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPDPBUSDMasked512load {sym} [off] x y ptr mask mem)
(VPDPBUSDS512 x y l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPDPBUSDS512load {sym} [off] x y ptr mem)
(VPDPBUSDSMasked128 x y l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPDPBUSDSMasked128load {sym} [off] x y ptr mask mem)
(VPDPBUSDSMasked256 x y l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPDPBUSDSMasked256load {sym} [off] x y ptr mask mem)
(VPDPBUSDSMasked512 x y l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPDPBUSDSMasked512load {sym} [off] x y ptr mask mem)
(VPCMPEQD512 x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPCMPEQD512load {sym} [off] x ptr mem)
(VPCMPEQQ512 x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPCMPEQQ512load {sym} [off] x ptr mem)
(VCMPPS512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VCMPPS512load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mem)
(VCMPPD512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VCMPPD512load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mem)
(VCMPPSMasked128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VCMPPSMasked128load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VCMPPSMasked256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VCMPPSMasked256load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VCMPPSMasked512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VCMPPSMasked512load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VCMPPDMasked128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VCMPPDMasked128load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VCMPPDMasked256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VCMPPDMasked256load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VCMPPDMasked512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VCMPPDMasked512load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VPCMPDMasked128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPCMPDMasked128load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VPCMPDMasked256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPCMPDMasked256load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VPCMPDMasked512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPCMPDMasked512load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VPCMPQMasked128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPCMPQMasked128load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VPCMPQMasked256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPCMPQMasked256load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VPCMPQMasked512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPCMPQMasked512load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VPCMPUDMasked128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPCMPUDMasked128load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VPCMPUDMasked256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPCMPUDMasked256load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VPCMPUDMasked512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPCMPUDMasked512load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VPCMPUQMasked128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPCMPUQMasked128load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VPCMPUQMasked256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPCMPUQMasked256load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VPCMPUQMasked512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPCMPUQMasked512load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VGF2P8AFFINEQB128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VGF2P8AFFINEQB128load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mem)
(VGF2P8AFFINEQB256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VGF2P8AFFINEQB256load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mem)
(VGF2P8AFFINEQB512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VGF2P8AFFINEQB512load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mem)
(VGF2P8AFFINEINVQB128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VGF2P8AFFINEINVQB128load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mem)
(VGF2P8AFFINEINVQB256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VGF2P8AFFINEINVQB256load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mem)
(VGF2P8AFFINEINVQB512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VGF2P8AFFINEINVQB512load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mem)
(VGF2P8AFFINEINVQBMasked128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VGF2P8AFFINEINVQBMasked128load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VGF2P8AFFINEINVQBMasked256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VGF2P8AFFINEINVQBMasked256load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VGF2P8AFFINEINVQBMasked512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VGF2P8AFFINEINVQBMasked512load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VGF2P8AFFINEQBMasked128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VGF2P8AFFINEQBMasked128load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VGF2P8AFFINEQBMasked256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VGF2P8AFFINEQBMasked256load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VGF2P8AFFINEQBMasked512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VGF2P8AFFINEQBMasked512load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VCMPPS512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VCMPPS512load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mem)
(VCMPPD512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VCMPPD512load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mem)
(VCMPPSMasked128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VCMPPSMasked128load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VCMPPSMasked256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VCMPPSMasked256load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VCMPPSMasked512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VCMPPSMasked512load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VCMPPDMasked128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VCMPPDMasked128load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VCMPPDMasked256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VCMPPDMasked256load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VCMPPDMasked512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VCMPPDMasked512load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VPCMPDMasked128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPCMPDMasked128load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VPCMPDMasked256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPCMPDMasked256load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VPCMPDMasked512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPCMPDMasked512load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VPCMPQMasked128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPCMPQMasked128load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VPCMPQMasked256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPCMPQMasked256load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VPCMPQMasked512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPCMPQMasked512load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VPCMPUDMasked128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPCMPUDMasked128load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VPCMPUDMasked256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPCMPUDMasked256load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VPCMPUDMasked512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPCMPUDMasked512load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VPCMPUQMasked128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPCMPUQMasked128load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VPCMPUQMasked256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPCMPUQMasked256load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VPCMPUQMasked512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPCMPUQMasked512load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VGF2P8AFFINEQB128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VGF2P8AFFINEQB128load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mem)
(VGF2P8AFFINEQB256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VGF2P8AFFINEQB256load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mem)
(VGF2P8AFFINEQB512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VGF2P8AFFINEQB512load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mem)
(VGF2P8AFFINEINVQB128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VGF2P8AFFINEINVQB128load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mem)
(VGF2P8AFFINEINVQB256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VGF2P8AFFINEINVQB256load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mem)
(VGF2P8AFFINEINVQB512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VGF2P8AFFINEINVQB512load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mem)
(VGF2P8AFFINEINVQBMasked128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VGF2P8AFFINEINVQBMasked128load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VGF2P8AFFINEINVQBMasked256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VGF2P8AFFINEINVQBMasked256load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VGF2P8AFFINEINVQBMasked512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VGF2P8AFFINEINVQBMasked512load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VGF2P8AFFINEQBMasked128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VGF2P8AFFINEQBMasked128load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VGF2P8AFFINEQBMasked256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VGF2P8AFFINEQBMasked256load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VGF2P8AFFINEQBMasked512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VGF2P8AFFINEQBMasked512load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VPCMPGTD512 x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPCMPGTD512load {sym} [off] x ptr mem)
(VPCMPGTQ512 x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPCMPGTQ512load {sym} [off] x ptr mem)
(VPCMPUD512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPCMPUD512load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mem)
(VPCMPUQ512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPCMPUQ512load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mem)
(VPCMPD512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPCMPD512load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mem)
(VPCMPQ512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPCMPQ512load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mem)
(VPCMPUD512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPCMPUD512load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mem)
(VPCMPUQ512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPCMPUQ512load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mem)
(VPCMPD512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPCMPD512load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mem)
(VPCMPQ512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPCMPQ512load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mem)
(VPUNPCKHDQ512 x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPUNPCKHDQ512load {sym} [off] x ptr mem)
(VPUNPCKHQDQ512 x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPUNPCKHQDQ512load {sym} [off] x ptr mem)
(VPUNPCKLDQ512 x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPUNPCKLDQ512load {sym} [off] x ptr mem)
@@ -2781,11 +2771,7 @@
(VPMULLQ128 x l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPMULLQ128load {sym} [off] x ptr mem)
(VPMULLQ256 x l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPMULLQ256load {sym} [off] x ptr mem)
(VPMULLQ512 x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPMULLQ512load {sym} [off] x ptr mem)
(VFMADD213PS128 x y l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VFMADD213PS128load {sym} [off] x y ptr mem)
(VFMADD213PS256 x y l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VFMADD213PS256load {sym} [off] x y ptr mem)
(VFMADD213PS512 x y l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VFMADD213PS512load {sym} [off] x y ptr mem)
(VFMADD213PD128 x y l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VFMADD213PD128load {sym} [off] x y ptr mem)
(VFMADD213PD256 x y l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VFMADD213PD256load {sym} [off] x y ptr mem)
(VFMADD213PD512 x y l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VFMADD213PD512load {sym} [off] x y ptr mem)
(VFMADD213PSMasked128 x y l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VFMADD213PSMasked128load {sym} [off] x y ptr mask mem)
(VFMADD213PSMasked256 x y l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VFMADD213PSMasked256load {sym} [off] x y ptr mask mem)
@@ -2793,11 +2779,7 @@
(VFMADD213PDMasked128 x y l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VFMADD213PDMasked128load {sym} [off] x y ptr mask mem)
(VFMADD213PDMasked256 x y l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VFMADD213PDMasked256load {sym} [off] x y ptr mask mem)
(VFMADD213PDMasked512 x y l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VFMADD213PDMasked512load {sym} [off] x y ptr mask mem)
(VFMADDSUB213PS128 x y l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VFMADDSUB213PS128load {sym} [off] x y ptr mem)
(VFMADDSUB213PS256 x y l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VFMADDSUB213PS256load {sym} [off] x y ptr mem)
(VFMADDSUB213PS512 x y l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VFMADDSUB213PS512load {sym} [off] x y ptr mem)
(VFMADDSUB213PD128 x y l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VFMADDSUB213PD128load {sym} [off] x y ptr mem)
(VFMADDSUB213PD256 x y l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VFMADDSUB213PD256load {sym} [off] x y ptr mem)
(VFMADDSUB213PD512 x y l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VFMADDSUB213PD512load {sym} [off] x y ptr mem)
(VFMADDSUB213PSMasked128 x y l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VFMADDSUB213PSMasked128load {sym} [off] x y ptr mask mem)
(VFMADDSUB213PSMasked256 x y l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VFMADDSUB213PSMasked256load {sym} [off] x y ptr mask mem)
@@ -2817,11 +2799,7 @@
(VPMULLQMasked128 x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPMULLQMasked128load {sym} [off] x ptr mask mem)
(VPMULLQMasked256 x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPMULLQMasked256load {sym} [off] x ptr mask mem)
(VPMULLQMasked512 x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPMULLQMasked512load {sym} [off] x ptr mask mem)
(VFMSUBADD213PS128 x y l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VFMSUBADD213PS128load {sym} [off] x y ptr mem)
(VFMSUBADD213PS256 x y l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VFMSUBADD213PS256load {sym} [off] x y ptr mem)
(VFMSUBADD213PS512 x y l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VFMSUBADD213PS512load {sym} [off] x y ptr mem)
(VFMSUBADD213PD128 x y l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VFMSUBADD213PD128load {sym} [off] x y ptr mem)
(VFMSUBADD213PD256 x y l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VFMSUBADD213PD256load {sym} [off] x y ptr mem)
(VFMSUBADD213PD512 x y l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VFMSUBADD213PD512load {sym} [off] x y ptr mem)
(VFMSUBADD213PSMasked128 x y l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VFMSUBADD213PSMasked128load {sym} [off] x y ptr mask mem)
(VFMSUBADD213PSMasked256 x y l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VFMSUBADD213PSMasked256load {sym} [off] x y ptr mask mem)
@@ -2883,30 +2861,30 @@
(VRSQRT14PDMasked128 l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VRSQRT14PDMasked128load {sym} [off] ptr mask mem)
(VRSQRT14PDMasked256 l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VRSQRT14PDMasked256load {sym} [off] ptr mask mem)
(VRSQRT14PDMasked512 l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VRSQRT14PDMasked512load {sym} [off] ptr mask mem)
(VPROLD128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPROLD128load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VPROLD256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPROLD256load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VPROLD512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPROLD512load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VPROLQ128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPROLQ128load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VPROLQ256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPROLQ256load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VPROLQ512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPROLQ512load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VPROLDMasked128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPROLDMasked128load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPROLDMasked256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPROLDMasked256load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPROLDMasked512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPROLDMasked512load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPROLQMasked128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPROLQMasked128load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPROLQMasked256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPROLQMasked256load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPROLQMasked512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPROLQMasked512load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPRORD128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPRORD128load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VPRORD256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPRORD256load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VPRORD512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPRORD512load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VPRORQ128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPRORQ128load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VPRORQ256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPRORQ256load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VPRORQ512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPRORQ512load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VPRORDMasked128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPRORDMasked128load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPRORDMasked256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPRORDMasked256load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPRORDMasked512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPRORDMasked512load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPRORQMasked128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPRORQMasked128load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPRORQMasked256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPRORQMasked256load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPRORQMasked512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPRORQMasked512load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPROLD128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPROLD128load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VPROLD256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPROLD256load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VPROLD512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPROLD512load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VPROLQ128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPROLQ128load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VPROLQ256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPROLQ256load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VPROLQ512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPROLQ512load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VPROLDMasked128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPROLDMasked128load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPROLDMasked256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPROLDMasked256load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPROLDMasked512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPROLDMasked512load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPROLQMasked128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPROLQMasked128load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPROLQMasked256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPROLQMasked256load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPROLQMasked512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPROLQMasked512load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPRORD128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPRORD128load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VPRORD256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPRORD256load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VPRORD512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPRORD512load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VPRORQ128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPRORQ128load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VPRORQ256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPRORQ256load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VPRORQ512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPRORQ512load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VPRORDMasked128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPRORDMasked128load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPRORDMasked256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPRORDMasked256load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPRORDMasked512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPRORDMasked512load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPRORQMasked128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPRORQMasked128load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPRORQMasked256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPRORQMasked256load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPRORQMasked512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPRORQMasked512load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPROLVD128 x l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPROLVD128load {sym} [off] x ptr mem)
(VPROLVD256 x l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPROLVD256load {sym} [off] x ptr mem)
(VPROLVD512 x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPROLVD512load {sym} [off] x ptr mem)
@@ -2932,13 +2910,13 @@
(VPRORVQMasked256 x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPRORVQMasked256load {sym} [off] x ptr mask mem)
(VPRORVQMasked512 x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPRORVQMasked512load {sym} [off] x ptr mask mem)
(VPACKSSDW512 x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPACKSSDW512load {sym} [off] x ptr mem)
(VPACKSSDWMasked128 x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPACKSSDWMasked128load {sym} [off] x ptr mask mem)
(VPACKSSDWMasked256 x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPACKSSDWMasked256load {sym} [off] x ptr mask mem)
(VPACKSSDWMasked512 x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPACKSSDWMasked512load {sym} [off] x ptr mask mem)
(VPACKSSDWMasked128 x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPACKSSDWMasked128load {sym} [off] x ptr mask mem)
(VPACKUSDW512 x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPACKUSDW512load {sym} [off] x ptr mem)
(VPACKUSDWMasked128 x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPACKUSDWMasked128load {sym} [off] x ptr mask mem)
(VPACKUSDWMasked256 x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPACKUSDWMasked256load {sym} [off] x ptr mask mem)
(VPACKUSDWMasked512 x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPACKUSDWMasked512load {sym} [off] x ptr mask mem)
(VPACKUSDWMasked128 x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPACKUSDWMasked128load {sym} [off] x ptr mask mem)
(VSCALEFPS128 x l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VSCALEFPS128load {sym} [off] x ptr mem)
(VSCALEFPS256 x l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VSCALEFPS256load {sym} [off] x ptr mem)
(VSCALEFPS512 x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VSCALEFPS512load {sym} [off] x ptr mem)
@@ -2951,30 +2929,30 @@
(VSCALEFPDMasked128 x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VSCALEFPDMasked128load {sym} [off] x ptr mask mem)
(VSCALEFPDMasked256 x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VSCALEFPDMasked256load {sym} [off] x ptr mask mem)
(VSCALEFPDMasked512 x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VSCALEFPDMasked512load {sym} [off] x ptr mask mem)
(VPSHLDD128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSHLDD128load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mem)
(VPSHLDD256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSHLDD256load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mem)
(VPSHLDD512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSHLDD512load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mem)
(VPSHLDQ128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSHLDQ128load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mem)
(VPSHLDQ256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSHLDQ256load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mem)
(VPSHLDQ512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSHLDQ512load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mem)
(VPSHLDDMasked128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHLDDMasked128load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VPSHLDDMasked256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHLDDMasked256load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VPSHLDDMasked512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHLDDMasked512load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VPSHLDQMasked128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHLDQMasked128load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VPSHLDQMasked256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHLDQMasked256load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VPSHLDQMasked512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHLDQMasked512load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VPSHRDD128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSHRDD128load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mem)
(VPSHRDD256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSHRDD256load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mem)
(VPSHRDD512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSHRDD512load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mem)
(VPSHRDQ128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSHRDQ128load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mem)
(VPSHRDQ256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSHRDQ256load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mem)
(VPSHRDQ512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSHRDQ512load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mem)
(VPSHRDDMasked128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHRDDMasked128load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VPSHRDDMasked256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHRDDMasked256load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VPSHRDDMasked512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHRDDMasked512load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VPSHRDQMasked128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHRDQMasked128load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VPSHRDQMasked256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHRDQMasked256load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VPSHRDQMasked512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHRDQMasked512load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mask mem)
(VPSHLDD128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSHLDD128load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mem)
(VPSHLDD256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSHLDD256load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mem)
(VPSHLDD512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSHLDD512load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mem)
(VPSHLDQ128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSHLDQ128load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mem)
(VPSHLDQ256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSHLDQ256load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mem)
(VPSHLDQ512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSHLDQ512load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mem)
(VPSHLDDMasked128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHLDDMasked128load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VPSHLDDMasked256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHLDDMasked256load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VPSHLDDMasked512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHLDDMasked512load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VPSHLDQMasked128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHLDQMasked128load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VPSHLDQMasked256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHLDQMasked256load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VPSHLDQMasked512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHLDQMasked512load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VPSHRDD128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSHRDD128load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mem)
(VPSHRDD256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSHRDD256load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mem)
(VPSHRDD512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSHRDD512load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mem)
(VPSHRDQ128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSHRDQ128load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mem)
(VPSHRDQ256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSHRDQ256load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mem)
(VPSHRDQ512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSHRDQ512load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mem)
(VPSHRDDMasked128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHRDDMasked128load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VPSHRDDMasked256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHRDDMasked256load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VPSHRDDMasked512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHRDDMasked512load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VPSHRDQMasked128 [c] x l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHRDQMasked128load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VPSHRDQMasked256 [c] x l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHRDQMasked256load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VPSHRDQMasked512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHRDQMasked512load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mask mem)
(VPSLLVD512 x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSLLVD512load {sym} [off] x ptr mem)
(VPSLLVQ512 x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSLLVQ512load {sym} [off] x ptr mem)
(VPSHLDVD128 x y l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSHLDVD128load {sym} [off] x y ptr mem)
@@ -3059,41 +3037,41 @@
(VPXORQMasked512 x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPXORQMasked512load {sym} [off] x ptr mask mem)
(VPBLENDMDMasked512 x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPBLENDMDMasked512load {sym} [off] x ptr mask mem)
(VPBLENDMQMasked512 x l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPBLENDMQMasked512load {sym} [off] x ptr mask mem)
(VSHUFPS512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VSHUFPS512load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mem)
(VSHUFPD512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VSHUFPD512load {sym} [makeValAndOff(int32(int8(c)),off)] x ptr mem)
(VPSHUFD512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSHUFD512load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VPSHUFDMasked256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHUFDMasked256load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPSHUFDMasked512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHUFDMasked512load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPSHUFDMasked128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHUFDMasked128load {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPSLLD512const [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSLLD512constload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VPSLLQ512const [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSLLQ512constload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VPSLLDMasked128const [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSLLDMasked128constload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPSLLDMasked256const [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSLLDMasked256constload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPSLLDMasked512const [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSLLDMasked512constload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPSLLQMasked128const [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSLLQMasked128constload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPSLLQMasked256const [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSLLQMasked256constload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPSLLQMasked512const [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSLLQMasked512constload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPSRLD512const [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSRLD512constload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VPSRLQ512const [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSRLQ512constload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VPSRAD512const [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSRAD512constload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VPSRAQ128const [c] l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSRAQ128constload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VPSRAQ256const [c] l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSRAQ256constload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VPSRAQ512const [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSRAQ512constload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mem)
(VPSRLDMasked128const [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSRLDMasked128constload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPSRLDMasked256const [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSRLDMasked256constload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPSRLDMasked512const [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSRLDMasked512constload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPSRLQMasked128const [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSRLQMasked128constload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPSRLQMasked256const [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSRLQMasked256constload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPSRLQMasked512const [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSRLQMasked512constload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPSRADMasked128const [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSRADMasked128constload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPSRADMasked256const [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSRADMasked256constload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPSRADMasked512const [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSRADMasked512constload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPSRAQMasked128const [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSRAQMasked128constload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPSRAQMasked256const [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSRAQMasked256constload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPSRAQMasked512const [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSRAQMasked512constload {sym} [makeValAndOff(int32(int8(c)),off)] ptr mask mem)
(VPTERNLOGD128 [c] x y l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPTERNLOGD128load {sym} [makeValAndOff(int32(int8(c)),off)] x y ptr mem)
(VPTERNLOGD256 [c] x y l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPTERNLOGD256load {sym} [makeValAndOff(int32(int8(c)),off)] x y ptr mem)
(VPTERNLOGD512 [c] x y l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPTERNLOGD512load {sym} [makeValAndOff(int32(int8(c)),off)] x y ptr mem)
(VPTERNLOGQ128 [c] x y l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPTERNLOGQ128load {sym} [makeValAndOff(int32(int8(c)),off)] x y ptr mem)
(VPTERNLOGQ256 [c] x y l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPTERNLOGQ256load {sym} [makeValAndOff(int32(int8(c)),off)] x y ptr mem)
(VPTERNLOGQ512 [c] x y l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPTERNLOGQ512load {sym} [makeValAndOff(int32(int8(c)),off)] x y ptr mem)
(VSHUFPS512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VSHUFPS512load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mem)
(VSHUFPD512 [c] x l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VSHUFPD512load {sym} [makeValAndOff(int32(uint8(c)),off)] x ptr mem)
(VPSHUFD512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSHUFD512load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VPSHUFDMasked256 [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHUFDMasked256load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPSHUFDMasked512 [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHUFDMasked512load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPSHUFDMasked128 [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSHUFDMasked128load {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPSLLD512const [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSLLD512constload {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VPSLLQ512const [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSLLQ512constload {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VPSLLDMasked128const [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSLLDMasked128constload {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPSLLDMasked256const [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSLLDMasked256constload {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPSLLDMasked512const [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSLLDMasked512constload {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPSLLQMasked128const [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSLLQMasked128constload {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPSLLQMasked256const [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSLLQMasked256constload {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPSLLQMasked512const [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSLLQMasked512constload {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPSRLD512const [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSRLD512constload {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VPSRLQ512const [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSRLQ512constload {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VPSRAD512const [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSRAD512constload {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VPSRAQ128const [c] l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSRAQ128constload {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VPSRAQ256const [c] l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSRAQ256constload {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VPSRAQ512const [c] l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPSRAQ512constload {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mem)
(VPSRLDMasked128const [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSRLDMasked128constload {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPSRLDMasked256const [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSRLDMasked256constload {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPSRLDMasked512const [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSRLDMasked512constload {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPSRLQMasked128const [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSRLQMasked128constload {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPSRLQMasked256const [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSRLQMasked256constload {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPSRLQMasked512const [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSRLQMasked512constload {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPSRADMasked128const [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSRADMasked128constload {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPSRADMasked256const [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSRADMasked256constload {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPSRADMasked512const [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSRADMasked512constload {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPSRAQMasked128const [c] l:(VMOVDQUload128 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSRAQMasked128constload {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPSRAQMasked256const [c] l:(VMOVDQUload256 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSRAQMasked256constload {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPSRAQMasked512const [c] l:(VMOVDQUload512 {sym} [off] ptr mem) mask) && canMergeLoad(v, l) && clobber(l) => (VPSRAQMasked512constload {sym} [makeValAndOff(int32(uint8(c)),off)] ptr mask mem)
(VPTERNLOGD128 [c] x y l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPTERNLOGD128load {sym} [makeValAndOff(int32(uint8(c)),off)] x y ptr mem)
(VPTERNLOGD256 [c] x y l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPTERNLOGD256load {sym} [makeValAndOff(int32(uint8(c)),off)] x y ptr mem)
(VPTERNLOGD512 [c] x y l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPTERNLOGD512load {sym} [makeValAndOff(int32(uint8(c)),off)] x y ptr mem)
(VPTERNLOGQ128 [c] x y l:(VMOVDQUload128 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPTERNLOGQ128load {sym} [makeValAndOff(int32(uint8(c)),off)] x y ptr mem)
(VPTERNLOGQ256 [c] x y l:(VMOVDQUload256 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPTERNLOGQ256load {sym} [makeValAndOff(int32(uint8(c)),off)] x y ptr mem)
(VPTERNLOGQ512 [c] x y l:(VMOVDQUload512 {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (VPTERNLOGQ512load {sym} [makeValAndOff(int32(uint8(c)),off)] x y ptr mem)

View File

@@ -1,4 +1,4 @@
// Code generated by x/arch/internal/simdgen using 'go run . -xedPath $XED_PATH -o godefs -goroot $GOROOT go.yaml types.yaml categories.yaml'; DO NOT EDIT.
// Code generated by 'simdgen -o godefs -goroot $GOROOT -xedPath $XED_PATH go.yaml types.yaml categories.yaml'; DO NOT EDIT.
package main
@@ -28,16 +28,16 @@ func simdAMD64Ops(v11, v21, v2k, vkv, v2kv, v2kk, v31, v3kv, vgpv, vgp, vfpv, vf
{name: "VADDSUBPS128", argLength: 2, reg: v21, asm: "VADDSUBPS", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VADDSUBPS256", argLength: 2, reg: v21, asm: "VADDSUBPS", commutative: false, typ: "Vec256", resultInArg0: false},
{name: "VAESDEC128", argLength: 2, reg: v21, asm: "VAESDEC", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VAESDEC256", argLength: 2, reg: w21, asm: "VAESDEC", commutative: false, typ: "Vec256", resultInArg0: false},
{name: "VAESDEC256", argLength: 2, reg: v21, asm: "VAESDEC", commutative: false, typ: "Vec256", resultInArg0: false},
{name: "VAESDEC512", argLength: 2, reg: w21, asm: "VAESDEC", commutative: false, typ: "Vec512", resultInArg0: false},
{name: "VAESDECLAST128", argLength: 2, reg: v21, asm: "VAESDECLAST", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VAESDECLAST256", argLength: 2, reg: w21, asm: "VAESDECLAST", commutative: false, typ: "Vec256", resultInArg0: false},
{name: "VAESDECLAST256", argLength: 2, reg: v21, asm: "VAESDECLAST", commutative: false, typ: "Vec256", resultInArg0: false},
{name: "VAESDECLAST512", argLength: 2, reg: w21, asm: "VAESDECLAST", commutative: false, typ: "Vec512", resultInArg0: false},
{name: "VAESENC128", argLength: 2, reg: v21, asm: "VAESENC", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VAESENC256", argLength: 2, reg: w21, asm: "VAESENC", commutative: false, typ: "Vec256", resultInArg0: false},
{name: "VAESENC256", argLength: 2, reg: v21, asm: "VAESENC", commutative: false, typ: "Vec256", resultInArg0: false},
{name: "VAESENC512", argLength: 2, reg: w21, asm: "VAESENC", commutative: false, typ: "Vec512", resultInArg0: false},
{name: "VAESENCLAST128", argLength: 2, reg: v21, asm: "VAESENCLAST", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VAESENCLAST256", argLength: 2, reg: w21, asm: "VAESENCLAST", commutative: false, typ: "Vec256", resultInArg0: false},
{name: "VAESENCLAST256", argLength: 2, reg: v21, asm: "VAESENCLAST", commutative: false, typ: "Vec256", resultInArg0: false},
{name: "VAESENCLAST512", argLength: 2, reg: w21, asm: "VAESENCLAST", commutative: false, typ: "Vec512", resultInArg0: false},
{name: "VAESIMC128", argLength: 1, reg: v11, asm: "VAESIMC", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VBROADCASTSD256", argLength: 1, reg: v11, asm: "VBROADCASTSD", commutative: false, typ: "Vec256", resultInArg0: false},
@@ -172,38 +172,38 @@ func simdAMD64Ops(v11, v21, v2k, vkv, v2kv, v2kk, v31, v3kv, vgpv, vgp, vfpv, vf
{name: "VEXPANDPSMasked128", argLength: 2, reg: wkw, asm: "VEXPANDPS", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VEXPANDPSMasked256", argLength: 2, reg: wkw, asm: "VEXPANDPS", commutative: false, typ: "Vec256", resultInArg0: false},
{name: "VEXPANDPSMasked512", argLength: 2, reg: wkw, asm: "VEXPANDPS", commutative: false, typ: "Vec512", resultInArg0: false},
{name: "VFMADD213PD128", argLength: 3, reg: w31, asm: "VFMADD213PD", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VFMADD213PD256", argLength: 3, reg: w31, asm: "VFMADD213PD", commutative: false, typ: "Vec256", resultInArg0: true},
{name: "VFMADD213PD128", argLength: 3, reg: v31, asm: "VFMADD213PD", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VFMADD213PD256", argLength: 3, reg: v31, asm: "VFMADD213PD", commutative: false, typ: "Vec256", resultInArg0: true},
{name: "VFMADD213PD512", argLength: 3, reg: w31, asm: "VFMADD213PD", commutative: false, typ: "Vec512", resultInArg0: true},
{name: "VFMADD213PDMasked128", argLength: 4, reg: w3kw, asm: "VFMADD213PD", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VFMADD213PDMasked256", argLength: 4, reg: w3kw, asm: "VFMADD213PD", commutative: false, typ: "Vec256", resultInArg0: true},
{name: "VFMADD213PDMasked512", argLength: 4, reg: w3kw, asm: "VFMADD213PD", commutative: false, typ: "Vec512", resultInArg0: true},
{name: "VFMADD213PS128", argLength: 3, reg: w31, asm: "VFMADD213PS", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VFMADD213PS256", argLength: 3, reg: w31, asm: "VFMADD213PS", commutative: false, typ: "Vec256", resultInArg0: true},
{name: "VFMADD213PS128", argLength: 3, reg: v31, asm: "VFMADD213PS", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VFMADD213PS256", argLength: 3, reg: v31, asm: "VFMADD213PS", commutative: false, typ: "Vec256", resultInArg0: true},
{name: "VFMADD213PS512", argLength: 3, reg: w31, asm: "VFMADD213PS", commutative: false, typ: "Vec512", resultInArg0: true},
{name: "VFMADD213PSMasked128", argLength: 4, reg: w3kw, asm: "VFMADD213PS", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VFMADD213PSMasked256", argLength: 4, reg: w3kw, asm: "VFMADD213PS", commutative: false, typ: "Vec256", resultInArg0: true},
{name: "VFMADD213PSMasked512", argLength: 4, reg: w3kw, asm: "VFMADD213PS", commutative: false, typ: "Vec512", resultInArg0: true},
{name: "VFMADDSUB213PD128", argLength: 3, reg: w31, asm: "VFMADDSUB213PD", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VFMADDSUB213PD256", argLength: 3, reg: w31, asm: "VFMADDSUB213PD", commutative: false, typ: "Vec256", resultInArg0: true},
{name: "VFMADDSUB213PD128", argLength: 3, reg: v31, asm: "VFMADDSUB213PD", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VFMADDSUB213PD256", argLength: 3, reg: v31, asm: "VFMADDSUB213PD", commutative: false, typ: "Vec256", resultInArg0: true},
{name: "VFMADDSUB213PD512", argLength: 3, reg: w31, asm: "VFMADDSUB213PD", commutative: false, typ: "Vec512", resultInArg0: true},
{name: "VFMADDSUB213PDMasked128", argLength: 4, reg: w3kw, asm: "VFMADDSUB213PD", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VFMADDSUB213PDMasked256", argLength: 4, reg: w3kw, asm: "VFMADDSUB213PD", commutative: false, typ: "Vec256", resultInArg0: true},
{name: "VFMADDSUB213PDMasked512", argLength: 4, reg: w3kw, asm: "VFMADDSUB213PD", commutative: false, typ: "Vec512", resultInArg0: true},
{name: "VFMADDSUB213PS128", argLength: 3, reg: w31, asm: "VFMADDSUB213PS", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VFMADDSUB213PS256", argLength: 3, reg: w31, asm: "VFMADDSUB213PS", commutative: false, typ: "Vec256", resultInArg0: true},
{name: "VFMADDSUB213PS128", argLength: 3, reg: v31, asm: "VFMADDSUB213PS", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VFMADDSUB213PS256", argLength: 3, reg: v31, asm: "VFMADDSUB213PS", commutative: false, typ: "Vec256", resultInArg0: true},
{name: "VFMADDSUB213PS512", argLength: 3, reg: w31, asm: "VFMADDSUB213PS", commutative: false, typ: "Vec512", resultInArg0: true},
{name: "VFMADDSUB213PSMasked128", argLength: 4, reg: w3kw, asm: "VFMADDSUB213PS", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VFMADDSUB213PSMasked256", argLength: 4, reg: w3kw, asm: "VFMADDSUB213PS", commutative: false, typ: "Vec256", resultInArg0: true},
{name: "VFMADDSUB213PSMasked512", argLength: 4, reg: w3kw, asm: "VFMADDSUB213PS", commutative: false, typ: "Vec512", resultInArg0: true},
{name: "VFMSUBADD213PD128", argLength: 3, reg: w31, asm: "VFMSUBADD213PD", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VFMSUBADD213PD256", argLength: 3, reg: w31, asm: "VFMSUBADD213PD", commutative: false, typ: "Vec256", resultInArg0: true},
{name: "VFMSUBADD213PD128", argLength: 3, reg: v31, asm: "VFMSUBADD213PD", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VFMSUBADD213PD256", argLength: 3, reg: v31, asm: "VFMSUBADD213PD", commutative: false, typ: "Vec256", resultInArg0: true},
{name: "VFMSUBADD213PD512", argLength: 3, reg: w31, asm: "VFMSUBADD213PD", commutative: false, typ: "Vec512", resultInArg0: true},
{name: "VFMSUBADD213PDMasked128", argLength: 4, reg: w3kw, asm: "VFMSUBADD213PD", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VFMSUBADD213PDMasked256", argLength: 4, reg: w3kw, asm: "VFMSUBADD213PD", commutative: false, typ: "Vec256", resultInArg0: true},
{name: "VFMSUBADD213PDMasked512", argLength: 4, reg: w3kw, asm: "VFMSUBADD213PD", commutative: false, typ: "Vec512", resultInArg0: true},
{name: "VFMSUBADD213PS128", argLength: 3, reg: w31, asm: "VFMSUBADD213PS", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VFMSUBADD213PS256", argLength: 3, reg: w31, asm: "VFMSUBADD213PS", commutative: false, typ: "Vec256", resultInArg0: true},
{name: "VFMSUBADD213PS128", argLength: 3, reg: v31, asm: "VFMSUBADD213PS", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VFMSUBADD213PS256", argLength: 3, reg: v31, asm: "VFMSUBADD213PS", commutative: false, typ: "Vec256", resultInArg0: true},
{name: "VFMSUBADD213PS512", argLength: 3, reg: w31, asm: "VFMSUBADD213PS", commutative: false, typ: "Vec512", resultInArg0: true},
{name: "VFMSUBADD213PSMasked128", argLength: 4, reg: w3kw, asm: "VFMSUBADD213PS", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VFMSUBADD213PSMasked256", argLength: 4, reg: w3kw, asm: "VFMSUBADD213PS", commutative: false, typ: "Vec256", resultInArg0: true},
@@ -452,18 +452,6 @@ func simdAMD64Ops(v11, v21, v2k, vkv, v2kv, v2kk, v31, v3kv, vgpv, vgp, vfpv, vf
{name: "VPCOMPRESSWMasked128", argLength: 2, reg: wkw, asm: "VPCOMPRESSW", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPCOMPRESSWMasked256", argLength: 2, reg: wkw, asm: "VPCOMPRESSW", commutative: false, typ: "Vec256", resultInArg0: false},
{name: "VPCOMPRESSWMasked512", argLength: 2, reg: wkw, asm: "VPCOMPRESSW", commutative: false, typ: "Vec512", resultInArg0: false},
{name: "VPDPBUSD128", argLength: 3, reg: v31, asm: "VPDPBUSD", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VPDPBUSD256", argLength: 3, reg: v31, asm: "VPDPBUSD", commutative: false, typ: "Vec256", resultInArg0: true},
{name: "VPDPBUSD512", argLength: 3, reg: w31, asm: "VPDPBUSD", commutative: false, typ: "Vec512", resultInArg0: true},
{name: "VPDPBUSDMasked128", argLength: 4, reg: w3kw, asm: "VPDPBUSD", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VPDPBUSDMasked256", argLength: 4, reg: w3kw, asm: "VPDPBUSD", commutative: false, typ: "Vec256", resultInArg0: true},
{name: "VPDPBUSDMasked512", argLength: 4, reg: w3kw, asm: "VPDPBUSD", commutative: false, typ: "Vec512", resultInArg0: true},
{name: "VPDPBUSDS128", argLength: 3, reg: v31, asm: "VPDPBUSDS", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VPDPBUSDS256", argLength: 3, reg: v31, asm: "VPDPBUSDS", commutative: false, typ: "Vec256", resultInArg0: true},
{name: "VPDPBUSDS512", argLength: 3, reg: w31, asm: "VPDPBUSDS", commutative: false, typ: "Vec512", resultInArg0: true},
{name: "VPDPBUSDSMasked128", argLength: 4, reg: w3kw, asm: "VPDPBUSDS", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VPDPBUSDSMasked256", argLength: 4, reg: w3kw, asm: "VPDPBUSDS", commutative: false, typ: "Vec256", resultInArg0: true},
{name: "VPDPBUSDSMasked512", argLength: 4, reg: w3kw, asm: "VPDPBUSDS", commutative: false, typ: "Vec512", resultInArg0: true},
{name: "VPDPWSSD128", argLength: 3, reg: v31, asm: "VPDPWSSD", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VPDPWSSD256", argLength: 3, reg: v31, asm: "VPDPWSSD", commutative: false, typ: "Vec256", resultInArg0: true},
{name: "VPDPWSSD512", argLength: 3, reg: w31, asm: "VPDPWSSD", commutative: false, typ: "Vec512", resultInArg0: true},
@@ -780,12 +768,24 @@ func simdAMD64Ops(v11, v21, v2k, vkv, v2kv, v2kk, v31, v3kv, vgpv, vgp, vfpv, vf
{name: "VPMOVSXWQMasked128", argLength: 2, reg: wkw, asm: "VPMOVSXWQ", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPMOVSXWQMasked256", argLength: 2, reg: wkw, asm: "VPMOVSXWQ", commutative: false, typ: "Vec256", resultInArg0: false},
{name: "VPMOVSXWQMasked512", argLength: 2, reg: wkw, asm: "VPMOVSXWQ", commutative: false, typ: "Vec512", resultInArg0: false},
{name: "VPMOVUSDB128_128", argLength: 1, reg: w11, asm: "VPMOVUSDB", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPMOVUSDB128_256", argLength: 1, reg: w11, asm: "VPMOVUSDB", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPMOVUSDB128_512", argLength: 1, reg: w11, asm: "VPMOVUSDB", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPMOVUSDBMasked128_128", argLength: 2, reg: wkw, asm: "VPMOVUSDB", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPMOVUSDBMasked128_256", argLength: 2, reg: wkw, asm: "VPMOVUSDB", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPMOVUSDBMasked128_512", argLength: 2, reg: wkw, asm: "VPMOVUSDB", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPMOVUSDW128_128", argLength: 1, reg: w11, asm: "VPMOVUSDW", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPMOVUSDW128_256", argLength: 1, reg: w11, asm: "VPMOVUSDW", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPMOVUSDW256", argLength: 1, reg: w11, asm: "VPMOVUSDW", commutative: false, typ: "Vec256", resultInArg0: false},
{name: "VPMOVUSDWMasked128_128", argLength: 2, reg: wkw, asm: "VPMOVUSDW", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPMOVUSDWMasked128_256", argLength: 2, reg: wkw, asm: "VPMOVUSDW", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPMOVUSDWMasked256", argLength: 2, reg: wkw, asm: "VPMOVUSDW", commutative: false, typ: "Vec256", resultInArg0: false},
{name: "VPMOVUSQB128_128", argLength: 1, reg: w11, asm: "VPMOVUSQB", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPMOVUSQB128_256", argLength: 1, reg: w11, asm: "VPMOVUSQB", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPMOVUSQB128_512", argLength: 1, reg: w11, asm: "VPMOVUSQB", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPMOVUSQBMasked128_128", argLength: 2, reg: wkw, asm: "VPMOVUSQB", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPMOVUSQBMasked128_256", argLength: 2, reg: wkw, asm: "VPMOVUSQB", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPMOVUSQBMasked128_512", argLength: 2, reg: wkw, asm: "VPMOVUSQB", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPMOVUSQD128_128", argLength: 1, reg: w11, asm: "VPMOVUSQD", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPMOVUSQD128_256", argLength: 1, reg: w11, asm: "VPMOVUSQD", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPMOVUSQD256", argLength: 1, reg: w11, asm: "VPMOVUSQD", commutative: false, typ: "Vec256", resultInArg0: false},
@@ -798,7 +798,11 @@ func simdAMD64Ops(v11, v21, v2k, vkv, v2kv, v2kk, v31, v3kv, vgpv, vgp, vfpv, vf
{name: "VPMOVUSQWMasked128_128", argLength: 2, reg: wkw, asm: "VPMOVUSQW", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPMOVUSQWMasked128_256", argLength: 2, reg: wkw, asm: "VPMOVUSQW", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPMOVUSQWMasked128_512", argLength: 2, reg: wkw, asm: "VPMOVUSQW", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPMOVUSWB128_128", argLength: 1, reg: w11, asm: "VPMOVUSWB", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPMOVUSWB128_256", argLength: 1, reg: w11, asm: "VPMOVUSWB", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPMOVUSWB256", argLength: 1, reg: w11, asm: "VPMOVUSWB", commutative: false, typ: "Vec256", resultInArg0: false},
{name: "VPMOVUSWBMasked128_128", argLength: 2, reg: wkw, asm: "VPMOVUSWB", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPMOVUSWBMasked128_256", argLength: 2, reg: wkw, asm: "VPMOVUSWB", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPMOVUSWBMasked256", argLength: 2, reg: wkw, asm: "VPMOVUSWB", commutative: false, typ: "Vec256", resultInArg0: false},
{name: "VPMOVWB128_128", argLength: 1, reg: w11, asm: "VPMOVWB", commutative: false, typ: "Vec128", resultInArg0: false},
{name: "VPMOVWB128_256", argLength: 1, reg: w11, asm: "VPMOVWB", commutative: false, typ: "Vec128", resultInArg0: false},
@@ -1590,38 +1594,26 @@ func simdAMD64Ops(v11, v21, v2k, vkv, v2kv, v2kk, v31, v3kv, vgpv, vgp, vfpv, vf
{name: "VDIVPSMasked128load", argLength: 4, reg: w2kwload, asm: "VDIVPS", commutative: false, typ: "Vec128", aux: "SymOff", symEffect: "Read", resultInArg0: false},
{name: "VDIVPSMasked256load", argLength: 4, reg: w2kwload, asm: "VDIVPS", commutative: false, typ: "Vec256", aux: "SymOff", symEffect: "Read", resultInArg0: false},
{name: "VDIVPSMasked512load", argLength: 4, reg: w2kwload, asm: "VDIVPS", commutative: false, typ: "Vec512", aux: "SymOff", symEffect: "Read", resultInArg0: false},
{name: "VFMADD213PD128load", argLength: 4, reg: w31load, asm: "VFMADD213PD", commutative: false, typ: "Vec128", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMADD213PD256load", argLength: 4, reg: w31load, asm: "VFMADD213PD", commutative: false, typ: "Vec256", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMADD213PD512load", argLength: 4, reg: w31load, asm: "VFMADD213PD", commutative: false, typ: "Vec512", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMADD213PDMasked128load", argLength: 5, reg: w3kwload, asm: "VFMADD213PD", commutative: false, typ: "Vec128", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMADD213PDMasked256load", argLength: 5, reg: w3kwload, asm: "VFMADD213PD", commutative: false, typ: "Vec256", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMADD213PDMasked512load", argLength: 5, reg: w3kwload, asm: "VFMADD213PD", commutative: false, typ: "Vec512", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMADD213PS128load", argLength: 4, reg: w31load, asm: "VFMADD213PS", commutative: false, typ: "Vec128", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMADD213PS256load", argLength: 4, reg: w31load, asm: "VFMADD213PS", commutative: false, typ: "Vec256", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMADD213PS512load", argLength: 4, reg: w31load, asm: "VFMADD213PS", commutative: false, typ: "Vec512", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMADD213PSMasked128load", argLength: 5, reg: w3kwload, asm: "VFMADD213PS", commutative: false, typ: "Vec128", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMADD213PSMasked256load", argLength: 5, reg: w3kwload, asm: "VFMADD213PS", commutative: false, typ: "Vec256", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMADD213PSMasked512load", argLength: 5, reg: w3kwload, asm: "VFMADD213PS", commutative: false, typ: "Vec512", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMADDSUB213PD128load", argLength: 4, reg: w31load, asm: "VFMADDSUB213PD", commutative: false, typ: "Vec128", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMADDSUB213PD256load", argLength: 4, reg: w31load, asm: "VFMADDSUB213PD", commutative: false, typ: "Vec256", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMADDSUB213PD512load", argLength: 4, reg: w31load, asm: "VFMADDSUB213PD", commutative: false, typ: "Vec512", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMADDSUB213PDMasked128load", argLength: 5, reg: w3kwload, asm: "VFMADDSUB213PD", commutative: false, typ: "Vec128", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMADDSUB213PDMasked256load", argLength: 5, reg: w3kwload, asm: "VFMADDSUB213PD", commutative: false, typ: "Vec256", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMADDSUB213PDMasked512load", argLength: 5, reg: w3kwload, asm: "VFMADDSUB213PD", commutative: false, typ: "Vec512", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMADDSUB213PS128load", argLength: 4, reg: w31load, asm: "VFMADDSUB213PS", commutative: false, typ: "Vec128", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMADDSUB213PS256load", argLength: 4, reg: w31load, asm: "VFMADDSUB213PS", commutative: false, typ: "Vec256", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMADDSUB213PS512load", argLength: 4, reg: w31load, asm: "VFMADDSUB213PS", commutative: false, typ: "Vec512", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMADDSUB213PSMasked128load", argLength: 5, reg: w3kwload, asm: "VFMADDSUB213PS", commutative: false, typ: "Vec128", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMADDSUB213PSMasked256load", argLength: 5, reg: w3kwload, asm: "VFMADDSUB213PS", commutative: false, typ: "Vec256", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMADDSUB213PSMasked512load", argLength: 5, reg: w3kwload, asm: "VFMADDSUB213PS", commutative: false, typ: "Vec512", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMSUBADD213PD128load", argLength: 4, reg: w31load, asm: "VFMSUBADD213PD", commutative: false, typ: "Vec128", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMSUBADD213PD256load", argLength: 4, reg: w31load, asm: "VFMSUBADD213PD", commutative: false, typ: "Vec256", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMSUBADD213PD512load", argLength: 4, reg: w31load, asm: "VFMSUBADD213PD", commutative: false, typ: "Vec512", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMSUBADD213PDMasked128load", argLength: 5, reg: w3kwload, asm: "VFMSUBADD213PD", commutative: false, typ: "Vec128", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMSUBADD213PDMasked256load", argLength: 5, reg: w3kwload, asm: "VFMSUBADD213PD", commutative: false, typ: "Vec256", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMSUBADD213PDMasked512load", argLength: 5, reg: w3kwload, asm: "VFMSUBADD213PD", commutative: false, typ: "Vec512", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMSUBADD213PS128load", argLength: 4, reg: w31load, asm: "VFMSUBADD213PS", commutative: false, typ: "Vec128", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMSUBADD213PS256load", argLength: 4, reg: w31load, asm: "VFMSUBADD213PS", commutative: false, typ: "Vec256", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMSUBADD213PS512load", argLength: 4, reg: w31load, asm: "VFMSUBADD213PS", commutative: false, typ: "Vec512", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMSUBADD213PSMasked128load", argLength: 5, reg: w3kwload, asm: "VFMSUBADD213PS", commutative: false, typ: "Vec128", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VFMSUBADD213PSMasked256load", argLength: 5, reg: w3kwload, asm: "VFMSUBADD213PS", commutative: false, typ: "Vec256", aux: "SymOff", symEffect: "Read", resultInArg0: true},
@@ -1698,14 +1690,6 @@ func simdAMD64Ops(v11, v21, v2k, vkv, v2kv, v2kk, v31, v3kv, vgpv, vgp, vfpv, vf
{name: "VPCMPEQQ512load", argLength: 3, reg: w2kload, asm: "VPCMPEQQ", commutative: false, typ: "Mask", aux: "SymOff", symEffect: "Read", resultInArg0: false},
{name: "VPCMPGTD512load", argLength: 3, reg: w2kload, asm: "VPCMPGTD", commutative: false, typ: "Mask", aux: "SymOff", symEffect: "Read", resultInArg0: false},
{name: "VPCMPGTQ512load", argLength: 3, reg: w2kload, asm: "VPCMPGTQ", commutative: false, typ: "Mask", aux: "SymOff", symEffect: "Read", resultInArg0: false},
{name: "VPDPBUSD512load", argLength: 4, reg: w31load, asm: "VPDPBUSD", commutative: false, typ: "Vec512", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VPDPBUSDMasked128load", argLength: 5, reg: w3kwload, asm: "VPDPBUSD", commutative: false, typ: "Vec128", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VPDPBUSDMasked256load", argLength: 5, reg: w3kwload, asm: "VPDPBUSD", commutative: false, typ: "Vec256", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VPDPBUSDMasked512load", argLength: 5, reg: w3kwload, asm: "VPDPBUSD", commutative: false, typ: "Vec512", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VPDPBUSDS512load", argLength: 4, reg: w31load, asm: "VPDPBUSDS", commutative: false, typ: "Vec512", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VPDPBUSDSMasked128load", argLength: 5, reg: w3kwload, asm: "VPDPBUSDS", commutative: false, typ: "Vec128", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VPDPBUSDSMasked256load", argLength: 5, reg: w3kwload, asm: "VPDPBUSDS", commutative: false, typ: "Vec256", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VPDPBUSDSMasked512load", argLength: 5, reg: w3kwload, asm: "VPDPBUSDS", commutative: false, typ: "Vec512", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VPDPWSSD512load", argLength: 4, reg: w31load, asm: "VPDPWSSD", commutative: false, typ: "Vec512", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VPDPWSSDMasked128load", argLength: 5, reg: w3kwload, asm: "VPDPWSSD", commutative: false, typ: "Vec128", aux: "SymOff", symEffect: "Read", resultInArg0: true},
{name: "VPDPWSSDMasked256load", argLength: 5, reg: w3kwload, asm: "VPDPWSSD", commutative: false, typ: "Vec256", aux: "SymOff", symEffect: "Read", resultInArg0: true},
@@ -2382,15 +2366,23 @@ func simdAMD64Ops(v11, v21, v2k, vkv, v2kv, v2kk, v31, v3kv, vgpv, vgp, vfpv, vf
{name: "VPMOVSXWQMasked128Merging", argLength: 3, reg: w2kw, asm: "VPMOVSXWQ", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VPMOVSXWQMasked256Merging", argLength: 3, reg: w2kw, asm: "VPMOVSXWQ", commutative: false, typ: "Vec256", resultInArg0: true},
{name: "VPMOVSXWQMasked512Merging", argLength: 3, reg: w2kw, asm: "VPMOVSXWQ", commutative: false, typ: "Vec512", resultInArg0: true},
{name: "VPMOVUSDBMasked128_128Merging", argLength: 3, reg: w2kw, asm: "VPMOVUSDB", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VPMOVUSDBMasked128_256Merging", argLength: 3, reg: w2kw, asm: "VPMOVUSDB", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VPMOVUSDBMasked128_512Merging", argLength: 3, reg: w2kw, asm: "VPMOVUSDB", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VPMOVUSDWMasked128_128Merging", argLength: 3, reg: w2kw, asm: "VPMOVUSDW", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VPMOVUSDWMasked128_256Merging", argLength: 3, reg: w2kw, asm: "VPMOVUSDW", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VPMOVUSDWMasked256Merging", argLength: 3, reg: w2kw, asm: "VPMOVUSDW", commutative: false, typ: "Vec256", resultInArg0: true},
{name: "VPMOVUSQBMasked128_128Merging", argLength: 3, reg: w2kw, asm: "VPMOVUSQB", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VPMOVUSQBMasked128_256Merging", argLength: 3, reg: w2kw, asm: "VPMOVUSQB", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VPMOVUSQBMasked128_512Merging", argLength: 3, reg: w2kw, asm: "VPMOVUSQB", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VPMOVUSQDMasked128_128Merging", argLength: 3, reg: w2kw, asm: "VPMOVUSQD", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VPMOVUSQDMasked128_256Merging", argLength: 3, reg: w2kw, asm: "VPMOVUSQD", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VPMOVUSQDMasked256Merging", argLength: 3, reg: w2kw, asm: "VPMOVUSQD", commutative: false, typ: "Vec256", resultInArg0: true},
{name: "VPMOVUSQWMasked128_128Merging", argLength: 3, reg: w2kw, asm: "VPMOVUSQW", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VPMOVUSQWMasked128_256Merging", argLength: 3, reg: w2kw, asm: "VPMOVUSQW", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VPMOVUSQWMasked128_512Merging", argLength: 3, reg: w2kw, asm: "VPMOVUSQW", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VPMOVUSWBMasked128_128Merging", argLength: 3, reg: w2kw, asm: "VPMOVUSWB", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VPMOVUSWBMasked128_256Merging", argLength: 3, reg: w2kw, asm: "VPMOVUSWB", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VPMOVUSWBMasked256Merging", argLength: 3, reg: w2kw, asm: "VPMOVUSWB", commutative: false, typ: "Vec256", resultInArg0: true},
{name: "VPMOVWBMasked128_128Merging", argLength: 3, reg: w2kw, asm: "VPMOVWB", commutative: false, typ: "Vec128", resultInArg0: true},
{name: "VPMOVWBMasked128_256Merging", argLength: 3, reg: w2kw, asm: "VPMOVWB", commutative: false, typ: "Vec128", resultInArg0: true},

View File

@@ -1,4 +1,4 @@
// Code generated by x/arch/internal/simdgen using 'go run . -xedPath $XED_PATH -o godefs -goroot $GOROOT go.yaml types.yaml categories.yaml'; DO NOT EDIT.
// Code generated by 'simdgen -o godefs -goroot $GOROOT -xedPath $XED_PATH go.yaml types.yaml categories.yaml'; DO NOT EDIT.
package main
@@ -48,19 +48,19 @@ func simdGenericOps() []opData {
{name: "AddInt64x4", argLength: 2, commutative: true},
{name: "AddInt64x8", argLength: 2, commutative: true},
{name: "AddPairsFloat32x4", argLength: 2, commutative: false},
{name: "AddPairsFloat32x8", argLength: 2, commutative: false},
{name: "AddPairsFloat64x2", argLength: 2, commutative: false},
{name: "AddPairsFloat64x4", argLength: 2, commutative: false},
{name: "AddPairsGroupedFloat32x8", argLength: 2, commutative: false},
{name: "AddPairsGroupedFloat64x4", argLength: 2, commutative: false},
{name: "AddPairsGroupedInt16x16", argLength: 2, commutative: false},
{name: "AddPairsGroupedInt32x8", argLength: 2, commutative: false},
{name: "AddPairsGroupedUint16x16", argLength: 2, commutative: false},
{name: "AddPairsGroupedUint32x8", argLength: 2, commutative: false},
{name: "AddPairsInt16x8", argLength: 2, commutative: false},
{name: "AddPairsInt16x16", argLength: 2, commutative: false},
{name: "AddPairsInt32x4", argLength: 2, commutative: false},
{name: "AddPairsInt32x8", argLength: 2, commutative: false},
{name: "AddPairsSaturatedGroupedInt16x16", argLength: 2, commutative: false},
{name: "AddPairsSaturatedInt16x8", argLength: 2, commutative: false},
{name: "AddPairsSaturatedInt16x16", argLength: 2, commutative: false},
{name: "AddPairsUint16x8", argLength: 2, commutative: false},
{name: "AddPairsUint16x16", argLength: 2, commutative: false},
{name: "AddPairsUint32x4", argLength: 2, commutative: false},
{name: "AddPairsUint32x8", argLength: 2, commutative: false},
{name: "AddSaturatedInt8x16", argLength: 2, commutative: true},
{name: "AddSaturatedInt8x32", argLength: 2, commutative: true},
{name: "AddSaturatedInt8x64", argLength: 2, commutative: true},
@@ -143,36 +143,36 @@ func simdGenericOps() []opData {
{name: "AverageUint16x8", argLength: 2, commutative: true},
{name: "AverageUint16x16", argLength: 2, commutative: true},
{name: "AverageUint16x32", argLength: 2, commutative: true},
{name: "Broadcast128Float32x4", argLength: 1, commutative: false},
{name: "Broadcast128Float64x2", argLength: 1, commutative: false},
{name: "Broadcast128Int8x16", argLength: 1, commutative: false},
{name: "Broadcast128Int16x8", argLength: 1, commutative: false},
{name: "Broadcast128Int32x4", argLength: 1, commutative: false},
{name: "Broadcast128Int64x2", argLength: 1, commutative: false},
{name: "Broadcast128Uint8x16", argLength: 1, commutative: false},
{name: "Broadcast128Uint16x8", argLength: 1, commutative: false},
{name: "Broadcast128Uint32x4", argLength: 1, commutative: false},
{name: "Broadcast128Uint64x2", argLength: 1, commutative: false},
{name: "Broadcast256Float32x4", argLength: 1, commutative: false},
{name: "Broadcast256Float64x2", argLength: 1, commutative: false},
{name: "Broadcast256Int8x16", argLength: 1, commutative: false},
{name: "Broadcast256Int16x8", argLength: 1, commutative: false},
{name: "Broadcast256Int32x4", argLength: 1, commutative: false},
{name: "Broadcast256Int64x2", argLength: 1, commutative: false},
{name: "Broadcast256Uint8x16", argLength: 1, commutative: false},
{name: "Broadcast256Uint16x8", argLength: 1, commutative: false},
{name: "Broadcast256Uint32x4", argLength: 1, commutative: false},
{name: "Broadcast256Uint64x2", argLength: 1, commutative: false},
{name: "Broadcast512Float32x4", argLength: 1, commutative: false},
{name: "Broadcast512Float64x2", argLength: 1, commutative: false},
{name: "Broadcast512Int8x16", argLength: 1, commutative: false},
{name: "Broadcast512Int16x8", argLength: 1, commutative: false},
{name: "Broadcast512Int32x4", argLength: 1, commutative: false},
{name: "Broadcast512Int64x2", argLength: 1, commutative: false},
{name: "Broadcast512Uint8x16", argLength: 1, commutative: false},
{name: "Broadcast512Uint16x8", argLength: 1, commutative: false},
{name: "Broadcast512Uint32x4", argLength: 1, commutative: false},
{name: "Broadcast512Uint64x2", argLength: 1, commutative: false},
{name: "Broadcast1To2Float64x2", argLength: 1, commutative: false},
{name: "Broadcast1To2Int64x2", argLength: 1, commutative: false},
{name: "Broadcast1To2Uint64x2", argLength: 1, commutative: false},
{name: "Broadcast1To4Float32x4", argLength: 1, commutative: false},
{name: "Broadcast1To4Float64x2", argLength: 1, commutative: false},
{name: "Broadcast1To4Int32x4", argLength: 1, commutative: false},
{name: "Broadcast1To4Int64x2", argLength: 1, commutative: false},
{name: "Broadcast1To4Uint32x4", argLength: 1, commutative: false},
{name: "Broadcast1To4Uint64x2", argLength: 1, commutative: false},
{name: "Broadcast1To8Float32x4", argLength: 1, commutative: false},
{name: "Broadcast1To8Float64x2", argLength: 1, commutative: false},
{name: "Broadcast1To8Int16x8", argLength: 1, commutative: false},
{name: "Broadcast1To8Int32x4", argLength: 1, commutative: false},
{name: "Broadcast1To8Int64x2", argLength: 1, commutative: false},
{name: "Broadcast1To8Uint16x8", argLength: 1, commutative: false},
{name: "Broadcast1To8Uint32x4", argLength: 1, commutative: false},
{name: "Broadcast1To8Uint64x2", argLength: 1, commutative: false},
{name: "Broadcast1To16Float32x4", argLength: 1, commutative: false},
{name: "Broadcast1To16Int8x16", argLength: 1, commutative: false},
{name: "Broadcast1To16Int16x8", argLength: 1, commutative: false},
{name: "Broadcast1To16Int32x4", argLength: 1, commutative: false},
{name: "Broadcast1To16Uint8x16", argLength: 1, commutative: false},
{name: "Broadcast1To16Uint16x8", argLength: 1, commutative: false},
{name: "Broadcast1To16Uint32x4", argLength: 1, commutative: false},
{name: "Broadcast1To32Int8x16", argLength: 1, commutative: false},
{name: "Broadcast1To32Int16x8", argLength: 1, commutative: false},
{name: "Broadcast1To32Uint8x16", argLength: 1, commutative: false},
{name: "Broadcast1To32Uint16x8", argLength: 1, commutative: false},
{name: "Broadcast1To64Int8x16", argLength: 1, commutative: false},
{name: "Broadcast1To64Uint8x16", argLength: 1, commutative: false},
{name: "CeilFloat32x4", argLength: 1, commutative: false},
{name: "CeilFloat32x8", argLength: 1, commutative: false},
{name: "CeilFloat64x2", argLength: 1, commutative: false},
@@ -304,12 +304,6 @@ func simdGenericOps() []opData {
{name: "DotProductPairsSaturatedUint8x16", argLength: 2, commutative: false},
{name: "DotProductPairsSaturatedUint8x32", argLength: 2, commutative: false},
{name: "DotProductPairsSaturatedUint8x64", argLength: 2, commutative: false},
{name: "DotProductQuadrupleInt32x4", argLength: 3, commutative: false},
{name: "DotProductQuadrupleInt32x8", argLength: 3, commutative: false},
{name: "DotProductQuadrupleInt32x16", argLength: 3, commutative: false},
{name: "DotProductQuadrupleSaturatedInt32x4", argLength: 3, commutative: false},
{name: "DotProductQuadrupleSaturatedInt32x8", argLength: 3, commutative: false},
{name: "DotProductQuadrupleSaturatedInt32x16", argLength: 3, commutative: false},
{name: "EqualFloat32x4", argLength: 2, commutative: true},
{name: "EqualFloat32x8", argLength: 2, commutative: true},
{name: "EqualFloat32x16", argLength: 2, commutative: true},
@@ -370,26 +364,26 @@ func simdGenericOps() []opData {
{name: "ExpandUint64x2", argLength: 2, commutative: false},
{name: "ExpandUint64x4", argLength: 2, commutative: false},
{name: "ExpandUint64x8", argLength: 2, commutative: false},
{name: "ExtendLo2ToInt64x2Int8x16", argLength: 1, commutative: false},
{name: "ExtendLo2ToInt64x2Int16x8", argLength: 1, commutative: false},
{name: "ExtendLo2ToInt64x2Int32x4", argLength: 1, commutative: false},
{name: "ExtendLo2ToUint64x2Uint8x16", argLength: 1, commutative: false},
{name: "ExtendLo2ToUint64x2Uint16x8", argLength: 1, commutative: false},
{name: "ExtendLo2ToUint64x2Uint32x4", argLength: 1, commutative: false},
{name: "ExtendLo4ToInt32x4Int8x16", argLength: 1, commutative: false},
{name: "ExtendLo4ToInt32x4Int16x8", argLength: 1, commutative: false},
{name: "ExtendLo4ToInt64x4Int8x16", argLength: 1, commutative: false},
{name: "ExtendLo4ToInt64x4Int16x8", argLength: 1, commutative: false},
{name: "ExtendLo4ToUint32x4Uint8x16", argLength: 1, commutative: false},
{name: "ExtendLo4ToUint32x4Uint16x8", argLength: 1, commutative: false},
{name: "ExtendLo4ToUint64x4Uint8x16", argLength: 1, commutative: false},
{name: "ExtendLo4ToUint64x4Uint16x8", argLength: 1, commutative: false},
{name: "ExtendLo8ToInt16x8Int8x16", argLength: 1, commutative: false},
{name: "ExtendLo8ToInt32x8Int8x16", argLength: 1, commutative: false},
{name: "ExtendLo8ToInt64x8Int8x16", argLength: 1, commutative: false},
{name: "ExtendLo8ToUint16x8Uint8x16", argLength: 1, commutative: false},
{name: "ExtendLo8ToUint32x8Uint8x16", argLength: 1, commutative: false},
{name: "ExtendLo8ToUint64x8Uint8x16", argLength: 1, commutative: false},
{name: "ExtendLo2ToInt64Int8x16", argLength: 1, commutative: false},
{name: "ExtendLo2ToInt64Int16x8", argLength: 1, commutative: false},
{name: "ExtendLo2ToInt64Int32x4", argLength: 1, commutative: false},
{name: "ExtendLo2ToUint64Uint8x16", argLength: 1, commutative: false},
{name: "ExtendLo2ToUint64Uint16x8", argLength: 1, commutative: false},
{name: "ExtendLo2ToUint64Uint32x4", argLength: 1, commutative: false},
{name: "ExtendLo4ToInt32Int8x16", argLength: 1, commutative: false},
{name: "ExtendLo4ToInt32Int16x8", argLength: 1, commutative: false},
{name: "ExtendLo4ToInt64Int8x16", argLength: 1, commutative: false},
{name: "ExtendLo4ToInt64Int16x8", argLength: 1, commutative: false},
{name: "ExtendLo4ToUint32Uint8x16", argLength: 1, commutative: false},
{name: "ExtendLo4ToUint32Uint16x8", argLength: 1, commutative: false},
{name: "ExtendLo4ToUint64Uint8x16", argLength: 1, commutative: false},
{name: "ExtendLo4ToUint64Uint16x8", argLength: 1, commutative: false},
{name: "ExtendLo8ToInt16Int8x16", argLength: 1, commutative: false},
{name: "ExtendLo8ToInt32Int8x16", argLength: 1, commutative: false},
{name: "ExtendLo8ToInt64Int8x16", argLength: 1, commutative: false},
{name: "ExtendLo8ToUint16Uint8x16", argLength: 1, commutative: false},
{name: "ExtendLo8ToUint32Uint8x16", argLength: 1, commutative: false},
{name: "ExtendLo8ToUint64Uint8x16", argLength: 1, commutative: false},
{name: "ExtendToInt16Int8x16", argLength: 1, commutative: false},
{name: "ExtendToInt16Int8x32", argLength: 1, commutative: false},
{name: "ExtendToInt32Int8x16", argLength: 1, commutative: false},
@@ -525,12 +519,6 @@ func simdGenericOps() []opData {
{name: "InterleaveLoUint16x8", argLength: 2, commutative: false},
{name: "InterleaveLoUint32x4", argLength: 2, commutative: false},
{name: "InterleaveLoUint64x2", argLength: 2, commutative: false},
{name: "IsNanFloat32x4", argLength: 2, commutative: true},
{name: "IsNanFloat32x8", argLength: 2, commutative: true},
{name: "IsNanFloat32x16", argLength: 2, commutative: true},
{name: "IsNanFloat64x2", argLength: 2, commutative: true},
{name: "IsNanFloat64x4", argLength: 2, commutative: true},
{name: "IsNanFloat64x8", argLength: 2, commutative: true},
{name: "LeadingZerosInt32x4", argLength: 1, commutative: false},
{name: "LeadingZerosInt32x8", argLength: 1, commutative: false},
{name: "LeadingZerosInt32x16", argLength: 1, commutative: false},
@@ -830,9 +818,9 @@ func simdGenericOps() []opData {
{name: "SaturateToInt8Int64x2", argLength: 1, commutative: false},
{name: "SaturateToInt8Int64x4", argLength: 1, commutative: false},
{name: "SaturateToInt8Int64x8", argLength: 1, commutative: false},
{name: "SaturateToInt16ConcatGroupedInt32x8", argLength: 2, commutative: false},
{name: "SaturateToInt16ConcatGroupedInt32x16", argLength: 2, commutative: false},
{name: "SaturateToInt16ConcatInt32x4", argLength: 2, commutative: false},
{name: "SaturateToInt16ConcatInt32x8", argLength: 2, commutative: false},
{name: "SaturateToInt16ConcatInt32x16", argLength: 2, commutative: false},
{name: "SaturateToInt16Int32x4", argLength: 1, commutative: false},
{name: "SaturateToInt16Int32x8", argLength: 1, commutative: false},
{name: "SaturateToInt16Int32x16", argLength: 1, commutative: false},
@@ -842,18 +830,18 @@ func simdGenericOps() []opData {
{name: "SaturateToInt32Int64x2", argLength: 1, commutative: false},
{name: "SaturateToInt32Int64x4", argLength: 1, commutative: false},
{name: "SaturateToInt32Int64x8", argLength: 1, commutative: false},
{name: "SaturateToUint8Int16x8", argLength: 1, commutative: false},
{name: "SaturateToUint8Int16x16", argLength: 1, commutative: false},
{name: "SaturateToUint8Int32x4", argLength: 1, commutative: false},
{name: "SaturateToUint8Int32x8", argLength: 1, commutative: false},
{name: "SaturateToUint8Int32x16", argLength: 1, commutative: false},
{name: "SaturateToUint8Int64x2", argLength: 1, commutative: false},
{name: "SaturateToUint8Int64x4", argLength: 1, commutative: false},
{name: "SaturateToUint8Int64x8", argLength: 1, commutative: false},
{name: "SaturateToUint8Uint16x8", argLength: 1, commutative: false},
{name: "SaturateToUint8Uint16x16", argLength: 1, commutative: false},
{name: "SaturateToUint8Uint16x32", argLength: 1, commutative: false},
{name: "SaturateToUint16ConcatUint32x4", argLength: 2, commutative: false},
{name: "SaturateToUint16ConcatUint32x8", argLength: 2, commutative: false},
{name: "SaturateToUint16ConcatUint32x16", argLength: 2, commutative: false},
{name: "SaturateToUint8Uint32x4", argLength: 1, commutative: false},
{name: "SaturateToUint8Uint32x8", argLength: 1, commutative: false},
{name: "SaturateToUint8Uint32x16", argLength: 1, commutative: false},
{name: "SaturateToUint8Uint64x2", argLength: 1, commutative: false},
{name: "SaturateToUint8Uint64x4", argLength: 1, commutative: false},
{name: "SaturateToUint8Uint64x8", argLength: 1, commutative: false},
{name: "SaturateToUint16ConcatGroupedInt32x8", argLength: 2, commutative: false},
{name: "SaturateToUint16ConcatGroupedInt32x16", argLength: 2, commutative: false},
{name: "SaturateToUint16ConcatInt32x4", argLength: 2, commutative: false},
{name: "SaturateToUint16Uint32x4", argLength: 1, commutative: false},
{name: "SaturateToUint16Uint32x8", argLength: 1, commutative: false},
{name: "SaturateToUint16Uint32x16", argLength: 1, commutative: false},
@@ -1042,19 +1030,19 @@ func simdGenericOps() []opData {
{name: "SubInt64x4", argLength: 2, commutative: false},
{name: "SubInt64x8", argLength: 2, commutative: false},
{name: "SubPairsFloat32x4", argLength: 2, commutative: false},
{name: "SubPairsFloat32x8", argLength: 2, commutative: false},
{name: "SubPairsFloat64x2", argLength: 2, commutative: false},
{name: "SubPairsFloat64x4", argLength: 2, commutative: false},
{name: "SubPairsGroupedFloat32x8", argLength: 2, commutative: false},
{name: "SubPairsGroupedFloat64x4", argLength: 2, commutative: false},
{name: "SubPairsGroupedInt16x16", argLength: 2, commutative: false},
{name: "SubPairsGroupedInt32x8", argLength: 2, commutative: false},
{name: "SubPairsGroupedUint16x16", argLength: 2, commutative: false},
{name: "SubPairsGroupedUint32x8", argLength: 2, commutative: false},
{name: "SubPairsInt16x8", argLength: 2, commutative: false},
{name: "SubPairsInt16x16", argLength: 2, commutative: false},
{name: "SubPairsInt32x4", argLength: 2, commutative: false},
{name: "SubPairsInt32x8", argLength: 2, commutative: false},
{name: "SubPairsSaturatedGroupedInt16x16", argLength: 2, commutative: false},
{name: "SubPairsSaturatedInt16x8", argLength: 2, commutative: false},
{name: "SubPairsSaturatedInt16x16", argLength: 2, commutative: false},
{name: "SubPairsUint16x8", argLength: 2, commutative: false},
{name: "SubPairsUint16x16", argLength: 2, commutative: false},
{name: "SubPairsUint32x4", argLength: 2, commutative: false},
{name: "SubPairsUint32x8", argLength: 2, commutative: false},
{name: "SubSaturatedInt8x16", argLength: 2, commutative: false},
{name: "SubSaturatedInt8x32", argLength: 2, commutative: false},
{name: "SubSaturatedInt8x64", argLength: 2, commutative: false},

View File

@@ -345,6 +345,47 @@ func checkFunc(f *Func) {
v.Op, v.Args[1].Type.String())
}
}
// Check size of args.
// This list isn't exhaustive, just the common ops.
// It also can't handle ops with args of different types, like shifts.
var argSize int64
switch v.Op {
case OpAdd8, OpSub8, OpMul8, OpDiv8, OpDiv8u, OpMod8, OpMod8u,
OpAnd8, OpOr8, OpXor8,
OpEq8, OpNeq8, OpLess8, OpLeq8,
OpNeg8, OpCom8,
OpSignExt8to16, OpSignExt8to32, OpSignExt8to64,
OpZeroExt8to16, OpZeroExt8to32, OpZeroExt8to64:
argSize = 1
case OpAdd16, OpSub16, OpMul16, OpDiv16, OpDiv16u, OpMod16, OpMod16u,
OpAnd16, OpOr16, OpXor16,
OpEq16, OpNeq16, OpLess16, OpLeq16,
OpNeg16, OpCom16,
OpSignExt16to32, OpSignExt16to64,
OpZeroExt16to32, OpZeroExt16to64,
OpTrunc16to8:
argSize = 2
case OpAdd32, OpSub32, OpMul32, OpDiv32, OpDiv32u, OpMod32, OpMod32u,
OpAnd32, OpOr32, OpXor32,
OpEq32, OpNeq32, OpLess32, OpLeq32,
OpNeg32, OpCom32,
OpSignExt32to64, OpZeroExt32to64,
OpTrunc32to8, OpTrunc32to16:
argSize = 4
case OpAdd64, OpSub64, OpMul64, OpDiv64, OpDiv64u, OpMod64, OpMod64u,
OpAnd64, OpOr64, OpXor64,
OpEq64, OpNeq64, OpLess64, OpLeq64,
OpNeg64, OpCom64,
OpTrunc64to8, OpTrunc64to16, OpTrunc64to32:
argSize = 8
}
if argSize != 0 {
for i, arg := range v.Args {
if arg.Type.Size() != argSize {
f.Fatalf("arg %d to %s (%v) should be %d bytes in size, it is %s", i, v.Op, v, argSize, arg.Type.String())
}
}
}
// TODO: check for cycles in values
}

View File

@@ -304,6 +304,9 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize, softfloat boo
c.LinkReg = linkRegLOONG64
c.hasGReg = true
c.unalignedOK = true
c.haveBswap64 = true
c.haveBswap32 = true
c.haveBswap16 = true
c.haveCondSelect = true
case "s390x":
c.PtrSize = 8

File diff suppressed because it is too large Load Diff

View File

@@ -250,6 +250,10 @@ func fitsInBitsU(x uint64, b uint) bool {
return x>>b == 0
}
func noLimit() limit {
return noLimitForBitsize(64)
}
func noLimitForBitsize(bitsize uint) limit {
return limit{min: -(1 << (bitsize - 1)), max: 1<<(bitsize-1) - 1, umin: 0, umax: 1<<bitsize - 1}
}
@@ -269,6 +273,13 @@ func convertIntWithBitsize[Target uint64 | int64, Source uint64 | int64](x Sourc
}
}
func (l limit) unsignedFixedLeadingBits() (fixed uint64, count uint) {
varying := uint(bits.Len64(l.umin ^ l.umax))
count = uint(bits.LeadingZeros64(l.umin ^ l.umax))
fixed = l.umin &^ (1<<varying - 1)
return
}
// add returns the limit obtained by adding a value with limit l
// to a value with limit l2. The result must fit in b bits.
func (l limit) add(l2 limit, b uint) limit {
@@ -295,7 +306,7 @@ func (l limit) add(l2 limit, b uint) limit {
return limit{min: int64r, max: int64r, umin: r, umax: r}
}
r := noLimit
r := noLimit()
min, minOk := safeAdd(l.min, l2.min, b)
max, maxOk := safeAdd(l.max, l2.max, b)
if minOk && maxOk {
@@ -313,7 +324,7 @@ func (l limit) add(l2 limit, b uint) limit {
// same as add but for subtraction.
func (l limit) sub(l2 limit, b uint) limit {
r := noLimit
r := noLimit()
min, minOk := safeSub(l.min, l2.max, b)
max, maxOk := safeSub(l.max, l2.min, b)
if minOk && maxOk {
@@ -331,7 +342,7 @@ func (l limit) sub(l2 limit, b uint) limit {
// same as add but for multiplication.
func (l limit) mul(l2 limit, b uint) limit {
r := noLimit
r := noLimit()
umaxhi, umaxlo := bits.Mul64(l.umax, l2.umax)
if umaxhi == 0 && fitsInBitsU(umaxlo, b) {
r.umax = umaxlo
@@ -353,7 +364,7 @@ func (l limit) mul(l2 limit, b uint) limit {
// Similar to add, but compute 1 << l if it fits without overflow in b bits.
func (l limit) exp2(b uint) limit {
r := noLimit
r := noLimit()
if l.umax < uint64(b) {
r.umin = 1 << l.umin
r.umax = 1 << l.umax
@@ -404,7 +415,53 @@ func (l limit) neg(b uint) limit {
return l.com(b).add(limit{min: 1, max: 1, umin: 1, umax: 1}, b)
}
var noLimit = limit{math.MinInt64, math.MaxInt64, 0, math.MaxUint64}
// Similar to add, but computes the TrailingZeros of the limit for bitsize b.
func (l limit) ctz(b uint) limit {
fixed, fixedCount := l.unsignedFixedLeadingBits()
if fixedCount == 64 {
constResult := min(uint(bits.TrailingZeros64(fixed)), b)
return limit{min: int64(constResult), max: int64(constResult), umin: uint64(constResult), umax: uint64(constResult)}
}
varying := 64 - fixedCount
if l.umin&((1<<varying)-1) != 0 {
// there will always be at least one non-zero bit in the varying part
varying--
return noLimit().unsignedMax(uint64(varying))
}
return noLimit().unsignedMax(uint64(min(uint(bits.TrailingZeros64(fixed)), b)))
}
// Similar to add, but computes the Len of the limit for bitsize b.
func (l limit) bitlen(b uint) limit {
return noLimit().unsignedMinMax(
uint64(bits.Len64(l.umin)),
uint64(bits.Len64(l.umax)),
)
}
// Similar to add, but computes the PopCount of the limit for bitsize b.
func (l limit) popcount(b uint) limit {
fixed, fixedCount := l.unsignedFixedLeadingBits()
varying := 64 - fixedCount
fixedContribution := uint64(bits.OnesCount64(fixed))
min := fixedContribution
max := fixedContribution + uint64(varying)
varyingMask := uint64(1)<<varying - 1
if varyingPartOfUmax := l.umax & varyingMask; uint(bits.OnesCount64(varyingPartOfUmax)) != varying {
// there is at least one zero bit in the varying part
max--
}
if varyingPartOfUmin := l.umin & varyingMask; varyingPartOfUmin != 0 {
// there is at least one non-zero bit in the varying part
min++
}
return noLimit().unsignedMinMax(min, max)
}
// a limitFact is a limit known for a particular value.
type limitFact struct {
@@ -556,7 +613,7 @@ func (ft *factsTable) pointerNil(v *Value) {
ft.newLimit(v, limit{min: 0, max: 0, umin: 0, umax: 0})
}
func (ft *factsTable) pointerNonNil(v *Value) {
l := noLimit
l := noLimit()
l.umin = 1
ft.newLimit(v, l)
}
@@ -1788,15 +1845,15 @@ func initLimit(v *Value) limit {
case OpConstNil:
return limit{min: 0, max: 0, umin: 0, umax: 0}
case OpAddr, OpLocalAddr: // TODO: others?
l := noLimit
l := noLimit()
l.umin = 1
return l
default:
return noLimit
return noLimit()
}
}
if !v.Type.IsInteger() {
return noLimit
return noLimit()
}
// Default limits based on type.
@@ -1904,55 +1961,20 @@ func (ft *factsTable) flowLimit(v *Value) {
}
// math/bits
case OpCtz64:
a := ft.limits[v.Args[0].ID]
if a.nonzero() {
ft.unsignedMax(v, uint64(bits.Len64(a.umax)-1))
}
case OpCtz32:
a := ft.limits[v.Args[0].ID]
if a.nonzero() {
ft.unsignedMax(v, uint64(bits.Len32(uint32(a.umax))-1))
}
case OpCtz16:
a := ft.limits[v.Args[0].ID]
if a.nonzero() {
ft.unsignedMax(v, uint64(bits.Len16(uint16(a.umax))-1))
}
case OpCtz8:
a := ft.limits[v.Args[0].ID]
if a.nonzero() {
ft.unsignedMax(v, uint64(bits.Len8(uint8(a.umax))-1))
}
case OpCtz64, OpCtz32, OpCtz16, OpCtz8:
a := v.Args[0]
al := ft.limits[a.ID]
ft.newLimit(v, al.ctz(uint(a.Type.Size())*8))
case OpPopCount64, OpPopCount32, OpPopCount16, OpPopCount8:
a := ft.limits[v.Args[0].ID]
changingBitsCount := uint64(bits.Len64(a.umax ^ a.umin))
sharedLeadingMask := ^(uint64(1)<<changingBitsCount - 1)
fixedBits := a.umax & sharedLeadingMask
min := uint64(bits.OnesCount64(fixedBits))
ft.unsignedMinMax(v, min, min+changingBitsCount)
a := v.Args[0]
al := ft.limits[a.ID]
ft.newLimit(v, al.popcount(uint(a.Type.Size())*8))
case OpBitLen64:
a := ft.limits[v.Args[0].ID]
ft.unsignedMinMax(v,
uint64(bits.Len64(a.umin)),
uint64(bits.Len64(a.umax)))
case OpBitLen32:
a := ft.limits[v.Args[0].ID]
ft.unsignedMinMax(v,
uint64(bits.Len32(uint32(a.umin))),
uint64(bits.Len32(uint32(a.umax))))
case OpBitLen16:
a := ft.limits[v.Args[0].ID]
ft.unsignedMinMax(v,
uint64(bits.Len16(uint16(a.umin))),
uint64(bits.Len16(uint16(a.umax))))
case OpBitLen8:
a := ft.limits[v.Args[0].ID]
ft.unsignedMinMax(v,
uint64(bits.Len8(uint8(a.umin))),
uint64(bits.Len8(uint8(a.umax))))
case OpBitLen64, OpBitLen32, OpBitLen16, OpBitLen8:
a := v.Args[0]
al := ft.limits[a.ID]
ft.newLimit(v, al.bitlen(uint(a.Type.Size())*8))
// Masks.
@@ -2043,7 +2065,7 @@ func (ft *factsTable) flowLimit(v *Value) {
case OpDiv64u, OpDiv32u, OpDiv16u, OpDiv8u:
a := ft.limits[v.Args[0].ID]
b := ft.limits[v.Args[1].ID]
lim := noLimit
lim := noLimit()
if b.umax > 0 {
lim = lim.unsignedMin(a.umin / b.umax)
}
@@ -2165,24 +2187,22 @@ func (ft *factsTable) detectSubRelations(v *Value) {
return // x-y might overflow
}
// Subtracting a positive number only makes
// things smaller.
if yLim.min >= 0 {
// Subtracting a positive non-zero number only makes
// things smaller. If it's positive or zero, it might
// also do nothing (x-0 == v).
if yLim.min > 0 {
ft.update(v.Block, v, x, signed, lt)
} else if yLim.min == 0 {
ft.update(v.Block, v, x, signed, lt|eq)
// TODO: is this worth it?
//if yLim.min > 0 {
// ft.update(v.Block, v, x, signed, lt)
//}
}
// Subtracting a number from a bigger one
// can't go below 0.
if ft.orderS.OrderedOrEqual(y, x) {
// can't go below 1. If the numbers might be
// equal, then it can't go below 0.
if ft.orderS.Ordered(y, x) {
ft.signedMin(v, 1)
} else if ft.orderS.OrderedOrEqual(y, x) {
ft.setNonNegative(v)
// TODO: is this worth it?
//if ft.orderS.Ordered(y, x) {
// ft.signedMin(v, 1)
//}
}
}
@@ -2888,9 +2908,9 @@ func simplifyBlock(sdom SparseTree, ft *factsTable, b *Block) {
xl := ft.limits[x.ID]
y := v.Args[1]
yl := ft.limits[y.ID]
if xl.umin == xl.umax && isUnsignedPowerOfTwo(xl.umin) ||
if xl.umin == xl.umax && isPowerOfTwo(xl.umin) ||
xl.min == xl.max && isPowerOfTwo(xl.min) ||
yl.umin == yl.umax && isUnsignedPowerOfTwo(yl.umin) ||
yl.umin == yl.umax && isPowerOfTwo(yl.umin) ||
yl.min == yl.max && isPowerOfTwo(yl.min) {
// 0,1 * a power of two is better done as a shift
break

View File

@@ -6,11 +6,11 @@ package ssa
import (
"math"
"math/bits"
"testing"
)
func testLimitUnaryOpSigned8(t *testing.T, opName string, op func(l limit, bitsize uint) limit, opImpl func(int8) int8) {
sizeLimit := noLimitForBitsize(8)
func testLimitUnaryOpSigned8(t *testing.T, opName string, initLimit limit, op func(l limit, bitsize uint) limit, opImpl func(int8) int8) {
for min := math.MinInt8; min <= math.MaxInt8; min++ {
for max := min; max <= math.MaxInt8; max++ {
realSmallest, realBiggest := int8(math.MaxInt8), int8(math.MinInt8)
@@ -26,7 +26,7 @@ func testLimitUnaryOpSigned8(t *testing.T, opName string, op func(l limit, bitsi
l := limit{int64(min), int64(max), 0, math.MaxUint64}
l = op(l, 8)
l = l.intersect(sizeLimit) // We assume this is gonna be used by newLimit which is seeded by the op size already.
l = l.intersect(initLimit) // We assume this is gonna be used by newLimit which is seeded by the op size already.
if l.min != int64(realSmallest) || l.max != int64(realBiggest) {
t.Errorf("%s(%d..%d) = %d..%d; want %d..%d", opName, min, max, l.min, l.max, realSmallest, realBiggest)
@@ -35,8 +35,7 @@ func testLimitUnaryOpSigned8(t *testing.T, opName string, op func(l limit, bitsi
}
}
func testLimitUnaryOpUnsigned8(t *testing.T, opName string, op func(l limit, bitsize uint) limit, opImpl func(uint8) uint8) {
sizeLimit := noLimitForBitsize(8)
func testLimitUnaryOpUnsigned8(t *testing.T, opName string, initLimit limit, op func(l limit, bitsize uint) limit, opImpl func(uint8) uint8) {
for min := 0; min <= math.MaxUint8; min++ {
for max := min; max <= math.MaxUint8; max++ {
realSmallest, realBiggest := uint8(math.MaxUint8), uint8(0)
@@ -52,7 +51,7 @@ func testLimitUnaryOpUnsigned8(t *testing.T, opName string, op func(l limit, bit
l := limit{math.MinInt64, math.MaxInt64, uint64(min), uint64(max)}
l = op(l, 8)
l = l.intersect(sizeLimit) // We assume this is gonna be used by newLimit which is seeded by the op size already.
l = l.intersect(initLimit) // We assume this is gonna be used by newLimit which is seeded by the op size already.
if l.umin != uint64(realSmallest) || l.umax != uint64(realBiggest) {
t.Errorf("%s(%d..%d) = %d..%d; want %d..%d", opName, min, max, l.umin, l.umax, realSmallest, realBiggest)
@@ -62,15 +61,27 @@ func testLimitUnaryOpUnsigned8(t *testing.T, opName string, op func(l limit, bit
}
func TestLimitNegSigned(t *testing.T) {
testLimitUnaryOpSigned8(t, "neg", limit.neg, func(x int8) int8 { return -x })
testLimitUnaryOpSigned8(t, "neg", noLimitForBitsize(8), limit.neg, func(x int8) int8 { return -x })
}
func TestLimitNegUnsigned(t *testing.T) {
testLimitUnaryOpUnsigned8(t, "neg", limit.neg, func(x uint8) uint8 { return -x })
testLimitUnaryOpUnsigned8(t, "neg", noLimitForBitsize(8), limit.neg, func(x uint8) uint8 { return -x })
}
func TestLimitComSigned(t *testing.T) {
testLimitUnaryOpSigned8(t, "com", limit.com, func(x int8) int8 { return ^x })
testLimitUnaryOpSigned8(t, "com", noLimitForBitsize(8), limit.com, func(x int8) int8 { return ^x })
}
func TestLimitComUnsigned(t *testing.T) {
testLimitUnaryOpUnsigned8(t, "com", limit.com, func(x uint8) uint8 { return ^x })
testLimitUnaryOpUnsigned8(t, "com", noLimitForBitsize(8), limit.com, func(x uint8) uint8 { return ^x })
}
func TestLimitCtzUnsigned(t *testing.T) {
testLimitUnaryOpUnsigned8(t, "ctz", limit{-128, 127, 0, 8}, limit.ctz, func(x uint8) uint8 { return uint8(bits.TrailingZeros8(x)) })
}
func TestLimitBitlenUnsigned(t *testing.T) {
testLimitUnaryOpUnsigned8(t, "bitlen", limit{-128, 127, 0, 8}, limit.bitlen, func(x uint8) uint8 { return uint8(bits.Len8(x)) })
}
func TestLimitPopcountUnsigned(t *testing.T) {
testLimitUnaryOpUnsigned8(t, "popcount", limit{-128, 127, 0, 8}, limit.popcount, func(x uint8) uint8 { return uint8(bits.OnesCount8(x)) })
}

View File

@@ -480,7 +480,7 @@ func isSpecializedMalloc(aux Aux) bool {
name := fn.String()
return strings.HasPrefix(name, "runtime.mallocgcSmallNoScanSC") ||
strings.HasPrefix(name, "runtime.mallocgcSmallScanNoHeaderSC") ||
strings.HasPrefix(name, "runtime.mallocTiny")
strings.HasPrefix(name, "runtime.mallocgcTinySize")
}
// canLoadUnaligned reports if the architecture supports unaligned load operations.
@@ -518,22 +518,17 @@ func log32(n int32) int64 { return log32u(uint32(n)) }
func log64(n int64) int64 { return log64u(uint64(n)) }
// logXu returns the logarithm of n base 2.
// n must be a power of 2 (isUnsignedPowerOfTwo returns true)
// n must be a power of 2 (isPowerOfTwo returns true)
func log8u(n uint8) int64 { return int64(bits.Len8(n)) - 1 }
func log16u(n uint16) int64 { return int64(bits.Len16(n)) - 1 }
func log32u(n uint32) int64 { return int64(bits.Len32(n)) - 1 }
func log64u(n uint64) int64 { return int64(bits.Len64(n)) - 1 }
// isPowerOfTwoX functions report whether n is a power of 2.
func isPowerOfTwo[T int8 | int16 | int32 | int64](n T) bool {
func isPowerOfTwo[T int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64](n T) bool {
return n > 0 && n&(n-1) == 0
}
// isUnsignedPowerOfTwo reports whether n is an unsigned power of 2.
func isUnsignedPowerOfTwo[T uint8 | uint16 | uint32 | uint64](n T) bool {
return n != 0 && n&(n-1) == 0
}
// is32Bit reports whether n can be represented as a signed 32 bit integer.
func is32Bit(n int64) bool {
return n == int64(int32(n))
@@ -1356,7 +1351,7 @@ func overlap(offset1, size1, offset2, size2 int64) bool {
// check if value zeroes out upper 32-bit of 64-bit register.
// depth limits recursion depth. In AMD64.rules 3 is used as limit,
// because it catches same amount of cases as 4.
func zeroUpper32Bits(x *Value, depth int) bool {
func ZeroUpper32Bits(x *Value, depth int) bool {
if x.Type.IsSigned() && x.Type.Size() < 8 {
// If the value is signed, it might get re-sign-extended
// during spill and restore. See issue 68227.
@@ -1373,6 +1368,8 @@ func zeroUpper32Bits(x *Value, depth int) bool {
OpAMD64SHRL, OpAMD64SHRLconst, OpAMD64SARL, OpAMD64SARLconst,
OpAMD64SHLL, OpAMD64SHLLconst:
return true
case OpAMD64MOVQconst:
return uint64(uint32(x.AuxInt)) == uint64(x.AuxInt)
case OpARM64REV16W, OpARM64REVW, OpARM64RBITW, OpARM64CLZW, OpARM64EXTRWconst,
OpARM64MULW, OpARM64MNEGW, OpARM64UDIVW, OpARM64DIVW, OpARM64UMODW,
OpARM64MADDW, OpARM64MSUBW, OpARM64RORW, OpARM64RORWconst:
@@ -1388,7 +1385,7 @@ func zeroUpper32Bits(x *Value, depth int) bool {
return false
}
for i := range x.Args {
if !zeroUpper32Bits(x.Args[i], depth-1) {
if !ZeroUpper32Bits(x.Args[i], depth-1) {
return false
}
}
@@ -1398,14 +1395,16 @@ func zeroUpper32Bits(x *Value, depth int) bool {
return false
}
// zeroUpper48Bits is similar to zeroUpper32Bits, but for upper 48 bits.
func zeroUpper48Bits(x *Value, depth int) bool {
// ZeroUpper48Bits is similar to ZeroUpper32Bits, but for upper 48 bits.
func ZeroUpper48Bits(x *Value, depth int) bool {
if x.Type.IsSigned() && x.Type.Size() < 8 {
return false
}
switch x.Op {
case OpAMD64MOVWQZX, OpAMD64MOVWload, OpAMD64MOVWloadidx1, OpAMD64MOVWloadidx2:
return true
case OpAMD64MOVQconst, OpAMD64MOVLconst:
return uint64(uint16(x.AuxInt)) == uint64(x.AuxInt)
case OpArg: // note: but not ArgIntReg
return x.Type.Size() == 2 && x.Block.Func.Config.arch == "amd64"
case OpPhi, OpSelect0, OpSelect1:
@@ -1415,7 +1414,7 @@ func zeroUpper48Bits(x *Value, depth int) bool {
return false
}
for i := range x.Args {
if !zeroUpper48Bits(x.Args[i], depth-1) {
if !ZeroUpper48Bits(x.Args[i], depth-1) {
return false
}
}
@@ -1425,14 +1424,16 @@ func zeroUpper48Bits(x *Value, depth int) bool {
return false
}
// zeroUpper56Bits is similar to zeroUpper32Bits, but for upper 56 bits.
func zeroUpper56Bits(x *Value, depth int) bool {
// ZeroUpper56Bits is similar to ZeroUpper32Bits, but for upper 56 bits.
func ZeroUpper56Bits(x *Value, depth int) bool {
if x.Type.IsSigned() && x.Type.Size() < 8 {
return false
}
switch x.Op {
case OpAMD64MOVBQZX, OpAMD64MOVBload, OpAMD64MOVBloadidx1:
return true
case OpAMD64MOVQconst, OpAMD64MOVLconst:
return uint64(uint8(x.AuxInt)) == uint64(x.AuxInt)
case OpArg: // note: but not ArgIntReg
return x.Type.Size() == 1 && x.Block.Func.Config.arch == "amd64"
case OpPhi, OpSelect0, OpSelect1:
@@ -1442,7 +1443,7 @@ func zeroUpper56Bits(x *Value, depth int) bool {
return false
}
for i := range x.Args {
if !zeroUpper56Bits(x.Args[i], depth-1) {
if !ZeroUpper56Bits(x.Args[i], depth-1) {
return false
}
}
@@ -2786,3 +2787,12 @@ func imakeOfStructMake(v *Value) *Value {
}
return v.Block.NewValue2(v.Pos, OpIMake, v.Type, v.Args[0], arg)
}
// bool2int converts bool to int: true to 1, false to 0
func bool2int(x bool) int {
var b int
if x {
b = 1
}
return b
}

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More