Commit graph

63338 commits

Author SHA1 Message Date
Cherry Mui
0cdb2697d1 [dev.simd] simd: add tests for intrinsic used as a func value and via reflection
Change-Id: I9d2be86be90c1ce1bfc031202e534df437af7a0f
Reviewed-on: https://go-review.googlesource.com/c/go/+/683036
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-06-23 07:28:17 -07:00
Cherry Mui
88c013d6ff [dev.simd] cmd/compile: generate function body for bodyless intrinsics
For a compiler intrinsic, if it is used in a non-call context, e.g.
as a function pointer, currently it requires fallback
implementation (e.g. assembly code for atomic operations),
otherwise it will result in a build failure. The fallback
implementation needs to be maintained and tested, albeit rarely
used in practice.

Also, for SIMD, we're currently adding a large number of compiler
intrinsics without providing fallback implementations (we might in
the future). As methods, it is not unlikely that they are used in
a non-call context, e.g. referenced from the type descriptor.

This CL lets the compiler generate the function body for
bodyless intrinsics. The compiler already recognizes a call to
the function as an intrinsic and can directly generate code for it.
So we just fill in the body with a call to the same function.

Change-Id: I2636e3128f28301c9abaf2b48bc962ab56e7d1a9
Reviewed-on: https://go-review.googlesource.com/c/go/+/683096
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-06-23 07:27:39 -07:00
Cherry Mui
a8669c78f5 [dev.simd] sync: correct the type of runtime_StoreReluintptr
runtime_StoreReluintptr linknames to internal/runtime/atomic.StoreReluintptr,
which does not have a result.

Change-Id: I468cce82985f391c221768188a5eaff43cbcd037
Reviewed-on: https://go-review.googlesource.com/c/go/+/683095
TryBot-Bypass: Cherry Mui <cherryyz@google.com>
Reviewed-by: David Chase <drchase@google.com>
2025-06-20 15:33:37 -07:00
David Chase
7c6ac35275 [dev.simd] cmd/compile: add simdFp1gp1fp1Imm8 helper to amd64 code generation
This is for VPINSRB[BWDQ], coming in a later CL.

Change-Id: I6b4b99be43512623d4d6e5542221c18f0c5c2eb4
Reviewed-on: https://go-review.googlesource.com/c/go/+/682956
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>
2025-06-20 14:14:45 -07:00
Cherry Mui
4150372a5d [dev.simd] cmd/compile: don't treat devel compiler as a released compiler
The compiler has a logic to print different messages on internal
compiler error depending on whether this is a released version of
Go. It hides the panic stack trace if it is a released version. It
does this by checking the version and see if it has a "go" prefix.
This includes all the released versions. However, for a non-
released build, if there is no explicit version set, cmd/dist now
sets the toolchain version as go1.X-devel_XXX, which makes it be
treated as a released compiler, and causes the stack trace to be
hidden. Change the logic to not match a devel compiler as a
released compiler.

Change-Id: I5d3b2101527212f825b6e4000b36030c4f83870b
Reviewed-on: https://go-review.googlesource.com/c/go/+/682975
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-06-20 11:51:29 -07:00
David Chase
1b87d52549 [dev.simd] cmd/compile: add fp1gp1fp1 register mask for AMD64
This is paired with a matching simdgen CL 682679

Change-Id: Id494d40b5e64b723a47c1682b71e523a77b0eb87
Reviewed-on: https://go-review.googlesource.com/c/go/+/682656
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2025-06-18 13:55:07 -07:00
Junyang Shao
1313521f75 [dev.simd] cmd/compile: remove fused mul/add/sub shapes.
This CL only keeps one shape of those fused mul/add/sub operations. The
rest of the instructions will be generated during lowering as an
optimization.

This CL is generated by CL 682436.

Change-Id: Iadee1786185289838e04f3aa8f333844cfacc02e
Reviewed-on: https://go-review.googlesource.com/c/go/+/682435
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-06-18 12:22:24 -07:00
Junyang Shao
1be5eb2686 [dev.simd] cmd/compile: fix signature error of PairDotProdAccumulate.
This CL is generated by CL 682135.

