Skip to content

[pull] master from golang:master#24

Merged
pull[bot] merged 6 commits intotrailofbits:masterfrom
golang:master
May 9, 2026
Merged

[pull] master from golang:master#24
pull[bot] merged 6 commits intotrailofbits:masterfrom
golang:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented May 9, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

prattmic and others added 6 commits May 8, 2026 12:29
This was accidentally dropped in CL 746300.

Fixes #67800.
Fixes #78479.

Change-Id: If78ba91fbdc2ab67d48c9200e5c7a9706a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/775920
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
This only affected SIMD-with-spectre=all, so rare, but blocks
CL 753740.

Change-Id: I3bc1306a2b739a6aeb5db78c3abc2d75115cf20f
Reviewed-on: https://go-review.googlesource.com/c/go/+/775780
Auto-Submit: David Chase <drchase@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Arseny Samoylov <samoylov.arseny@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
The Deprecate comment seems intended to apply only to the lookup
parameter, not the function itself. This CL clarifies the intent.

Fixes #79139

Change-Id: I436207cd0e4fd0f5214a1767486e39a54635fd21
Reviewed-on: https://go-review.googlesource.com/c/go/+/773040
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
The generic implementation of ctrlGroupMatchH2 uses a well-known
bit-parallel matching trick:

    v := g ^ (lsb * h)
    ((v - lsb) &^ v) & msb

This detects zero bytes in (g ^ h), but can produce false positives in
rare cases due to cross-byte borrow during the subtraction. In
particular, when a byte equals h and the following byte equals h+1
(e.g. 0x02, 0x03), the borrow chain may cause both bytes to be reported
as matches.

These false positives are benign (filtered by subsequent key comparison)
but introduce unnecessary probes.

This change rewrites ctrlGroupMatchH2 on ARM64 using an alternative
bit-parallel formulation that avoids cross-byte borrow propagation:

    v   = ~(g ^ (lsb * h))
    clr = v & 0x7f...7f
    msk = v & 0x80...80
    res = (clr + lsb) & msk

This formulation operates on the complemented value ~(g ^ h), which is
equivalent for match detection. By separating the low 7 bits and the high
bit of each byte, the addition avoids inter-byte carries. As a result,
matches are computed without false positives.

On ARM64, under a favorable instruction selection and scheduling, both
formulations compile to a similar number of instructions with comparable
latency, so the theoretical computational cost is unchanged.

Benchmark results (gomapbench) show small performance improvements in
most cases, with minor regressions in a few cases, resulting in an
overall net positive effect. Full benchmark data is available at:
https://gist.github.com/spy20051623/3227bea1520ea1871254eb0c219a0abb

No functional change; reduces unnecessary work in hashmap lookups under
certain patterns.

Change-Id: Ia85d0115a2431861d54aeeb4d2e6c9b3a69e72e2
Reviewed-on: https://go-review.googlesource.com/c/go/+/759480
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
The canonical way to multiply by 2 is x<<1, this is what other
generic rules expect.

It is slower than x+x but arches rule can turn x<<1 back into x+x,
as this avoids adding many special cases for rules optimizing shifts
to also search x+x as x<<1.

Change-Id: I249c60cd2643db2e2a3503f3934211f80fb2912a
Reviewed-on: https://go-review.googlesource.com/c/go/+/774060
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Add support for the RPRFM (Range Prefetch Memory) instruction.
As per ARM Architecture Reference Manual, this instruction
signals the memory system that data memory accesses from a
specified range of addresses are likely to occur in the near
future.

Syntax: RPRFM (Rn), Rm, <operation>

where operation is one of:
    PLDKEEP  - prefetch for keep (load)
    PSTKEEP  - prefetch for keep (store)
    PLDSTRM  - prefetch for streaming (load)
    PSTSTRM  - prefetch for streaming (store)
or a numeric immediate 0..63.

Change-Id: Iad230fbe91b5cacf3f3ca208e0fcc18562ed8139
Reviewed-on: https://go-review.googlesource.com/c/go/+/763200
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
@pull pull Bot locked and limited conversation to collaborators May 9, 2026
@pull pull Bot added the ⤵️ pull label May 9, 2026
@pull pull Bot merged commit d40a99f into trailofbits:master May 9, 2026
7 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants