[go] simd, cmd/compile: disambiguate AMD64 intrinsics from others

3 views
Skip to first unread message

David Chase (Gerrit)

unread,
Feb 4, 2026, 7:30:02 AM (3 days ago) Feb 4
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

David Chase has uploaded the change for review

Commit message

simd, cmd/compile: disambiguate AMD64 intrinsics from others

Sketching out the plan to add WASM, ran into the glitch of
wanting to put the WASM intrinsics into a separate file.

So, rename ssagen/simdintrinsics.go to ssagen/simdAMD64intrinsics.go.
Change-Id: Ib349754f462fbca71a9135cd4ff2096856a1af59

Change diff

diff --git a/src/cmd/compile/internal/ssagen/intrinsics.go b/src/cmd/compile/internal/ssagen/intrinsics.go
index dbdebd5..0df239b 100644
--- a/src/cmd/compile/internal/ssagen/intrinsics.go
+++ b/src/cmd/compile/internal/ssagen/intrinsics.go
@@ -1641,7 +1641,7 @@

if buildcfg.Experiment.SIMD {
// Only enable intrinsics, if SIMD experiment.
- simdIntrinsics(addF)
+ simdAMD64Intrinsics(addF)

addF(simdPackage, "ClearAVXUpperBits",
func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value {
diff --git a/src/cmd/compile/internal/ssagen/simdintrinsics.go b/src/cmd/compile/internal/ssagen/simdAMD64intrinsics.go
similarity index 99%
rename from src/cmd/compile/internal/ssagen/simdintrinsics.go
rename to src/cmd/compile/internal/ssagen/simdAMD64intrinsics.go
index e505618..d2735d18 100644
--- a/src/cmd/compile/internal/ssagen/simdintrinsics.go
+++ b/src/cmd/compile/internal/ssagen/simdAMD64intrinsics.go
@@ -11,7 +11,7 @@

const simdPackage = "simd/archsimd"

-func simdIntrinsics(addF func(pkg, fn string, b intrinsicBuilder, archFamilies ...sys.ArchFamily)) {
+func simdAMD64Intrinsics(addF func(pkg, fn string, b intrinsicBuilder, archFamilies ...sys.ArchFamily)) {
addF(simdPackage, "Uint8x16.AESDecryptLastRound", opLen2(ssa.OpAESDecryptLastRoundUint8x16, types.TypeVec128), sys.AMD64)
addF(simdPackage, "Uint8x32.AESDecryptLastRound", opLen2(ssa.OpAESDecryptLastRoundUint8x32, types.TypeVec256), sys.AMD64)
addF(simdPackage, "Uint8x64.AESDecryptLastRound", opLen2(ssa.OpAESDecryptLastRoundUint8x64, types.TypeVec512), sys.AMD64)
diff --git a/src/simd/archsimd/_gen/simdgen/gen_simdIntrinsics.go b/src/simd/archsimd/_gen/simdgen/gen_simdIntrinsics.go
index 18722cd..d74af94 100644
--- a/src/simd/archsimd/_gen/simdgen/gen_simdIntrinsics.go
+++ b/src/simd/archsimd/_gen/simdgen/gen_simdIntrinsics.go
@@ -23,7 +23,7 @@

const simdPackage = "` + simdPackage + `"

-func simdIntrinsics(addF func(pkg, fn string, b intrinsicBuilder, archFamilies ...sys.ArchFamily)) {
+func simdAMD64Intrinsics(addF func(pkg, fn string, b intrinsicBuilder, archFamilies ...sys.ArchFamily)) {
{{end}}

{{define "op1"}} addF(simdPackage, "{{(index .In 0).Go}}.{{.Go}}", opLen1(ssa.Op{{.GenericName}}, {{.SSAType}}), sys.AMD64)
diff --git a/src/simd/archsimd/_gen/simdgen/godefs.go b/src/simd/archsimd/_gen/simdgen/godefs.go
index e956c1c..7741b7f 100644
--- a/src/simd/archsimd/_gen/simdgen/godefs.go
+++ b/src/simd/archsimd/_gen/simdgen/godefs.go
@@ -439,7 +439,7 @@
f, fI := writeSIMDStubs(deduped, typeMap)
formatWriteAndClose(f, path, "src/"+simdPackage+"/ops_amd64.go")
formatWriteAndClose(fI, path, "src/"+simdPackage+"/ops_internal_amd64.go")
- formatWriteAndClose(writeSIMDIntrinsics(deduped, typeMap), path, "src/cmd/compile/internal/ssagen/simdintrinsics.go")
+ formatWriteAndClose(writeSIMDIntrinsics(deduped, typeMap), path, "src/cmd/compile/internal/ssagen/simdAMD64intrinsics.go")
formatWriteAndClose(writeSIMDGenericOps(deduped), path, "src/cmd/compile/internal/ssa/_gen/simdgenericOps.go")
formatWriteAndClose(writeSIMDMachineOps(deduped), path, "src/cmd/compile/internal/ssa/_gen/simdAMD64ops.go")
formatWriteAndClose(writeSIMDSSA(deduped), path, "src/cmd/compile/internal/amd64/simdssa.go")
diff --git a/src/simd/archsimd/ops_amd64.go b/src/simd/archsimd/ops_amd64.go
index 9c5bb22..f80d558 100644
--- a/src/simd/archsimd/ops_amd64.go
+++ b/src/simd/archsimd/ops_amd64.go
@@ -5359,7 +5359,7 @@

/* SHA256Message1 */

-// SHA256Message1 does the sigma and addtion of 1 in SHA1 algorithm defined in FIPS 180-4.
+// SHA256Message1 does the sigma and addition of 1 in SHA1 algorithm defined in FIPS 180-4.
// x = {W0, W1, W2, W3}
// y = {W4, 0, 0, 0}
// result = {W0+σ(W1), W1+σ(W2), W2+σ(W3), W3+σ(W4)}

Change information

Files:
  • M src/cmd/compile/internal/ssagen/intrinsics.go
  • R src/cmd/compile/internal/ssagen/simdAMD64intrinsics.go
  • M src/simd/archsimd/_gen/simdgen/gen_simdIntrinsics.go
  • M src/simd/archsimd/_gen/simdgen/godefs.go
  • M src/simd/archsimd/ops_amd64.go
Change size: S
Delta: 5 files changed, 5 insertions(+), 5 deletions(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ib349754f462fbca71a9135cd4ff2096856a1af59
Gerrit-Change-Number: 741900
Gerrit-PatchSet: 1
Gerrit-Owner: David Chase <drc...@google.com>
Gerrit-Reviewer: David Chase <drc...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

David Chase (Gerrit)

unread,
Feb 4, 2026, 8:37:20 AM (3 days ago) Feb 4
to goph...@pubsubhelper.golang.org, Cherry Mui, Junyang Shao, Go LUCI, Gopher Robot, golang-co...@googlegroups.com
Attention needed from Cherry Mui and Junyang Shao

David Chase added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
David Chase . resolved

I was looking at the file organization, and it seemed to me that we might want to have a cleaner split across the architectures, especially when 3rd parties start adding their own SIMD extensions.

Open in Gerrit

Related details

Attention is currently required from:
  • Cherry Mui
  • Junyang Shao
Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib349754f462fbca71a9135cd4ff2096856a1af59
    Gerrit-Change-Number: 741900
    Gerrit-PatchSet: 1
    Gerrit-Owner: David Chase <drc...@google.com>
    Gerrit-Reviewer: Cherry Mui <cher...@google.com>
    Gerrit-Reviewer: David Chase <drc...@google.com>
    Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-Attention: Cherry Mui <cher...@google.com>
    Gerrit-Attention: Junyang Shao <shaoj...@google.com>
    Gerrit-Comment-Date: Wed, 04 Feb 2026 13:37:11 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Junyang Shao (Gerrit)

    unread,
    Feb 4, 2026, 11:04:16 AM (3 days ago) Feb 4
    to David Chase, goph...@pubsubhelper.golang.org, Cherry Mui, Go LUCI, Gopher Robot, golang-co...@googlegroups.com
    Attention needed from Cherry Mui and David Chase

    Junyang Shao voted Code-Review+2

    Code-Review+2
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cherry Mui
    • David Chase
    Submit Requirements:
    • requirement satisfiedCode-Review
    • requirement satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    • requirement satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib349754f462fbca71a9135cd4ff2096856a1af59
    Gerrit-Change-Number: 741900
    Gerrit-PatchSet: 1
    Gerrit-Owner: David Chase <drc...@google.com>
    Gerrit-Reviewer: Cherry Mui <cher...@google.com>
    Gerrit-Reviewer: David Chase <drc...@google.com>
    Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-Attention: Cherry Mui <cher...@google.com>
    Gerrit-Attention: David Chase <drc...@google.com>
    Gerrit-Comment-Date: Wed, 04 Feb 2026 16:04:13 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Cherry Mui (Gerrit)

    unread,
    Feb 5, 2026, 3:34:43 PM (2 days ago) Feb 5
    to David Chase, goph...@pubsubhelper.golang.org, Junyang Shao, Go LUCI, Gopher Robot, golang-co...@googlegroups.com
    Attention needed from David Chase

    Cherry Mui added 1 comment

    Patchset-level comments
    Cherry Mui . resolved

    LGTM. Thanks.

    For the actual Wasm SIMD, I think we want to continue developing on the dev.simd branch, before we commit to the API.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • David Chase
    Submit Requirements:
    • requirement satisfiedCode-Review
    • requirement satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    • requirement satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib349754f462fbca71a9135cd4ff2096856a1af59
    Gerrit-Change-Number: 741900
    Gerrit-PatchSet: 1
    Gerrit-Owner: David Chase <drc...@google.com>
    Gerrit-Reviewer: Cherry Mui <cher...@google.com>
    Gerrit-Reviewer: David Chase <drc...@google.com>
    Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-Attention: David Chase <drc...@google.com>
    Gerrit-Comment-Date: Thu, 05 Feb 2026 20:34:40 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    open
    diffy

    Cherry Mui (Gerrit)

    unread,
    Feb 5, 2026, 3:34:46 PM (2 days ago) Feb 5
    to David Chase, goph...@pubsubhelper.golang.org, Junyang Shao, Go LUCI, Gopher Robot, golang-co...@googlegroups.com
    Attention needed from David Chase

    Cherry Mui voted Code-Review+2

    Code-Review+2
    Open in Gerrit

    Related details

    Attention is currently required from:
    • David Chase
    Submit Requirements:
    • requirement satisfiedCode-Review
    • requirement satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    • requirement satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib349754f462fbca71a9135cd4ff2096856a1af59
    Gerrit-Change-Number: 741900
    Gerrit-PatchSet: 1
    Gerrit-Owner: David Chase <drc...@google.com>
    Gerrit-Reviewer: Cherry Mui <cher...@google.com>
    Gerrit-Reviewer: David Chase <drc...@google.com>
    Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-Attention: David Chase <drc...@google.com>
    Gerrit-Comment-Date: Thu, 05 Feb 2026 20:34:43 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    David Chase (Gerrit)

    unread,
    10:55 AM (4 hours ago) 10:55 AM
    to goph...@pubsubhelper.golang.org, Cherry Mui, Junyang Shao, Go LUCI, Gopher Robot, golang-co...@googlegroups.com

    David Chase abandoned this change.

    View Change

    Abandoned It belongs on go-simd, the easiest way to accomplish that was to make and apply a patch and make a new CL.

    David Chase abandoned this change

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Review
    • requirement satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    • requirement satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: abandon
    satisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages