Skip to content

[pull] master from golang:master#100

Merged
pull[bot] merged 2 commits into
trailofbits:masterfrom
golang:master
Jun 19, 2026
Merged

[pull] master from golang:master#100
pull[bot] merged 2 commits into
trailofbits:masterfrom
golang:master

Conversation

@pull

@pull pull Bot commented Jun 19, 2026

Copy link
Copy Markdown

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 : )

omarsy and others added 2 commits June 19, 2026 10:13
…bnormal

When fadd64/fsub64 cancel two near-equal, opposite-sign normal operands
into a subnormal result, fpack64 is handed a mantissa far below
1<<mantbits64 while exp is still a normal-range exponent. fpack64 saved
mant0/exp0/trunc0 before its normalization loop, so the denormal branch
restored an un-normalized mantissa and right-shifted it to align to the
subnormal exponent (the wrong direction here), returning the
un-normalized cancellation mantissa at the wrong scale instead of the
correctly rounded subnormal.

Save mant0/exp0/trunc0 after the normalization loop so the denormal path
restores a normalized mantissa and aligns correctly. This is a no-op for
callers that already pass a normalized mantissa (fmul64, fdiv64,
conversions). fpack32 is updated identically for parity, though its
denormal branch is not reachable with an un-normalized mantissa through
any current caller.

This only manifests on softfloat targets (e.g. GOMIPS=softfloat), which
is why it has gone unnoticed on hardware-float platforms. A randomized
differential check against hardware found the previous code wrong on
>50% of normal pairs that cancel into a subnormal; with this change
those cases match hardware.

Fixes #79964

Change-Id: I29f7ec79905ddb98af4f997a69b0a2f0574c3c9d
GitHub-Last-Rev: 42a73cd
GitHub-Pull-Request: #79965
Reviewed-on: https://go-review.googlesource.com/c/go/+/789861
Reviewed-by: Sayer Turner <sayerturner65@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
TestCtrlBreak relied on a fixed sleep to wait for a testing child
program to be ready to receive the signal. This may cause flaky timeouts
on slow machines. Instead, wait for the child to print a "ready" message
like other signal tests, particularly runtime.TestLibraryCtrlHandler.

Also fix a typo in the child program's file name to ensure it's easy to
associate with the test.

Fixes #80036

Change-Id: Ib3d8e6194538df95e76548771b401cf9b9de5674
Reviewed-on: https://go-review.googlesource.com/c/go/+/792020
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Hongxiang Jiang <hxjiang@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
@pull pull Bot locked and limited conversation to collaborators Jun 19, 2026
@pull pull Bot added the ⤵️ pull label Jun 19, 2026
@pull pull Bot merged commit 6458bb5 into trailofbits:master Jun 19, 2026
8 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.

2 participants