Change-Id: I6f004b2eca6323f1ff22555c85db993386f24c6c
Reviewed-on: https://go-review.googlesource.com/c/go/+/682155
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-06-17 19:03:27 -07:00
David Chase
3a4d10bfca [dev.simd] cmd/compile: removed a map iteration from generator; tweaked type order
Output of CL 682316

Change-Id: I566486085fbd8a5437a5904ed02f718da7fed2c9
Reviewed-on: https://go-review.googlesource.com/c/go/+/682355
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-06-17 09:29:28 -07:00
David Chase
21d6573154 [dev.simd] cmd/compile: alphabetize SIMD intrinsics
This is the output of CL 682036

Change-Id: I432c6e059dff7019a6bba6b777ea7fe48990278f
Reviewed-on: https://go-review.googlesource.com/c/go/+/682295
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2025-06-17 09:05:31 -07:00
Junyang Shao
ee1d9f3f85 [dev.simd] cmd/compile: reorder stubs
This CL is generated by CL 682035.

Change-Id: I0a8b7382470afb5a6571ab7d4abe038de0ff239e
Reviewed-on: https://go-review.googlesource.com/c/go/+/682055
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Junyang Shao <shaojunyang@google.com>
2025-06-16 13:45:27 -07:00
David Chase
6c50c8b892 [dev.simd] cmd/compile: move simd helpers into compiler, out of generated code
PAIRED w/ arch/internal/simdgen CL 681615

This moves the helpers out of the generated code.

Change-Id: I6150afd45dbdf8d1499e0b8ee80c1bd8be5d558e
Reviewed-on: https://go-review.googlesource.com/c/go/+/681500
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-06-13 14:27:02 -07:00
David Chase
7392dfd43e [dev.simd] cmd/compile: generated simd*ops files weren't up to date
I re-ran the generator in arch/internal/simd to
verify a clean move of the intrinsics helpers, and
these changes (which look correct) appeared.

Change-Id: I28a0e8bd144d47aec216f557f238362f238d0428
Reviewed-on: https://go-review.googlesource.com/c/go/+/681499
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
2025-06-13 14:26:44 -07:00
David Chase
00a8dacbe4 [dev.simd] cmd/compile: remove unused simd intrinsics "helpers"
turns out they weren't helpful enough.

Change-Id: I4fa99dc0e7513f25acaddd7fb06451b0134172b9
Reviewed-on: https://go-review.googlesource.com/c/go/+/681498
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
2025-06-13 14:25:44 -07:00
David Chase
b9a548775f cmd/compile: add up-to-date test for generated files
This runs the ssa/_gen generator writing files into
a temporary directory, and then checks that there are
no differences with what is currently in the ssa directory,
and also checks that any file with the "generated from
_gen/..." header was actually generated, and checks that
the headers on the generated file match the expected
header prefix.

Change-Id: Ic8eeb0b06cf6f2e576a013e865b331a12d3a77aa
Reviewed-on: https://go-review.googlesource.com/c/go/+/680615
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
(cherry picked from commit d4c6effaa7)
Reviewed-on: https://go-review.googlesource.com/c/go/+/680975
TryBot-Bypass: David Chase <drchase@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
2025-06-13 13:03:14 -07:00
Junyang Shao
ca01eab9c7 [dev.simd] cmd/compile: add fused mul add sub ops
This CL is generated by CL 680595.

Change-Id: I5e06ea9bc6a62593fc3b00fd44c119a5ed0d9e90
Reviewed-on: https://go-review.googlesource.com/c/go/+/681299
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-06-13 12:15:29 -07:00
Junyang Shao
ded6e0ac71 [dev.simd] cmd/compile: add more dot products
This CL is generated by CL 680215.

Change-Id: Ie085e65e0473a8e96170702d7265d379ec8812ba
Reviewed-on: https://go-review.googlesource.com/c/go/+/681298
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-06-13 12:15:18 -07:00
Junyang Shao
3df41c856e [dev.simd] simd: update documentations
This CL is generated by CL 679955.

Change-Id: Iff92222bfb493730e147e5b7d2cd940d7ca50f1d
Reviewed-on: https://go-review.googlesource.com/c/go/+/681297
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-06-13 12:15:09 -07:00
Junyang Shao
9ba7db36b5 [dev.simd] cmd/compile: add dot product ops
This CL is generated by CL 678515.

Change-Id: Iac7c424bbbffc2514dff3495d6c408fa9c998c2f
Reviewed-on: https://go-review.googlesource.com/c/go/+/681296
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-06-13 11:43:59 -07:00
Junyang Shao
34a9cdef87 [dev.simd] cmd/compile: add round simd ops
This CL is generated by CL 678195.

Change-Id: Ica600229a4e9623fa45f3b5aa370cdd6d9c31686
Reviewed-on: https://go-review.googlesource.com/c/go/+/681295
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-06-13 11:43:48 -07:00
Junyang Shao
5289e0f24e [dev.simd] cmd/compile: updates simd ordering and docs
This CL is generated by CL 681395.

Change-Id: Ic930aeeb24fc7f95a4d74c77403532d0b0eb39ff
Reviewed-on: https://go-review.googlesource.com/c/go/+/681215
Auto-Submit: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2025-06-13 08:02:19 -07:00
Junyang Shao
c81cb05e3e [dev.simd] cmd/compile: add simdGen prog writer
This CL is a synergy between simdgen refactor CL 681195.

Change-Id: I365becf515a261bd22c46824613c2dce309cac45
Reviewed-on: https://go-review.googlesource.com/c/go/+/681036
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-06-13 07:37:47 -07:00
Austin Clements
9b9af3d638 [dev.simd] internal/cpu: add AVX-512-CD and DQ, and derived "basic AVX-512"
This adds detection for the CD and DQ sub-features of x86 AVX-512.

Building on these, we also add a "derived" AVX-512 feature that
bundles together the basic usable subset of subfeatures. Despite the F
in AVX-512-F standing for "foundation", AVX-512-F+BW+DQ+VL together
really form the basic usable subset of AVX-512 functionality. These
have also all been supported together by almost every CPU, and are
guaranteed by GOAMD64=v4, so there's little point in separating them
out.

Change-Id: I34356502bd1853ba2372e48db0b10d55cffe07a1
Reviewed-on: https://go-review.googlesource.com/c/go/+/680899
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-06-13 07:16:03 -07:00
Austin Clements
dfa6c74263 [dev.simd] runtime: eliminate global state in mkpreempt.go
We're going to start writing two files, so having a single global file
we're writing will be a problem.

This has no effect on the generated code.

Change-Id: I49897ea0c6500a29eac89b597d75c0eb3e9b6706
Reviewed-on: https://go-review.googlesource.com/c/go/+/680897
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-06-13 07:15:51 -07:00
Cherry Mui
b2e8ddba3c [dev.simd] all: merge master (773701a) into dev.simd
Merge List:

+ 2025-06-10 773701a853 internal/trace: pass GOTRACEBACK=crash to testprogs
+ 2025-06-10 fb0c27c514 os: do not follow dangling symlinks in Root when O_CREATE|O_EXCL on AIX
+ 2025-06-10 1cafdfb63b net/http: make the zero value of CrossOriginProtection work
+ 2025-06-10 a35701b352 cmd/dist: only install necessary tools when doing local test
+ 2025-06-10 a189516d3a runtime: don't do a direct G handoff in semrelease on systemstack
+ 2025-06-10 f18d046568 all.{bash,rc}: use "../bin/go tool dist" instead of "%GOTOOLDIR%/dist" print build info
+ 2025-06-09 ee7bfbdbcc cmd/compile/internal/ssa: fix PPC64 merging of (AND (S[RL]Dconst ...)
+ 2025-06-09 985d600f3a runtime: use small struct TestSynctest to ensure cleanups run
+ 2025-06-09 848a768ba7 runtime: clarify stack traces for bubbled goroutines
+ 2025-06-09 049a5e6036 runtime: return a different bubble deadlock error when main goroutine is done
+ 2025-06-09 ac1686752b cmd/internal/doc: increase version of pkgsite doc command that's run
+ 2025-06-09 da0e8c4517 cmd/compile: relax reshaping condition
+ 2025-06-09 7800f4f0ad log/slog: fix level doc on handlers
+ 2025-06-07 d184f8dc02 runtime: check for gsignal in racecall on loong64
+ 2025-06-06 0ccfbc834a os/signal: doc link to syscall.EPIPE
+ 2025-06-06 78eadf5b3d all: update vendored dependencies [generated]
+ 2025-06-05 4d1c255f15 net/http: strip sensitive proxy headers from redirect requests
+ 2025-06-04 3432c68467 runtime: make bubbled timers more consistent with unbubbled
+ 2025-06-04 1aa3362093 Revert "cmd/compile: Enable inlining of tail calls"
+ 2025-06-04 f537061e1b cmd/trace: handle Sync event at the beginning of the trace
+ 2025-06-04 d4bf716793 runtime: reduce per-P memory footprint when greenteagc is disabled
+ 2025-06-04 1f2a4d192d test: add another regression test for issue 73309
+ 2025-06-04 5b748eed9c cmd/compile: better error message when import embed package
+ 2025-06-03 cfb4e9bc4a cmd/dist: don't install tools that won't be shipped in distribution
+ 2025-06-03 94764d0938 cmd/doc: build cmd/doc directly into the go command
+ 2025-06-03 74b70eead7 go/token: remove unreachable code
+ 2025-06-03 0c0094c893 go/token: tweak comment
+ 2025-06-03 792548a483 cmd/go/internal/cfg: fix GOROOT setting when forcing host config
+ 2025-06-02 49f6304724 runtime: additional memmove benchmarks
+ 2025-06-02 eebae283b6 go/token: FileSet: hold Files in a balanced tree
+ 2025-06-02 3bd0eab96f runtime: randomize order of timers at the same instant in bubbles
+ 2025-06-02 a379698521 go/{ast,parser,types}: add signpost to golang.org/x/tools/go/packages
+ 2025-06-02 497cb7c0c3 cmd/compile/internal/noder: document quirk of string elements
+ 2025-06-02 cc119ee391 cmd/compile/internal/noder: stub type section and adjust others
+ 2025-06-02 25ca686a0b cmd/compile/internal/noder: begin filling in SectionObj
+ 2025-06-02 11660d537b cmd/compile/internal/noder: fill in SectionName

Change-Id: I7c0a7c56105f1a6912f4ed122d615d12b1ea7877
2025-06-10 14:57:15 -04:00
Michael Anthony Knyszek
773701a853 internal/trace: pass GOTRACEBACK=crash to testprogs
The failures in #70310 are hard to decipher. The cases where the lock is
being held either don't really make sense (the STW failures) or the
goroutine that fails is 'running on another thread' and we don't get a
stack trace. In fact, such a goroutine exists even in the STW cases.
Since reproducing this is going to be hard (very few failures over a 2
year span) let's set GOTRACEBACK=crash for these testprogs so next time
it happens we can see why.

For #70310.

Change-Id: I81a780aa82b173d42973f06911cb243f33352be1
Reviewed-on: https://go-review.googlesource.com/c/go/+/680476
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>
2025-06-10 11:31:20 -07:00
Damien Neil
fb0c27c514 os: do not follow dangling symlinks in Root when O_CREATE|O_EXCL on AIX
OpenFile with O_CREATE|O_EXCL should not follow dangling symlinks.
On AIX it does, because AIX's openat(2) apparently returns ELOOP
in this case. Most Unices return EEXIST.

Ensure that we never follow symlinks in the final component of
the path when opening a file with O_CREATE|O_EXCL.

Fixes #73924

Change-Id: I869afb7faefccb0bb29d155553a7d7e5be80467d
Reviewed-on: https://go-review.googlesource.com/c/go/+/677735
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2025-06-10 11:18:22 -07:00
Austin Clements
1cafdfb63b net/http: make the zero value of CrossOriginProtection work
Currently, CrossOriginProtection must be constructed by
NewCrossOriginProtection. If you try to use the zero value, most
methods will panic with a nil dereference.

This CL makes CrossOriginProtection use on-demand initialization
instead, so the zero value has the same semantics as the value
currently returned by NewCrossOriginProtection. Now,
NewCrossOriginProtection just constructs the zero value.

We keep NewCrossOriginProtection by analogy to NewServeMux.

Updates #73626
Fixes #74089.

Change-Id: Ia80183eb6bfdafb0e002271c0b25c2d6230a159a
Reviewed-on: https://go-review.googlesource.com/c/go/+/680396
Auto-Submit: Austin Clements <austin@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
2025-06-10 11:09:07 -07:00
Michael Matloob
a35701b352 cmd/dist: only install necessary tools when doing local test
Instead of installing all of cmd, install only the tools that cmd/dist
would normally install.

Also, remove the addition of the buildid tool to the list of commands in
the toolchain in debug mode. The uses of buildid were removed in CL 451360.

For #71867

Change-Id: I062909d23c18294aa23ea43b9f7eeb69bfa80c8c
Reviewed-on: https://go-review.googlesource.com/c/go/+/680475
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Matloob <matloob@google.com>
2025-06-10 09:40:33 -07:00
Michael Anthony Knyszek
a189516d3a runtime: don't do a direct G handoff in semrelease on systemstack
semrelease is safe to call on the system stack (since it just readies
goroutines) except for the fact that it might perform a direct G
handoff and call into the scheduler. If handoff is set to false this is
exceptionally rare, but could happen, and has happened for the trace
reader goroutine which releases a trace.doneSema.

Fixes #73469.

Change-Id: I37ece678bc4721bbb6e5879d74daac762b7d742a
Reviewed-on: https://go-review.googlesource.com/c/go/+/680315
Auto-Submit: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2025-06-10 07:07:57 -07:00
Guoqi Chen
f18d046568 all.{bash,rc}: use "../bin/go tool dist" instead of "%GOTOOLDIR%/dist" print build info
After CL 677558, when running all.bash, the binaries of commands such
as dist, nm, and pprof are no longer built by default, so when running
all.bash, "./all.bash: line 13: /home/golang/pkg/tool/linux_amd64/dist:
No such file or directory" will be printed, and the return result of
the all.bash script is non-zero.

Although the "dist" command  won't be installed in $GOTOOLDIR anymore,
but it will be built and cached, and ../bin/go tool dist will reuse the
cached binary.

For #71867

Change-Id: I802eeafdb866e7d80c42da3e0955bb32def7b037
Reviewed-on: https://go-review.googlesource.com/c/go/+/680135
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>
Reviewed-by: Michael Matloob <matloob@golang.org>
2025-06-10 06:00:41 -07:00
Paul Murphy
ee7bfbdbcc cmd/compile/internal/ssa: fix PPC64 merging of (AND (S[RL]Dconst ...)
CL 622236 forgot to check the mask was also a 32 bit rotate mask. Add
a modified version of isPPC64WordRotateMask which valids the mask is
contiguous and fits inside a uint32.

I don't this is possible when merging SRDconst, the first check should
always reject such combines. But, be extra careful and do it there
too.

Fixes #73153

Change-Id: Ie95f74ec5e7d89dc761511126db814f886a7a435
Reviewed-on: https://go-review.googlesource.com/c/go/+/679775
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Jayanth Krishnamurthy <jayanth.krishnamurthy@ibm.com>
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-06-09 20:33:27 -07:00
Junyang Shao
884f646966 [dev.simd] cmd/compile: add fp3m1fp1 shape to regalloc
Change-Id: Ie89cf521f5ae59de1934f6f49bb5fd3f63cc5883
Reviewed-on: https://go-review.googlesource.com/c/go/+/680236
Auto-Submit: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-06-09 13:44:37 -07:00
Junyang Shao
6bc3505773 [dev.simd] cmd/compile: add fp3fp1 regsiter shape
This is to accomodate dot product instructions.

Change-Id: I88b21f848d7a51ad036bb3555c30f12b72571b2b
Reviewed-on: https://go-review.googlesource.com/c/go/+/680235
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Junyang Shao <shaojunyang@google.com>
2025-06-09 11:27:09 -07:00
Damien Neil
985d600f3a runtime: use small struct TestSynctest to ensure cleanups run
Finalizers and cleanup funcs weren't running on the windows-arm64
builder. Put finalizers/cleanups on a small struct containing a pointer
rather than an *int, which fixes the problem.

Also uncomment a synctest.Wait that was accidentally commented out.

Fixes #73977

Change-Id: Ia6f18d74d6fccf2c5a9222317977c7458d67f158
Reviewed-on: https://go-review.googlesource.com/c/go/+/679696
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2025-06-09 11:15:04 -07:00
Damien Neil
848a768ba7 runtime: clarify stack traces for bubbled goroutines
Use the synctest bubble ID to identify bubbles in traces,
rather than the goroutine ID of the bubble's root goroutine.

Some waitReasons include a "(synctest)" suffix to distinguish
a durably blocking state from a non-durable one. For example,
"chan send" vs. "chan send (synctest)". Change this suffix
to "(durable)".

Always print a "(durable)" sufix for the state of durably
blocked bubbled goroutines. For example, print "sleep (durable)".

Drop the "[not] durably blocked" text from goroutine states,
since this is now entirely redundant with the waitReason.

Old:
  goroutine 8 [chan receive (synctest), synctest bubble 7, durably blocked]:
  goroutine 9 [select (no cases), synctest bubble 7, durably blocked]:

New:
  goroutine 8 [chan receive (durable), synctest bubble 1]:
  goroutine 9 [select (no cases) (durable), synctest bubble 1]:

Change-Id: I89112efb25150a98a2954f54d1910ccec52a5824
Reviewed-on: https://go-review.googlesource.com/c/go/+/679376
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2025-06-09 10:58:51 -07:00
Damien Neil
049a5e6036 runtime: return a different bubble deadlock error when main goroutine is done
The synctest.Test function waits for all goroutines in a bubble to
exit before returning. If there is ever a point when all goroutines
in a bubble are durably blocked, it panics and reports a deadlock.

Panic with a different message depending on whether the bubble's
main goroutine has returned or not. The main goroutine returning
stops the bubble clock, so knowing whether it is running or not
is useful debugging information.

The new panic messages are:
	deadlock: all goroutines in bubble are blocked
	deadlock: main bubble goroutine has exited but blocked goroutines remain

Change-Id: I94a69e79121c272d9c86f412c1c9c7de57ef27ef
Reviewed-on: https://go-review.googlesource.com/c/go/+/679375
Auto-Submit: 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>
2025-06-09 10:55:42 -07:00
Michael Matloob
ac1686752b cmd/internal/doc: increase version of pkgsite doc command that's run
This will incorporate the changes in CL 675957, CL 677596, and
CL 675958.

For #73848

Change-Id: Ie3d313e055a36b5b7aafec4a7462a1ced8a9f923
Reviewed-on: https://go-review.googlesource.com/c/go/+/680176
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-06-09 10:32:23 -07:00
Cuong Manh Le
da0e8c4517 cmd/compile: relax reshaping condition
CL 641955 changes the Unified IR reader to not doing shapify when
reading reshaping expression. However, this condition only matters with
pointer type shaping, which will lose the original type, causes the
reshaping ends up with a completely different type.

This CL relaxes the condition, always allow non-pointer types shaping.

Updates #71184
Fixes #73947

Change-Id: Ib0bafd8932c52d99266f311b6cbfc75c00383f9b
Reviewed-on: https://go-review.googlesource.com/c/go/+/678335
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
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>
2025-06-09 09:29:38 -07:00
Jonathan Amsterdam
7800f4f0ad log/slog: fix level doc on handlers
Fixed doc on {JSON,Text}Handler.Handle: the level is never omitted.

Fixes #73943.

Change-Id: Ia470cbe5d713ab18dd80eeea1c0ab8f5e6d30f3f
Reviewed-on: https://go-review.googlesource.com/c/go/+/680055
Auto-Submit: Jonathan Amsterdam <jba@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Sean Liao <sean@liao.dev>
2025-06-09 09:04:58 -07:00
Guoqi Chen
d184f8dc02 runtime: check for gsignal in racecall on loong64
This issue has been fixed for amd64, arm64 and other platforms
in CL 643875, but it was missed when the race support was
submitted for loong64.

Fixes #71395.

Change-Id: I678f381e868214f1b3399be43187db49e1660933
Reviewed-on: https://go-review.googlesource.com/c/go/+/679055
Reviewed-by: Meidan Li <limeidan@loongson.cn>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: sophie zhao <zhaoxiaolin@loongson.cn>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2025-06-07 00:48:37 -07:00
Olivier Mengué
0ccfbc834a os/signal: doc link to syscall.EPIPE
Add godoc link for EPIPE error.

Change-Id: I5df35f700684510328f92bb5d4946c5123ba5f2c
Reviewed-on: https://go-review.googlesource.com/c/go/+/667757
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-06-06 14:05:14 -07:00
Carlos Amedee
78eadf5b3d all: update vendored dependencies [generated]
The Go 1.25 RC is due soon. This is the time to once again update all
golang.org/x/... module versions that contribute packages to the std and
cmd modules in the standard library to latest master versions.

For #36905.

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

cat << EOF | patch
diff --git a/src/cmd/go/testdata/script/test_json_build.txt b/src/cmd/go/testdata/script/test_json_build.txt
index df8863ae03..2a572ace72 100644
--- a/src/cmd/go/testdata/script/test_json_build.txt
+++ b/src/cmd/go/testdata/script/test_json_build.txt
@@ -56,7 +56,7 @@ stdout '"Action":"fail","Package":"m/cycle/p","Elapsed":.*,"FailedBuild":"m/cycl
 ! go test -json -o=$devnull ./veterror
 stdout '"ImportPath":"m/veterror \[m/veterror.test\]","Action":"build-output","Output":"# m/veterror\\n"'
 stdout '"ImportPath":"m/veterror \[m/veterror.test\]","Action":"build-output","Output":"# \[m/veterror\]\\n"'
-stdout '"ImportPath":"m/veterror \[m/veterror.test\]","Action":"build-output","Output":"veterror(/|\\\\)main_test.go:9:9: fmt.Printf format %s reads arg #1, but call has 0 args\\n"'
+stdout '"ImportPath":"m/veterror \[m/veterror.test\]","Action":"build-output","Output":"veterror(/|\\\\)main_test.go:9:21: fmt.Printf format %s reads arg #1, but call has 0 args\\n"'
 stdout '"ImportPath":"m/veterror \[m/veterror.test\]","Action":"build-fail"'
 stdout '"Action":"start","Package":"m/veterror"'
 stdout '"Action":"output","Package":"m/veterror","Output":"FAIL\\tm/veterror \[build failed\]\\n"'
EOF

Change-Id: I6a8d35acdeab90c3bbd6395b8b1abb021673b5cb
Reviewed-on: https://go-review.googlesource.com/c/go/+/678556
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2025-06-06 10:04:27 -07:00
David Chase
2eaa5a0703 [dev.simd] simd: add functions+methods to load-from/store-to slices
Includes the generator (which is short and uncomplicated)
and a few tests.

Change-Id: Icba9de042935a59bee34b278306c241b7651f5b4
Reviewed-on: https://go-review.googlesource.com/c/go/+/679258
Auto-Submit: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2025-06-05 20:58:55 -07:00
Neal Patel
4d1c255f15 net/http: strip sensitive proxy headers from redirect requests
Similarly to Authentication entries, Proxy-Authentication entries should be stripped to ensure sensitive information is not leaked on redirects outside of the original domain.

https://fetch.spec.whatwg.org/#authentication-entries

Thanks to Takeshi Kaneko (GMO Cybersecurity by Ierae, Inc.) for reporting this issue.

For #73816
Fixes CVE-2025-4673

Change-Id: Ied7b641f6531f1d340ccba3c636d3c30dd5547d9
Reviewed-on: https://go-review.googlesource.com/c/go/+/679257
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2025-06-05 11:44:48 -07:00
Junyang Shao
8ecbd59ebb [dev.simd] cmd/compile: generated codes for amd64 SIMD
This CL is generated by tool in CL 667155.

Change-Id: I3829d0d2c96fe7000e2dd025a3006f96957d777a
Reviewed-on: https://go-review.googlesource.com/c/go/+/675618
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Auto-Submit: Junyang Shao <shaojunyang@google.com>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-06-05 11:09:40 -07:00
Damien Neil
3432c68467 runtime: make bubbled timers more consistent with unbubbled
This CL makes two changes to reduce the predictability
with which bubbled timers fire.

When asynctimerchan=0 (the default), regular timers with an associated
channel are only added to a timer heap when some channel operation
is blocked on that channel. This allows us to garbage collect
unreferenced, unstopped timers. Timers in a synctest bubble, in
contrast, are always added to the bubble's timer heap.

This CL changes bubbled timers with a channel to be handled the
same as unbubbled ones, adding them to the bubble's timer heap only
when some channel operation is blocked on the timer's channel.
This permits unstopped bubbled timers to be garbage collected,
but more importantly it makes all timers past their deadline
behave identically, regardless of whether they are in a bubble.

This CL also changes timer scheduling to execute bubbled timers
immediately when possible rather than adding them to a heap.
Timers in a bubble's heap are executed when the bubble is idle.
Executing timers immediately avoids creating a predictable
order of execution.

For #73850
Fixes #73934

Change-Id: If82e441546408f780f6af6fb7f6e416d3160295d
Reviewed-on: https://go-review.googlesource.com/c/go/+/678075
Auto-Submit: 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>
2025-06-04 09:20:21 -07:00
Cherry Mui
1aa3362093 Revert "cmd/compile: Enable inlining of tail calls"
This reverts CL 650455 and CL 655816.

Reason for revert: it causes #73747. Properly fixing it gets into
trickiness with defer/recover, wrapper, and inlining. We're late
in the Go 1.25 release cycle.

Fixes #73747.

Change-Id: Ifb343d522b18fec3fec73a7c886678032ac8e4df
Reviewed-on: https://go-review.googlesource.com/c/go/+/678575
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2025-06-04 08:27:44 -07:00
Michael Anthony Knyszek
f537061e1b cmd/trace: handle Sync event at the beginning of the trace
Currently the code assumes that there's no Sync event at the start of
the trace, but this hasn't been correct for some time. Count Syncs and
look for at least one instead of looking for zero.

Fixes #73962.

Change-Id: I2b4199a21c699c5b50b3d5add37dc46a515108c6
Reviewed-on: https://go-review.googlesource.com/c/go/+/678555
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2025-06-04 08:16:42 -07:00
Michael Anthony Knyszek
d4bf716793 runtime: reduce per-P memory footprint when greenteagc is disabled
There are two additional sources of memory overhead per P that come from
greenteagc. One is for ptrBuf, but on platforms other than Windows it
doesn't actually cost anything due to demand-paging (Windows also
demand-pages, but the memory is 'committed' so it still counts against
OS RSS metrics). The other is for per-sizeclass scan stats. However when
greenteagc is disabled, most of these scan stats are completely unused.

The worst-case memory overhead from these two sources is relatively
small (about 10 KiB per P), but for programs with a small memory
footprint running on a machine with a lot of cores, this can be
significant (single-digit percent).

This change does two things. First, it puts ptrBuf initialization behind
the greenteagc experiment, so now that memory is never allocated by
default. Second, it abstracts the implementation details of scan stat
collection and emission, such that we can have two different
implementations depending on the build tag. This lets us remove all the
unused stats when the greenteagc experiment is disabled, reducing the
memory overhead of the stats from ~2.6 KiB per P to 536 bytes per P.
This is enough to make the difference no longer noticable in our
benchmark suite.

Fixes #73931.

Change-Id: I4351f1cbb3f6743d8f5922d757d73442c6d6ad3f
Reviewed-on: https://go-review.googlesource.com/c/go/+/678535
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2025-06-04 07:43:42 -07:00