[go] cmd/compile: add new arm64 assembler data structure

28 views
Skip to first unread message

Junyang Shao (Gerrit)

unread,
Feb 4, 2026, 12:46:17 PMFeb 4
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Junyang Shao has uploaded the change for review

Commit message

cmd/compile: add new arm64 assembler data structure

These data structure will be used for SVE/SVE2.

Original author Eric Fang (@eric...@arm.com)
Change-Id: I3626bafc04522ce7eadeb40dfa3f938e4a046598

Change diff

diff --git a/src/cmd/internal/obj/arm64/a.out.go b/src/cmd/internal/obj/arm64/a.out.go
index 814dba2..ef6c3d0 100644
--- a/src/cmd/internal/obj/arm64/a.out.go
+++ b/src/cmd/internal/obj/arm64/a.out.go
@@ -39,7 +39,8 @@
NFREG = 32 /* number of floating point registers */
)

-// General purpose registers, kept in the low bits of Prog.Reg.
+// Arm64 registers, the order matters, make sure that each
+// kind of register starts numbering from the lowest bit.
const (
// integer
REG_R0 = obj.RBaseARM64 + iota
@@ -143,6 +144,78 @@
REG_V30
REG_V31

+ // SVE(Scalable Vector Extension) scalable vector registers
+ REG_Z0
+ REG_Z1
+ REG_Z2
+ REG_Z3
+ REG_Z4
+ REG_Z5
+ REG_Z6
+ REG_Z7
+ REG_Z8
+ REG_Z9
+ REG_Z10
+ REG_Z11
+ REG_Z12
+ REG_Z13
+ REG_Z14
+ REG_Z15
+ REG_Z16
+ REG_Z17
+ REG_Z18
+ REG_Z19
+ REG_Z20
+ REG_Z21
+ REG_Z22
+ REG_Z23
+ REG_Z24
+ REG_Z25
+ REG_Z26
+ REG_Z27
+ REG_Z28
+ REG_Z29
+ REG_Z30
+ REG_Z31
+
+ // SVE scalable predicate registers
+ REG_P0
+ REG_P1
+ REG_P2
+ REG_P3
+ REG_P4
+ REG_P5
+ REG_P6
+ REG_P7
+ REG_P8
+ REG_P9
+ REG_P10
+ REG_P11
+ REG_P12
+ REG_P13
+ REG_P14
+ REG_P15
+
+ // SVE scalable predicate registers, with predicate-as-counter encoding.
+ // These are actually P registers, but encoded differently.
+ // In order to distinguish with P registers, define them as PN registers.
+ REG_PN0
+ REG_PN1
+ REG_PN2
+ REG_PN3
+ REG_PN4
+ REG_PN5
+ REG_PN6
+ REG_PN7
+ REG_PN8
+ REG_PN9
+ REG_PN10
+ REG_PN11
+ REG_PN12
+ REG_PN13
+ REG_PN14
+ REG_PN15
+
REG_RSP = REG_V31 + 32 // to differentiate ZR/SP, REG_RSP&0x1f = 31
)

@@ -250,6 +323,24 @@
REG_R29: 29,
REG_R30: 30,

+ // SVE predicate registers
+ REG_P0: 48,
+ REG_P1: 49,
+ REG_P2: 50,
+ REG_P3: 51,
+ REG_P4: 52,
+ REG_P5: 53,
+ REG_P6: 54,
+ REG_P7: 55,
+ REG_P8: 56,
+ REG_P9: 57,
+ REG_P10: 58,
+ REG_P11: 59,
+ REG_P12: 60,
+ REG_P13: 61,
+ REG_P14: 62,
+ REG_P15: 63,
+
// floating point
REG_F0: 64,
REG_F1: 65,
@@ -317,6 +408,40 @@
REG_V29: 93,
REG_V30: 94,
REG_V31: 95,
+
+ // SVE vector registers
+ REG_Z0: 96,
+ REG_Z1: 97,
+ REG_Z2: 98,
+ REG_Z3: 99,
+ REG_Z4: 100,
+ REG_Z5: 101,
+ REG_Z6: 102,
+ REG_Z7: 103,
+ REG_Z8: 104,
+ REG_Z9: 105,
+ REG_Z10: 106,
+ REG_Z11: 107,
+ REG_Z12: 108,
+ REG_Z13: 109,
+ REG_Z14: 110,
+ REG_Z15: 111,
+ REG_Z16: 112,
+ REG_Z17: 113,
+ REG_Z18: 114,
+ REG_Z19: 115,
+ REG_Z20: 116,
+ REG_Z21: 117,
+ REG_Z22: 118,
+ REG_Z23: 119,
+ REG_Z24: 120,
+ REG_Z25: 121,
+ REG_Z26: 122,
+ REG_Z27: 123,
+ REG_Z28: 124,
+ REG_Z29: 125,
+ REG_Z30: 126,
+ REG_Z31: 127,
}

const (
@@ -485,6 +610,46 @@
C_XPOST = 1 << 5 // match arm.C_PBIT, so Prog.String know how to print it
)

+type AClass uint16 // operand type
+
+// The classification table below will eventually replace the classification table above.
+// instTab is sorted based on the order of these constants and the first match is chosen.
+//
+//go:generate stringer -type AClass -trimprefix AC_
+const (
+ AC_NONE AClass = iota
+ AC_REG // general purpose registers R0..R30 and ZR
+ AC_RSP // general purpose registers R0..R30 and RSP
+ AC_FREG // floating point registers, such as F1
+ AC_VREG // vector registers, such as V1
+ AC_ZREG // the scalable vector registers, such as Z1
+ AC_PREG // the scalable predicate registers, such as P1
+ AC_PNREG // the scalable predicate registers, with predicate-as-counter encoding, such as PN1
+ AC_PREGM // Pg/M
+ AC_PREGZ // Pg/Z
+ AC_REGIDX // P8[1]
+ AC_PAIR // register pair, such as (R1, R3)
+ AC_REGSHIFT // general purpose register with shift, such as R1<<2
+ AC_REGEXT // general purpose register with extend, such as R7.SXTW<<1
+ AC_ARNG // vector register with arrangement, such as V11.D2
+ AC_ARNGIDX // vector register with arrangement and index, such as V12.D[1]
+
+ AC_IMM // constants
+
+ AC_REGLIST1 // list of 1 vector register, such as [V1]
+ AC_REGLIST2 // list of 2 vector registers, such as [V1, V2], [Z0, Z8]
+ AC_REGLIST3 // list of 3 vector registers, such as [V1, V2, V3]
+ AC_REGLIST4 // list of 4 vector registers, such as [V1, V2, V3, V4], [Z0, Z4, Z8, Z12]
+ AC_LISTIDX // list with index, such as [V1.B, V2.B][2]
+
+ AC_MEMIMM // address with optional offset, the offset is an immediate, such as 4(R1)
+ AC_MEMIMMEXT // address with optional offset, the offset is an immediate with extension, such as (2*VL)(R1)
+ AC_MEMEXT // address with extend offset, such as (R2)(R5.SXTX<<1)
+ AC_MEMPOSTIMM // address of the post-index class, offset is an immediate
+ AC_MEMPOSTREG // address of the post-index class, offset is a register
+ AC_MEMPREIMM // address of the pre-index class, offset is an immediate
+)
+
//go:generate go run ../stringer.go -i $GOFILE -o anames.go -p arm64

const (
diff --git a/src/cmd/internal/obj/arm64/inst.go b/src/cmd/internal/obj/arm64/inst.go
new file mode 100644
index 0000000..4402595
--- /dev/null
+++ b/src/cmd/internal/obj/arm64/inst.go
@@ -0,0 +1,118 @@
+// 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 arm64
+
+import "cmd/internal/obj"
+
+// inst represents an instruction.
+type Inst struct {
+ GoOp obj.As // Go opcode mnemonic
+ ArmOp A64Type // Arm64 opcode mnemonic
+ Feature uint16 // such as "FEAT_LSE", "FEAT_CSSC"
+ FixedBits uint32 // known bits
+ // unknown bits, key is its name
+ VarBits map[string]VarBits
+ Mask uint32 // mask for disassembly, 1 for known bits, 0 for unknown bits
+ Alias bool // whether it is an alias
+ Args []Operand // operands, in Go order
+}
+
+type VarBits struct {
+ // The low and high bit index in the binary encoding, exclusive on hi
+ lo, hi int
+ encoded bool // if true then its value is already encoded
+ bits uint32
+}
+
+// Operand is the operand type of an instruction.
+type Operand struct {
+ Class AClass // operand class, register, constant, memory operation etc.
+ Elms []ElmType // the elements that this operand includes
+}
+
+// A64Type is the Arm64 opcode type, an Arm64 opcode is prefixed with "A64",
+// a Go opcode is defined with a constant and is prefixed with "A".
+type A64Type uint16
+
+// ElmType is the element type, an element represents a symbol of a specific encoding form,
+// such as <Xn>, #<uimm4>, <T>.
+type ElmType struct {
+ // The natural language encoding text.
+ // e.g. '''
+ // <T> Is the size specifier, encoded in size:
+ //
+ // size <T>
+ // 00 B
+ // 01 H
+ // 10 S
+ // 11 D
+ // '''
+ encodingText string
+ encodingName string // key in VarBits
+ // The AI-implemented encoding func.
+ encodingFunc func(uint32) uint32
+}
+
+func (i *Inst) bin() uint32 {
+ bits := i.FixedBits
+ for _, v := range i.VarBits {
+ if !v.encoded {
+ panic("encoding incomplete")
+ }
+ bits |= v.bits
+ }
+ return bits
+}
+
+type Icmp []Inst
+
+func (x Icmp) Len() int {
+ return len(x)
+}
+
+func (x Icmp) Swap(i, j int) {
+ x[i], x[j] = x[j], x[i]
+}
+
+func (x Icmp) Less(i, j int) bool {
+ p1 := &x[i]
+ p2 := &x[j]
+ if p1.GoOp != p2.GoOp {
+ return p1.GoOp < p2.GoOp
+ }
+ if len(p1.Args) != len(p2.Args) {
+ return len(p1.Args) < len(p2.Args)
+ }
+ for k := 0; k < len(p1.Args); k++ {
+ if p1.Args[k].Class != p2.Args[k].Class {
+ return p1.Args[k].Class < p2.Args[k].Class
+ }
+ }
+ if p1.FixedBits != p2.FixedBits {
+ return p1.FixedBits < p2.FixedBits
+ }
+ if p1.Mask != p2.Mask {
+ return p1.Mask < p2.Mask
+ }
+ return false
+}
+
+// These constants represent Arm a-profile architecture extensions. For details,
+// please refer to the Arm a-profile architecture reference manual.
+// Update this table if new extensions are found when parsing the XML files.
+const (
+ FEAT_NONE uint16 = iota
+ FEAT_SVE2p1
+ // Scalable Vector AES instructions.
+ FEAT_SVE_AES
+ FEAT_SVE_B16B16
+ // Scalable Vector Bit Permutes instructions.
+ FEAT_SVE_BitPerm
+ // Scalable Vector PMULL instructions.
+ FEAT_SVE_PMULL128
+ // Scalable Vector SHA3 instructions.
+ FEAT_SVE_SHA3
+ FEAT_SVE_SM4
+)

Change information

Files:
  • M src/cmd/internal/obj/arm64/a.out.go
  • A src/cmd/internal/obj/arm64/inst.go
Change size: L
Delta: 2 files changed, 284 insertions(+), 1 deletion(-)
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: I3626bafc04522ce7eadeb40dfa3f938e4a046598
Gerrit-Change-Number: 742020
Gerrit-PatchSet: 1
Gerrit-Owner: Junyang Shao <shaoj...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Junyang Shao (Gerrit)

unread,
Feb 5, 2026, 11:37:03 PMFeb 5
to goph...@pubsubhelper.golang.org, Cherry Mui, David Chase, golang-co...@googlegroups.com

Junyang Shao abandoned this change.

View Change

Abandoned

Junyang Shao abandoned this change

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: abandon
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I3626bafc04522ce7eadeb40dfa3f938e4a046598
Gerrit-Change-Number: 742020
Gerrit-PatchSet: 2
Gerrit-Owner: Junyang Shao <shaoj...@google.com>
Gerrit-Reviewer: Cherry Mui <cher...@google.com>
Gerrit-Reviewer: David Chase <drc...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Junyang Shao (Gerrit)

unread,
Feb 5, 2026, 11:40:41 PMFeb 5
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Junyang Shao has uploaded the change for review

Commit message

cmd/compile: add new arm64 assembler data structure

These data structure will be used for SVE/SVE2.

Original author Eric Fang (@eric...@arm.com)
Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd

Change diff

index 0000000..4ccef4a
--- /dev/null
+++ b/src/cmd/internal/obj/arm64/inst.go
@@ -0,0 +1,109 @@

+// 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 arm64
+
+import "cmd/internal/obj"
+
+// inst represents an instruction.
+type Inst struct {
+ GoOp obj.As // Go opcode mnemonic
+ ArmOp A64Type // Arm64 opcode mnemonic
+	Feature   uint16  // Such as "FEAT_SVE"
+ FixedBits uint32 // Known bits
+ // Unknown bits, key is its name

+ VarBits map[string]VarBits
+	Mask    uint32    // Mask for disassembly, 1 for known bits, 0 for unknown bits
+ Alias bool // Whether it is an alias
+ Args []Operand // Operands, in Go order

+}
+
+type VarBits struct {
+ // The low and high bit index in the binary encoding, exclusive on hi
+ lo, hi int
+	encoded bool // If true then its value is already encoded

+ bits uint32
+}
+
+// Operand is the operand type of an instruction.
+type Operand struct {
+	Class AClass // Operand class, register, constant, memory operation etc.
+ Text string // The text representation of this operand, e.g. <Pg>/Z.
+ // The elements that this operand includes, this only includes the encoding-related parts
+ Elms []ElmType

+}
+
+// A64Type is the Arm64 opcode type, an Arm64 opcode is prefixed with "A64",
+// a Go opcode is defined with a constant and is prefixed with "A".
+type A64Type uint16
+
+// ElmType is the element type, an element represents a symbol of a specific encoding form,
+// such as <Xn>, #<uimm4>, <T>.
+type ElmType struct {
+	encodingName string // The key in VarBits
Delta: 2 files changed, 275 insertions(+), 1 deletion(-)
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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
Gerrit-Change-Number: 742620
unsatisfied_requirement
satisfied_requirement
open
diffy

Junyang Shao (Gerrit)

unread,
Feb 22, 2026, 11:02:27 PMFeb 22
to goph...@pubsubhelper.golang.org, David Chase, Cherry Mui, golang-co...@googlegroups.com
Attention needed from Cherry Mui and David Chase

Junyang Shao voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Cherry Mui
  • David Chase
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: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
Gerrit-Change-Number: 742620
Gerrit-PatchSet: 9
Gerrit-Owner: Junyang Shao <shaoj...@google.com>
Gerrit-Reviewer: Cherry Mui <cher...@google.com>
Gerrit-Reviewer: David Chase <drc...@google.com>
Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
Gerrit-Attention: Cherry Mui <cher...@google.com>
Gerrit-Attention: David Chase <drc...@google.com>
Gerrit-Comment-Date: Mon, 23 Feb 2026 04:02:23 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Junyang Shao (Gerrit)

unread,
Feb 23, 2026, 1:30:35 AMFeb 23
to goph...@pubsubhelper.golang.org, Go LUCI, David Chase, Cherry Mui, golang-co...@googlegroups.com
Attention needed from Cherry Mui and David Chase

Junyang Shao added 1 comment

Patchset-level comments
File-level comment, Patchset 9 (Latest):
Junyang Shao . unresolved

Ah, I am sorry I put these CLs in the main branch.

I will cherry-pick them to dev.simd later.

I am not expecting code changes so please proceed with reviews 😊

Open in Gerrit

Related details

Attention is currently required from:
  • Cherry Mui
  • David Chase
Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not 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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
    Gerrit-Change-Number: 742620
    Gerrit-PatchSet: 9
    Gerrit-Owner: Junyang Shao <shaoj...@google.com>
    Gerrit-Reviewer: Cherry Mui <cher...@google.com>
    Gerrit-Reviewer: David Chase <drc...@google.com>
    Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
    Gerrit-Attention: Cherry Mui <cher...@google.com>
    Gerrit-Attention: David Chase <drc...@google.com>
    Gerrit-Comment-Date: Mon, 23 Feb 2026 06:30:31 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Junyang Shao (Gerrit)

    unread,
    Feb 23, 2026, 1:52:52 AMFeb 23
    to goph...@pubsubhelper.golang.org, Go LUCI, David Chase, Cherry Mui, golang-co...@googlegroups.com
    Attention needed from Cherry Mui and David Chase

    Junyang Shao added 1 comment

    File src/cmd/internal/obj/arm64/inst.go
    Line 72, Patchset 9 (Latest):func a64ElmBinFrom(a *obj.Addr, acl AClass, index int) uint32 {
    switch acl {
    Junyang Shao . resolved

    The assembly parser will need to follow the assumption of this function when filling in progs.

    Gerrit-Comment-Date: Mon, 23 Feb 2026 06:52:48 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Junyang Shao (Gerrit)

    unread,
    Feb 23, 2026, 2:00:02 AMFeb 23
    to goph...@pubsubhelper.golang.org, Go LUCI, David Chase, Cherry Mui, golang-co...@googlegroups.com
    Attention needed from Cherry Mui and David Chase

    Junyang Shao added 1 comment

    File src/cmd/internal/obj/arm64/inst.go
    Line 72, Patchset 9 (Latest):func a64ElmBinFrom(a *obj.Addr, acl AClass, index int) uint32 {
    switch acl {
    Junyang Shao . resolved

    The assembly parser will need to follow the assumption of this function when filling in progs.

    Junyang Shao

    I am thinking about just make the SVE a special path in the parser as well.

    That will make the implementation much easier 😕.

    There might be slightly more codes and increased binary size, but I assume it wouldn't be more than 1k LOC, so should be negligible.

    Gerrit-Comment-Date: Mon, 23 Feb 2026 06:59:58 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Junyang Shao <shaoj...@google.com>
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Junyang Shao (Gerrit)

    unread,
    Feb 23, 2026, 2:08:39 AMFeb 23
    to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
    Attention needed from Cherry Mui and David Chase

    Junyang Shao uploaded new patchset

    Junyang Shao uploaded patch set #10 to this change.
    Following approvals got outdated and were removed:
    • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cherry Mui
    • David Chase
    Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement is not 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: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
      Gerrit-Change-Number: 742620
      Gerrit-PatchSet: 10
      unsatisfied_requirement
      open
      diffy

      Junyang Shao (Gerrit)

      unread,
      Feb 23, 2026, 2:09:18 AMFeb 23
      to goph...@pubsubhelper.golang.org, Go LUCI, David Chase, Cherry Mui, golang-co...@googlegroups.com
      Attention needed from Cherry Mui and David Chase

      Junyang Shao voted Commit-Queue+1

      Commit-Queue+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Cherry Mui
      • David Chase
      Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement is not 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: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
      Gerrit-Change-Number: 742620
      Gerrit-PatchSet: 10
      Gerrit-Owner: Junyang Shao <shaoj...@google.com>
      Gerrit-Reviewer: Cherry Mui <cher...@google.com>
      Gerrit-Reviewer: David Chase <drc...@google.com>
      Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
      Gerrit-Attention: Cherry Mui <cher...@google.com>
      Gerrit-Attention: David Chase <drc...@google.com>
      Gerrit-Comment-Date: Mon, 23 Feb 2026 07:09:15 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      unsatisfied_requirement
      open
      diffy

      David Chase (Gerrit)

      unread,
      Feb 23, 2026, 1:42:52 PMFeb 23
      to Junyang Shao, goph...@pubsubhelper.golang.org, Go LUCI, Cherry Mui, golang-co...@googlegroups.com
      Attention needed from Cherry Mui and Junyang Shao

      David Chase voted and added 2 comments

      Votes added by David Chase

      Code-Review+2

      2 comments

      File src/cmd/internal/obj/arm64/inst.go
      Line 33, Patchset 10 (Latest): // They are represented as a list of pointer to the encoding func
      David Chase . unresolved

      I need to know more about this. Looking at the code that calls these functions, it looks like some operands encode into more than one set of bits, and each function generates some more bits, and they must all be OR'd together. But I don't have a lot of confidence in that interpretation, so I think what ever is really going on (including this, if my guess is right) ought to be mentioned here.

      And also, all the encoding functions need to work, otherwise, it's a failed encoding.

      Line 81, Patchset 10 (Latest): // Offset[5:8] = arrangement or predication
      David Chase . unresolved

      This is like Go slice notation, so 5:8 == {5,6,7}?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Cherry Mui
      • Junyang Shao
      Submit Requirements:
      • requirement satisfiedCode-Review
      • requirement is not 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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
      Gerrit-Change-Number: 742620
      Gerrit-PatchSet: 10
      Gerrit-Owner: Junyang Shao <shaoj...@google.com>
      Gerrit-Reviewer: Cherry Mui <cher...@google.com>
      Gerrit-Reviewer: David Chase <drc...@google.com>
      Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
      Gerrit-Attention: Cherry Mui <cher...@google.com>
      Gerrit-Attention: Junyang Shao <shaoj...@google.com>
      Gerrit-Comment-Date: Mon, 23 Feb 2026 18:42:49 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Junyang Shao (Gerrit)

      unread,
      Feb 23, 2026, 1:46:27 PMFeb 23
      to goph...@pubsubhelper.golang.org, David Chase, Go LUCI, Cherry Mui, golang-co...@googlegroups.com
      Attention needed from Cherry Mui and David Chase

      Junyang Shao added 2 comments

      File src/cmd/internal/obj/arm64/inst.go
      Line 33, Patchset 10 (Latest): // They are represented as a list of pointer to the encoding func
      David Chase . unresolved

      I need to know more about this. Looking at the code that calls these functions, it looks like some operands encode into more than one set of bits, and each function generates some more bits, and they must all be OR'd together. But I don't have a lot of confidence in that interpretation, so I think what ever is really going on (including this, if my guess is right) ought to be mentioned here.

      And also, all the encoding functions need to work, otherwise, it's a failed encoding.

      Junyang Shao

      Thanks for the review!

      What is your worry about this interpretation? I think OR-ing bits together is what the assembler do all the time.

      Line 81, Patchset 10 (Latest): // Offset[5:8] = arrangement or predication
      David Chase . resolved

      This is like Go slice notation, so 5:8 == {5,6,7}?

      Junyang Shao

      Yes, that's what is mean.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Cherry Mui
      • David Chase
      Submit Requirements:
      • requirement satisfiedCode-Review
      • requirement is not 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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
      Gerrit-Change-Number: 742620
      Gerrit-PatchSet: 10
      Gerrit-Owner: Junyang Shao <shaoj...@google.com>
      Gerrit-Reviewer: Cherry Mui <cher...@google.com>
      Gerrit-Reviewer: David Chase <drc...@google.com>
      Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
      Gerrit-Attention: Cherry Mui <cher...@google.com>
      Gerrit-Attention: David Chase <drc...@google.com>
      Gerrit-Comment-Date: Mon, 23 Feb 2026 18:46:24 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: David Chase <drc...@google.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Junyang Shao (Gerrit)

      unread,
      Feb 23, 2026, 5:38:06 PMFeb 23
      to goph...@pubsubhelper.golang.org, David Chase, Go LUCI, Cherry Mui, golang-co...@googlegroups.com
      Attention needed from Cherry Mui and David Chase

      Junyang Shao added 2 comments

      File src/cmd/internal/obj/arm64/a.out.go
      Line 157, Patchset 10 (Latest): REG_Z0 = obj.RBaseARM64 + 768 + iota
      REG_Z1
      REG_Z2
      Junyang Shao . unresolved

      Maybe RSP+1 as the range start point

      File src/cmd/internal/obj/arm64/inst.go
      Line 39, Patchset 10 (Latest):// aclass returns the AClass of an Addr.
      // Right now AClass is just stored at the lower 5 bits of the Offset field...
      func aclass(a *obj.Addr) AClass {
      return AClass(a.Offset & 0x1f)
      }
      Junyang Shao . unresolved

      Put into any

      Gerrit-Comment-Date: Mon, 23 Feb 2026 22:38:02 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Cherry Mui (Gerrit)

      unread,
      Feb 24, 2026, 10:51:59 AMFeb 24
      to Junyang Shao, goph...@pubsubhelper.golang.org, David Chase, Go LUCI, golang-co...@googlegroups.com
      Attention needed from David Chase and Junyang Shao

      Cherry Mui added 20 comments

      Commit Message
      Line 32, Patchset 10 (Latest):Original author Eric Fang (@eric...@arm.com)
      Cherry Mui . unresolved

      Maybe reference CL number. Also remove the "@" before the email.

      File src/cmd/internal/obj/arm64/a.out.go
      Line 148, Patchset 10 (Latest):// SVE(Scalable Vector Extension) scalable vector registers
      Cherry Mui . unresolved

      Add a space before (.

      Line 150, Patchset 10 (Latest):// We use an offset of 768 to avoid colliding with other registers.
      Cherry Mui . unresolved

      It is better for the registers to be consecutive. We could change others, LSL or ARNG. I still don't think they should be registers (but that can be addressed later).

      Line 208, Patchset 10 (Latest): // SVE scalable predicate registers, with predicate-as-counter encoding.

      // These are actually P registers, but encoded differently.
      // In order to distinguish with P registers, define them as PN registers.
      Cherry Mui . unresolved

      The question here is what we want from user assembly code. Do we want user to write Pn, or PNn, for those?

      If the former, I think they should not be defined as registers. Instead, we should track which encoding to use internally.

      If it is the latter, what is the reason user cares and chooses which one to write?

      An example would be good.

      Line 454, Patchset 10 (Latest):}
      Cherry Mui . unresolved

      Why not P registers? DWARF doesn't understand them?

      Line 624, Patchset 10 (Latest):// The classification table below will eventually replace the classification table above.
      Cherry Mui . unresolved

      It is unclear whether this is the goal. Integer instructions can still use the old path, and there are special logic there, especially handling large constants and offsets. I think that should be evaluated separately.

      Line 636, Patchset 10 (Latest): AC_PREGM // Pg/M
      Cherry Mui . unresolved

      Use Go syntax. Have we decided to use "/" syntax? That seems a bit weird.

      Line 652, Patchset 10 (Latest): AC_MEMIMM // address with optional offset, the offset is an immediate, such as 4(Z1.D)
      Cherry Mui . unresolved

      "address with optional constant offset"?

      Maybe name it AC_MEMOFF?

      Line 653, Patchset 10 (Latest): AC_MEMIMMEXT // address with optional offset, the offset is an immediate with extension, such as (2*VL)(Z1.D)
      Cherry Mui . unresolved

      The example doesn't look like "immediate with extension".

      Line 654, Patchset 10 (Latest): AC_MEMEXT // address with extend offset, such as (Z2.D.UXTW<<3)(RSP)
      Cherry Mui . unresolved

      "address with register offset with extension"?

      Line 660, Patchset 10 (Latest): AC_VL // VLxi pattern, one of: VLx2, VLx4.
      Cherry Mui . unresolved

      Is this multiply? Use `*` to match the assembly syntax.

      Line 661, Patchset 10 (Latest): AC_PREFETCH // Prefetch pattern, such as PLDL1KEEP
      Cherry Mui . unresolved

      Limiting it to prefetch seems to special. There are other special symbolic operands (and probably be more in the future). Maybe AC_SPECIAL.

      File src/cmd/internal/obj/arm64/inst.go
      Line 13, Patchset 10 (Latest):type Inst struct {
      Cherry Mui . unresolved

      Most types probably could be unexported.

      Line 16, Patchset 10 (Latest): Alias bool // Whether it is an alias
      Cherry Mui . unresolved

      Why the assembler needs to know this?

      Line 27, Patchset 10 (Latest):type A64BinarySymbolName uint16
      Cherry Mui . unresolved

      The "A64" prefix doesn't seem helpful. This is the arm64 assembler, so everything is A64. Drop them, everywhere.

      Line 36, Patchset 10 (Latest): ElemEncodings []func(uint32) (uint32, A64BinarySymbolName, bool)
      Cherry Mui . unresolved

      elemEncoders

      Perhaps use "encoder" for encoding functions, everywhere.

      Line 49, Patchset 10 (Latest): var curI int
      if p.From.Type != obj.TYPE_NONE {
      if curI == i {
      return &p.From
      }
      curI++
      }
      for j := range p.RestArgs {
      if curI == i {
      return &p.RestArgs[j].Addr
      }
      curI++
      }
      if p.To.Type != obj.TYPE_NONE {
      if curI == i {
      return &p.To
      }
      }
      Cherry Mui . unresolved

      This seems a rather inefficient way to iterate over the operands. Depending on how it is used, maybe rewrite to a more efficient way.

      (See also the comment in tryEncode below.)

      Line 71, Patchset 10 (Latest):// a64ElmBinFrom returns the binary of the stored elm in a at index, for operand of type aclass.
      Cherry Mui . unresolved

      What is "the stored elm"? "Element", or at least "elem", is probably more clear, at least in comment. (For variables, feel free to choose the name.)

      Line 72, Patchset 10 (Latest):func a64ElmBinFrom(a *obj.Addr, acl AClass, index int) uint32 {
      Cherry Mui . unresolved

      Maybe "encodeAddr"?

      Line 488, Patchset 10 (Latest):func (i *Inst) tryEncodeA64Inst(p *obj.Prog) (uint32, bool) {
      Cherry Mui . unresolved

      Just "tryEncode".

      How is a Prog supposed to be converted to an Inst? It looks like this function expects the Inst to already be populated. But it still needs to classify each operand in the prog. That seems confusing. What is the expected workflow here?

      In general, I would think we want to either work with only Prog and Addr, or do a translation them work only with Inst and Operand, not both at same time in most code.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • David Chase
      • Junyang Shao
      Submit Requirements:
      • requirement satisfiedCode-Review
      • requirement is not 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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
      Gerrit-Change-Number: 742620
      Gerrit-PatchSet: 10
      Gerrit-Owner: Junyang Shao <shaoj...@google.com>
      Gerrit-Reviewer: Cherry Mui <cher...@google.com>
      Gerrit-Reviewer: David Chase <drc...@google.com>
      Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
      Gerrit-Attention: David Chase <drc...@google.com>
      Gerrit-Attention: Junyang Shao <shaoj...@google.com>
      Gerrit-Comment-Date: Tue, 24 Feb 2026 15:51:53 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Junyang Shao (Gerrit)

      unread,
      Feb 24, 2026, 3:42:36 PMFeb 24
      to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
      Attention needed from David Chase and Junyang Shao

      Junyang Shao uploaded new patchset

      Junyang Shao uploaded patch set #11 to this change.
      Following approvals got outdated and were removed:
      • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI

      Related details

      Attention is currently required from:
      • David Chase
      • Junyang Shao
      Submit Requirements:
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: newpatchset
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
        Gerrit-Change-Number: 742620
        Gerrit-PatchSet: 11
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Junyang Shao (Gerrit)

        unread,
        Feb 24, 2026, 3:59:03 PMFeb 24
        to goph...@pubsubhelper.golang.org, David Chase, Go LUCI, Cherry Mui, golang-co...@googlegroups.com
        Attention needed from Cherry Mui and David Chase

        Junyang Shao voted and added 21 comments

        Votes added by Junyang Shao

        Commit-Queue+1

        21 comments

        Patchset-level comments
        File-level comment, Patchset 12 (Latest):
        Junyang Shao . unresolved

        Please move the reviews to CL 748600

        Commit Message
        Line 32, Patchset 10:Original author Eric Fang (@eric...@arm.com)
        Cherry Mui . resolved

        Maybe reference CL number. Also remove the "@" before the email.

        Junyang Shao

        Done

        File src/cmd/internal/obj/arm64/a.out.go
        Line 148, Patchset 10:// SVE(Scalable Vector Extension) scalable vector registers
        Cherry Mui . resolved

        Add a space before (.

        Junyang Shao

        Done

        Line 208, Patchset 10: // SVE scalable predicate registers, with predicate-as-counter encoding.

        // These are actually P registers, but encoded differently.
        // In order to distinguish with P registers, define them as PN registers.
        Cherry Mui . resolved

        The question here is what we want from user assembly code. Do we want user to write Pn, or PNn, for those?

        If the former, I think they should not be defined as registers. Instead, we should track which encoding to use internally.

        If it is the latter, what is the reason user cares and chooses which one to write?

        An example would be good.

        Junyang Shao

        Initially I thought Eric kept them separate for deduplication purposes.

        But I tried to merge `AC_PREG` and `AC_PNREG` in the generator, no duplication was found. I think it's safe to remove them then. It looks like `PN` reg always comes with different peer operands compared to `P` reg in instructions.

        If later I find out that they are needed I will add them back, in that case I think we want to user to write them as `P` or `PN` specifically.

        A imaginary example which isn't found by my generator's logic:
        ```
        FANTOMI <Zn>.<T>, <P>.<T>
        FANTOMI <Zn>.<T>, <PN>.<T>
        ```
        Without the users specifying them explicitly, they will be indistinguishable.

        Line 454, Patchset 10:}
        Cherry Mui . resolved

        Why not P registers? DWARF doesn't understand them?

        Junyang Shao

        I think P registers are listed above?

        Line 624, Patchset 10:// The classification table below will eventually replace the classification table above.
        Cherry Mui . resolved

        It is unclear whether this is the goal. Integer instructions can still use the old path, and there are special logic there, especially handling large constants and offsets. I think that should be evaluated separately.

        Junyang Shao

        That's right, I have removed the comment, thanks.

        Line 636, Patchset 10: AC_PREGM // Pg/M
        Cherry Mui . resolved

        Use Go syntax. Have we decided to use "/" syntax? That seems a bit weird.

        Junyang Shao

        Sorry, yes they should be Pg.M and Pg.Z

        Line 652, Patchset 10: AC_MEMIMM // address with optional offset, the offset is an immediate, such as 4(Z1.D)
        Cherry Mui . resolved

        "address with optional constant offset"?

        Maybe name it AC_MEMOFF?

        Junyang Shao

        Done

        Line 653, Patchset 10: AC_MEMIMMEXT // address with optional offset, the offset is an immediate with extension, such as (2*VL)(Z1.D)
        Cherry Mui . resolved

        The example doesn't look like "immediate with extension".

        Junyang Shao

        `2` is the immediate here.
        This is an concrete example in GNU mnemonic:
        `[<Xn|SP>{, #<imm>, MUL VL}]`.

        `MUL VL` is the hardware vector size extension denotation.

        Actually this is the only form of this class, I changed its name to `AC_MEMOFFMULVL`

        Line 654, Patchset 10: AC_MEMEXT // address with extend offset, such as (Z2.D.UXTW<<3)(RSP)
        Cherry Mui . resolved

        "address with register offset with extension"?

        Junyang Shao

        Done

        Line 660, Patchset 10: AC_VL // VLxi pattern, one of: VLx2, VLx4.
        Cherry Mui . resolved

        Is this multiply? Use `*` to match the assembly syntax.

        Junyang Shao

        Done

        Line 661, Patchset 10: AC_PREFETCH // Prefetch pattern, such as PLDL1KEEP
        Cherry Mui . resolved

        Limiting it to prefetch seems to special. There are other special symbolic operands (and probably be more in the future). Maybe AC_SPECIAL.

        Junyang Shao

        Hmm you are right, I also merge it with AC_VL, they are both now AC_SPECIAL

        File src/cmd/internal/obj/arm64/inst.go
        Line 13, Patchset 10:type Inst struct {
        Cherry Mui . resolved

        Most types probably could be unexported.

        Junyang Shao

        Done

        Line 16, Patchset 10: Alias bool // Whether it is an alias
        Cherry Mui . resolved

        Why the assembler needs to know this?

        Junyang Shao

        That probably is for the disassembler, I have removed it.

        Line 27, Patchset 10:type A64BinarySymbolName uint16
        Cherry Mui . resolved

        The "A64" prefix doesn't seem helpful. This is the arm64 assembler, so everything is A64. Drop them, everywhere.

        Junyang Shao

        Done

        Line 33, Patchset 10: // They are represented as a list of pointer to the encoding func
        David Chase . resolved

        I need to know more about this. Looking at the code that calls these functions, it looks like some operands encode into more than one set of bits, and each function generates some more bits, and they must all be OR'd together. But I don't have a lot of confidence in that interpretation, so I think what ever is really going on (including this, if my guess is right) ought to be mentioned here.

        And also, all the encoding functions need to work, otherwise, it's a failed encoding.

        Junyang Shao

        Thanks for the review!

        What is your worry about this interpretation? I think OR-ing bits together is what the assembler do all the time.

        Junyang Shao

        Done

        Line 36, Patchset 10: ElemEncodings []func(uint32) (uint32, A64BinarySymbolName, bool)
        Cherry Mui . resolved

        elemEncoders

        Perhaps use "encoder" for encoding functions, everywhere.

        Junyang Shao

        Done


        if p.From.Type != obj.TYPE_NONE {
        if curI == i {
        return &p.From
        }
        curI++
        }
        for j := range p.RestArgs {
        if curI == i {
        return &p.RestArgs[j].Addr
        }
        curI++
        }
        if p.To.Type != obj.TYPE_NONE {
        if curI == i {
        return &p.To
        }
        }
        Cherry Mui . resolved

        This seems a rather inefficient way to iterate over the operands. Depending on how it is used, maybe rewrite to a more efficient way.

        (See also the comment in tryEncode below.)

        Junyang Shao

        Yeah I realize that this is very inefficient, I have ported it to its only callsite, and there shouldn't be O(n^2) iterations now.

        Line 71, Patchset 10:// a64ElmBinFrom returns the binary of the stored elm in a at index, for operand of type aclass.
        Cherry Mui . resolved

        What is "the stored elm"? "Element", or at least "elem", is probably more clear, at least in comment. (For variables, feel free to choose the name.)

        Junyang Shao

        Chose "element"

        Line 72, Patchset 10:func a64ElmBinFrom(a *obj.Addr, acl AClass, index int) uint32 {
        Cherry Mui . resolved

        Maybe "encodeAddr"?

        Junyang Shao

        Done

        Line 488, Patchset 10:func (i *Inst) tryEncodeA64Inst(p *obj.Prog) (uint32, bool) {
        Cherry Mui . resolved

        Just "tryEncode".

        How is a Prog supposed to be converted to an Inst? It looks like this function expects the Inst to already be populated. But it still needs to classify each operand in the prog. That seems confusing. What is the expected workflow here?

        In general, I would think we want to either work with only Prog and Addr, or do a translation them work only with Inst and Operand, not both at same time in most code.

        Junyang Shao

        The Inst (`i`) here is the pre-populated entry in the instruction table (which is generated by the generator, which will be the next CL in the chain), it's just like an optab entry. So this is the logic to match a prog to an Inst, and along the matching, if it's a success then it returns the binary. The reason that this is a `tryEncode` instead of `encode` is documented in the CL description, also in the comment of `elemEncoder`.

        I think this layer of Inst -> Prog interop has to be somewhere to lower prog to inst, in asm7 it is scattered around various of switch cases, here they are just processed in a centralized stage which is this function. You can find an example of the workflow in the test I added (CL 747920).

        I have made the addr accesses better, thanks.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Cherry Mui
        • David Chase
        Submit Requirements:
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        • requirement is not 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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
        Gerrit-Change-Number: 742620
        Gerrit-PatchSet: 12
        Gerrit-Owner: Junyang Shao <shaoj...@google.com>
        Gerrit-Reviewer: Cherry Mui <cher...@google.com>
        Gerrit-Reviewer: David Chase <drc...@google.com>
        Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
        Gerrit-Attention: Cherry Mui <cher...@google.com>
        Gerrit-Attention: David Chase <drc...@google.com>
        Gerrit-Comment-Date: Tue, 24 Feb 2026 20:58:59 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        Comment-In-Reply-To: Cherry Mui <cher...@google.com>
        Comment-In-Reply-To: David Chase <drc...@google.com>
        Comment-In-Reply-To: Junyang Shao <shaoj...@google.com>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Junyang Shao (Gerrit)

        unread,
        Feb 25, 2026, 3:19:12 PMFeb 25
        to goph...@pubsubhelper.golang.org, Go LUCI, David Chase, Cherry Mui, golang-co...@googlegroups.com
        Attention needed from Cherry Mui and David Chase

        Junyang Shao voted Commit-Queue+1

        Commit-Queue+1
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Cherry Mui
        • David Chase
        Submit Requirements:
          • requirement satisfiedCode-Review
          • requirement is not 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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
          Gerrit-Change-Number: 742620
          Gerrit-PatchSet: 12
          Gerrit-Owner: Junyang Shao <shaoj...@google.com>
          Gerrit-Reviewer: Cherry Mui <cher...@google.com>
          Gerrit-Reviewer: David Chase <drc...@google.com>
          Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
          Gerrit-Attention: Cherry Mui <cher...@google.com>
          Gerrit-Attention: David Chase <drc...@google.com>
          Gerrit-Comment-Date: Wed, 25 Feb 2026 20:19:07 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Junyang Shao (Gerrit)

          unread,
          Feb 25, 2026, 3:33:22 PMFeb 25
          to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
          Attention needed from Cherry Mui, David Chase and Junyang Shao

          Junyang Shao uploaded new patchset

          Junyang Shao uploaded patch set #13 to this change.
          Following approvals got outdated and were removed:
          • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Cherry Mui
          • David Chase
          • Junyang Shao
          Submit Requirements:
            • requirement satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement satisfiedReview-Enforcement
            • requirement is not satisfiedTryBots-Pass
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: newpatchset
            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
            Gerrit-Change-Number: 742620
            Gerrit-PatchSet: 13
            Gerrit-Owner: Junyang Shao <shaoj...@google.com>
            Gerrit-Reviewer: Cherry Mui <cher...@google.com>
            Gerrit-Reviewer: David Chase <drc...@google.com>
            Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
            Gerrit-Attention: Cherry Mui <cher...@google.com>
            Gerrit-Attention: David Chase <drc...@google.com>
            Gerrit-Attention: Junyang Shao <shaoj...@google.com>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Cherry Mui (Gerrit)

            unread,
            Feb 25, 2026, 7:02:06 PMFeb 25
            to Junyang Shao, goph...@pubsubhelper.golang.org, Go LUCI, David Chase, golang-co...@googlegroups.com
            Attention needed from David Chase and Junyang Shao

            Cherry Mui added 4 comments

            Patchset-level comments
            File-level comment, Patchset 13 (Latest):
            Cherry Mui . unresolved

            Apparently some comments are marked as resolved but the code is not updated. Please address them. Thanks.

            File src/cmd/internal/obj/arm64/a.out.go
            Line 208, Patchset 10: // SVE scalable predicate registers, with predicate-as-counter encoding.
            // These are actually P registers, but encoded differently.
            // In order to distinguish with P registers, define them as PN registers.
            Cherry Mui . unresolved

            The question here is what we want from user assembly code. Do we want user to write Pn, or PNn, for those?

            If the former, I think they should not be defined as registers. Instead, we should track which encoding to use internally.

            If it is the latter, what is the reason user cares and chooses which one to write?

            An example would be good.

            Junyang Shao

            Initially I thought Eric kept them separate for deduplication purposes.

            But I tried to merge `AC_PREG` and `AC_PNREG` in the generator, no duplication was found. I think it's safe to remove them then. It looks like `PN` reg always comes with different peer operands compared to `P` reg in instructions.

            If later I find out that they are needed I will add them back, in that case I think we want to user to write them as `P` or `PN` specifically.

            A imaginary example which isn't found by my generator's logic:
            ```
            FANTOMI <Zn>.<T>, <P>.<T>
            FANTOMI <Zn>.<T>, <PN>.<T>
            ```
            Without the users specifying them explicitly, they will be indistinguishable.

            Cherry Mui

            The question is whether they need to be distinguishable. Are the two instructions do exactly the same thing? Just different encodings? If they do exactly the same thing we can just choose one encoding. It is okay we never encode the other form.

             I think it's safe to remove them then.

            Let's try that.

            File src/cmd/internal/obj/arm64/inst.go
            Line 49, Patchset 10: var curI int
            if p.From.Type != obj.TYPE_NONE {
            if curI == i {
            return &p.From
            }
            curI++
            }
            for j := range p.RestArgs {
            if curI == i {
            return &p.RestArgs[j].Addr
            }
            curI++
            }
            if p.To.Type != obj.TYPE_NONE {
            if curI == i {
            return &p.To
            }
            }
            Cherry Mui . unresolved

            This seems a rather inefficient way to iterate over the operands. Depending on how it is used, maybe rewrite to a more efficient way.

            (See also the comment in tryEncode below.)

            Junyang Shao

            Yeah I realize that this is very inefficient, I have ported it to its only callsite, and there shouldn't be O(n^2) iterations now.

            Cherry Mui
            If you need to iterate over operands, you probably could write it as an iterator. Something like
            ```
            func operands(p *Prog) (...) {
            return func(yield func(*Addr) bool) {
            if p.From.Type != obj.TYPE_NONE {
            if !yield(&p.From) { return }
            }
            for _, a := range p.RestArgs {
            if !yield(&a.Addr) { return }
            }
            ...
            }
            }
            ```
            Line 488, Patchset 10:func (i *Inst) tryEncodeA64Inst(p *obj.Prog) (uint32, bool) {
            Cherry Mui . unresolved

            Just "tryEncode".

            How is a Prog supposed to be converted to an Inst? It looks like this function expects the Inst to already be populated. But it still needs to classify each operand in the prog. That seems confusing. What is the expected workflow here?

            In general, I would think we want to either work with only Prog and Addr, or do a translation them work only with Inst and Operand, not both at same time in most code.

            Junyang Shao

            The Inst (`i`) here is the pre-populated entry in the instruction table (which is generated by the generator, which will be the next CL in the chain), it's just like an optab entry. So this is the logic to match a prog to an Inst, and along the matching, if it's a success then it returns the binary. The reason that this is a `tryEncode` instead of `encode` is documented in the CL description, also in the comment of `elemEncoder`.

            I think this layer of Inst -> Prog interop has to be somewhere to lower prog to inst, in asm7 it is scattered around various of switch cases, here they are just processed in a centralized stage which is this function. You can find an example of the workflow in the test I added (CL 747920).

            I have made the addr accesses better, thanks.

            Cherry Mui

            Reading it again, I think what you want to do is that you want to compute the encoder functions of a Prog, and work on the Prog and Addr. The `Inst` is actually an encoder, which doesn't carry data. That is a reasonable approach.

            If this is the case, we should make the name clearer. Instead of `Inst` and `Operand`, probably `encoder` and `fieldEncoder` (or `argEncoder`). So the workflow is, when a Prog comes in, we compute its encoder based on its As and operand classes, and use the encoder (which includes a list of argEncoder's) to encode the Addr's.

            Either way, I think we need to make the workflow clear. Let's write an example with one instruction. And document in a comment.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • David Chase
            • Junyang Shao
            Submit Requirements:
            • requirement satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement satisfiedReview-Enforcement
            • requirement is not 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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
            Gerrit-Change-Number: 742620
            Gerrit-PatchSet: 13
            Gerrit-Owner: Junyang Shao <shaoj...@google.com>
            Gerrit-Reviewer: Cherry Mui <cher...@google.com>
            Gerrit-Reviewer: David Chase <drc...@google.com>
            Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
            Gerrit-Attention: David Chase <drc...@google.com>
            Gerrit-Attention: Junyang Shao <shaoj...@google.com>
            Gerrit-Comment-Date: Thu, 26 Feb 2026 00:01:34 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Cherry Mui <cher...@google.com>
            Comment-In-Reply-To: Junyang Shao <shaoj...@google.com>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Junyang Shao (Gerrit)

            unread,
            Feb 26, 2026, 11:05:00 AMFeb 26
            to goph...@pubsubhelper.golang.org, Go LUCI, David Chase, Cherry Mui, golang-co...@googlegroups.com
            Attention needed from Cherry Mui and David Chase

            Junyang Shao added 1 comment

            Patchset-level comments
            Cherry Mui . unresolved

            Apparently some comments are marked as resolved but the code is not updated. Please address them. Thanks.

            Junyang Shao

            Yeah they were addressed in the dev.simd cherrypicks, I haven't sync that back... Will do :D

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Cherry Mui
            • David Chase
            Submit Requirements:
            • requirement satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement satisfiedReview-Enforcement
            • requirement is not 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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
            Gerrit-Change-Number: 742620
            Gerrit-PatchSet: 13
            Gerrit-Owner: Junyang Shao <shaoj...@google.com>
            Gerrit-Reviewer: Cherry Mui <cher...@google.com>
            Gerrit-Reviewer: David Chase <drc...@google.com>
            Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
            Gerrit-Attention: Cherry Mui <cher...@google.com>
            Gerrit-Attention: David Chase <drc...@google.com>
            Gerrit-Comment-Date: Thu, 26 Feb 2026 16:04:48 +0000
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Junyang Shao (Gerrit)

            unread,
            Feb 26, 2026, 3:34:07 PMFeb 26
            to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
            Attention needed from David Chase

            Junyang Shao uploaded new patchset

            Junyang Shao uploaded patch set #14 to this change.
            Open in Gerrit

            Related details

            Attention is currently required from:
            • David Chase
            Submit Requirements:
            • requirement satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement satisfiedReview-Enforcement
            • requirement is not satisfiedTryBots-Pass
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: newpatchset
            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
            Gerrit-Change-Number: 742620
            Gerrit-PatchSet: 14
            Gerrit-Owner: Junyang Shao <shaoj...@google.com>
            Gerrit-Reviewer: Cherry Mui <cher...@google.com>
            Gerrit-Reviewer: David Chase <drc...@google.com>
            Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
            Gerrit-Attention: David Chase <drc...@google.com>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Junyang Shao (Gerrit)

            unread,
            Feb 26, 2026, 3:34:19 PMFeb 26
            to goph...@pubsubhelper.golang.org, Go LUCI, David Chase, Cherry Mui, golang-co...@googlegroups.com
            Attention needed from Cherry Mui and David Chase

            Junyang Shao added 5 comments

            Patchset-level comments
            File-level comment, Patchset 9:
            Junyang Shao . resolved

            Ah, I am sorry I put these CLs in the main branch.

            I will cherry-pick them to dev.simd later.

            I am not expecting code changes so please proceed with reviews 😊

            Junyang Shao

            Done

            File-level comment, Patchset 12:
            Junyang Shao . resolved

            Please move the reviews to CL 748600

            Junyang Shao

            Done

            Apparently some comments are marked as resolved but the code is not updated. Please address them. Thanks.

            Junyang Shao

            Yeah they were addressed in the dev.simd cherrypicks, I haven't sync that back... Will do :D

            Junyang Shao

            Done

            File src/cmd/internal/obj/arm64/a.out.go
            Line 208, Patchset 10: // SVE scalable predicate registers, with predicate-as-counter encoding.
            // These are actually P registers, but encoded differently.
            // In order to distinguish with P registers, define them as PN registers.
            Cherry Mui . resolved

            The question here is what we want from user assembly code. Do we want user to write Pn, or PNn, for those?

            If the former, I think they should not be defined as registers. Instead, we should track which encoding to use internally.

            If it is the latter, what is the reason user cares and chooses which one to write?

            An example would be good.

            Junyang Shao

            Initially I thought Eric kept them separate for deduplication purposes.

            But I tried to merge `AC_PREG` and `AC_PNREG` in the generator, no duplication was found. I think it's safe to remove them then. It looks like `PN` reg always comes with different peer operands compared to `P` reg in instructions.

            If later I find out that they are needed I will add them back, in that case I think we want to user to write them as `P` or `PN` specifically.

            A imaginary example which isn't found by my generator's logic:
            ```
            FANTOMI <Zn>.<T>, <P>.<T>
            FANTOMI <Zn>.<T>, <PN>.<T>
            ```
            Without the users specifying them explicitly, they will be indistinguishable.

            Cherry Mui

            The question is whether they need to be distinguishable. Are the two instructions do exactly the same thing? Just different encodings? If they do exactly the same thing we can just choose one encoding. It is okay we never encode the other form.

             I think it's safe to remove them then.

            Let's try that.

            Junyang Shao

            Done

            File src/cmd/internal/obj/arm64/inst.go
            Line 49, Patchset 10: var curI int
            if p.From.Type != obj.TYPE_NONE {
            if curI == i {
            return &p.From
            }
            curI++
            }
            for j := range p.RestArgs {
            if curI == i {
            return &p.RestArgs[j].Addr
            }
            curI++
            }
            if p.To.Type != obj.TYPE_NONE {
            if curI == i {
            return &p.To
            }
            }
            Cherry Mui . resolved

            This seems a rather inefficient way to iterate over the operands. Depending on how it is used, maybe rewrite to a more efficient way.

            (See also the comment in tryEncode below.)

            Junyang Shao

            Yeah I realize that this is very inefficient, I have ported it to its only callsite, and there shouldn't be O(n^2) iterations now.

            Cherry Mui
            If you need to iterate over operands, you probably could write it as an iterator. Something like
            ```
            func operands(p *Prog) (...) {
            return func(yield func(*Addr) bool) {
            if p.From.Type != obj.TYPE_NONE {
            if !yield(&p.From) { return }
            }
            for _, a := range p.RestArgs {
            if !yield(&a.Addr) { return }
            }
            ...
            }
            }
            ```
            Junyang Shao

            Done

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Cherry Mui
            • David Chase
            Submit Requirements:
            • requirement satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement satisfiedReview-Enforcement
            • requirement is not 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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
            Gerrit-Change-Number: 742620
            Gerrit-PatchSet: 14
            Gerrit-Owner: Junyang Shao <shaoj...@google.com>
            Gerrit-Reviewer: Cherry Mui <cher...@google.com>
            Gerrit-Reviewer: David Chase <drc...@google.com>
            Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
            Gerrit-Attention: Cherry Mui <cher...@google.com>
            Gerrit-Attention: David Chase <drc...@google.com>
            Gerrit-Comment-Date: Thu, 26 Feb 2026 20:34:16 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Cherry Mui <cher...@google.com>
            Comment-In-Reply-To: Junyang Shao <shaoj...@google.com>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Junyang Shao (Gerrit)

            unread,
            Feb 26, 2026, 5:08:39 PMFeb 26
            to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
            Attention needed from Cherry Mui and David Chase

            Junyang Shao uploaded new patchset

            Junyang Shao uploaded patch set #15 to this change.
            Open in Gerrit

            Related details

            Attention is currently required from:
            • Cherry Mui
            • David Chase
            Submit Requirements:
            • requirement satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement satisfiedReview-Enforcement
            • requirement is not satisfiedTryBots-Pass
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: newpatchset
            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
            Gerrit-Change-Number: 742620
            Gerrit-PatchSet: 15
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Junyang Shao (Gerrit)

            unread,
            Feb 26, 2026, 5:08:57 PMFeb 26
            to goph...@pubsubhelper.golang.org, Go LUCI, David Chase, Cherry Mui, golang-co...@googlegroups.com
            Attention needed from Cherry Mui and David Chase

            Junyang Shao voted and added 4 comments

            Votes added by Junyang Shao

            Commit-Queue+1

            4 comments

            File src/cmd/internal/obj/arm64/a.out.go
            Line 150, Patchset 10:// We use an offset of 768 to avoid colliding with other registers.
            Cherry Mui . resolved

            It is better for the registers to be consecutive. We could change others, LSL or ARNG. I still don't think they should be registers (but that can be addressed later).

            Junyang Shao

            Done

            Line 157, Patchset 10: REG_Z0 = obj.RBaseARM64 + 768 + iota
            REG_Z1
            REG_Z2
            Junyang Shao . resolved

            Maybe RSP+1 as the range start point

            Junyang Shao

            Done

            File src/cmd/internal/obj/arm64/inst.go
            Line 39, Patchset 10:// aclass returns the AClass of an Addr.

            // Right now AClass is just stored at the lower 5 bits of the Offset field...
            func aclass(a *obj.Addr) AClass {
            return AClass(a.Offset & 0x1f)
            }
            Junyang Shao . resolved

            Put into any

            Junyang Shao

            I don't think I should put `aclass` in prog anymore, so closing this comment.

            Line 488, Patchset 10:func (i *Inst) tryEncodeA64Inst(p *obj.Prog) (uint32, bool) {
            Cherry Mui . unresolved

            Just "tryEncode".

            How is a Prog supposed to be converted to an Inst? It looks like this function expects the Inst to already be populated. But it still needs to classify each operand in the prog. That seems confusing. What is the expected workflow here?

            In general, I would think we want to either work with only Prog and Addr, or do a translation them work only with Inst and Operand, not both at same time in most code.

            Junyang Shao

            The Inst (`i`) here is the pre-populated entry in the instruction table (which is generated by the generator, which will be the next CL in the chain), it's just like an optab entry. So this is the logic to match a prog to an Inst, and along the matching, if it's a success then it returns the binary. The reason that this is a `tryEncode` instead of `encode` is documented in the CL description, also in the comment of `elemEncoder`.

            I think this layer of Inst -> Prog interop has to be somewhere to lower prog to inst, in asm7 it is scattered around various of switch cases, here they are just processed in a centralized stage which is this function. You can find an example of the workflow in the test I added (CL 747920).

            I have made the addr accesses better, thanks.

            Cherry Mui

            Reading it again, I think what you want to do is that you want to compute the encoder functions of a Prog, and work on the Prog and Addr. The `Inst` is actually an encoder, which doesn't carry data. That is a reasonable approach.

            If this is the case, we should make the name clearer. Instead of `Inst` and `Operand`, probably `encoder` and `fieldEncoder` (or `argEncoder`). So the workflow is, when a Prog comes in, we compute its encoder based on its As and operand classes, and use the encoder (which includes a list of argEncoder's) to encode the Addr's.

            Either way, I think we need to make the workflow clear. Let's write an example with one instruction. And document in a comment.

            Junyang Shao

            Thanks! Working on it.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Cherry Mui
            • David Chase
            Submit Requirements:
            • requirement satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement satisfiedReview-Enforcement
            • requirement is not 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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
            Gerrit-Change-Number: 742620
            Gerrit-PatchSet: 14
            Gerrit-Owner: Junyang Shao <shaoj...@google.com>
            Gerrit-Reviewer: Cherry Mui <cher...@google.com>
            Gerrit-Reviewer: David Chase <drc...@google.com>
            Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
            Gerrit-Attention: Cherry Mui <cher...@google.com>
            Gerrit-Attention: David Chase <drc...@google.com>
            Gerrit-Comment-Date: Thu, 26 Feb 2026 22:08:53 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Junyang Shao (Gerrit)

            unread,
            Feb 26, 2026, 5:09:05 PMFeb 26
            to goph...@pubsubhelper.golang.org, Go LUCI, David Chase, Cherry Mui, golang-co...@googlegroups.com
            Attention needed from Cherry Mui and David Chase

            Junyang Shao voted Commit-Queue+1

            Commit-Queue+1
            Open in Gerrit

            Related details

            Attention is currently required from:
            • Cherry Mui
            • David Chase
            Submit Requirements:
            • requirement satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement satisfiedReview-Enforcement
            • requirement is not 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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
            Gerrit-Change-Number: 742620
            Gerrit-PatchSet: 15
            Gerrit-Owner: Junyang Shao <shaoj...@google.com>
            Gerrit-Reviewer: Cherry Mui <cher...@google.com>
            Gerrit-Reviewer: David Chase <drc...@google.com>
            Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
            Gerrit-Attention: Cherry Mui <cher...@google.com>
            Gerrit-Attention: David Chase <drc...@google.com>
            Gerrit-Comment-Date: Thu, 26 Feb 2026 22:09:02 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Junyang Shao (Gerrit)

            unread,
            Feb 26, 2026, 5:32:07 PMFeb 26
            to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
            Attention needed from Cherry Mui and David Chase

            Junyang Shao uploaded new patchset

            Junyang Shao uploaded patch set #16 to this change.
            Following approvals got outdated and were removed:
            • Code-Review: +2 by David Chase
            • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI

            Related details

            Attention is currently required from:
            • Cherry Mui
            • David Chase
            Submit Requirements:
            • requirement is not satisfiedCode-Review
            • requirement is not 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: newpatchset
            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
            Gerrit-Change-Number: 742620
            Gerrit-PatchSet: 16
            unsatisfied_requirement
            open
            diffy

            Junyang Shao (Gerrit)

            unread,
            Feb 26, 2026, 5:37:27 PMFeb 26
            to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
            Attention needed from Cherry Mui and David Chase

            Junyang Shao uploaded new patchset

            Junyang Shao uploaded patch set #17 to this change.
            Open in Gerrit

            Related details

            Attention is currently required from:
            • Cherry Mui
            • David Chase
            Submit Requirements:
            • requirement is not satisfiedCode-Review
            • requirement is not 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: newpatchset
            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
            Gerrit-Change-Number: 742620
            Gerrit-PatchSet: 17
            unsatisfied_requirement
            open
            diffy

            Junyang Shao (Gerrit)

            unread,
            Feb 26, 2026, 6:38:15 PMFeb 26
            to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
            Attention needed from Cherry Mui and David Chase

            Junyang Shao uploaded new patchset

            Junyang Shao uploaded patch set #18 to this change.
            Open in Gerrit

            Related details

            Attention is currently required from:
            • Cherry Mui
            • David Chase
            Submit Requirements:
            • requirement is not satisfiedCode-Review
            • requirement is not 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: newpatchset
            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
            Gerrit-Change-Number: 742620
            Gerrit-PatchSet: 18
            unsatisfied_requirement
            open
            diffy

            Junyang Shao (Gerrit)

            unread,
            Feb 26, 2026, 11:49:24 PMFeb 26
            to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
            Attention needed from Cherry Mui and David Chase

            Junyang Shao uploaded new patchset

            Junyang Shao uploaded patch set #19 to this change.
            Open in Gerrit

            Related details

            Attention is currently required from:
            • Cherry Mui
            • David Chase
            Submit Requirements:
            • requirement is not satisfiedCode-Review
            • requirement is not 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: newpatchset
            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
            Gerrit-Change-Number: 742620
            Gerrit-PatchSet: 19
            unsatisfied_requirement
            open
            diffy

            Junyang Shao (Gerrit)

            unread,
            Feb 26, 2026, 11:50:14 PMFeb 26
            to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
            Attention needed from Cherry Mui and David Chase

            Junyang Shao uploaded new patchset

            Junyang Shao uploaded patch set #20 to this change.
            Open in Gerrit

            Related details

            Attention is currently required from:
            • Cherry Mui
            • David Chase
            Submit Requirements:
            • requirement is not satisfiedCode-Review
            • requirement is not 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: newpatchset
            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
            Gerrit-Change-Number: 742620
            Gerrit-PatchSet: 20
            unsatisfied_requirement
            open
            diffy

            Junyang Shao (Gerrit)

            unread,
            Feb 27, 2026, 12:35:43 AMFeb 27
            to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
            Attention needed from Cherry Mui and David Chase

            Junyang Shao uploaded new patchset

            Junyang Shao uploaded patch set #21 to this change.
            Open in Gerrit

            Related details

            Attention is currently required from:
            • Cherry Mui
            • David Chase
            Submit Requirements:
            • requirement is not satisfiedCode-Review
            • requirement is not 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: newpatchset
            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
            Gerrit-Change-Number: 742620
            Gerrit-PatchSet: 21
            unsatisfied_requirement
            open
            diffy

            Junyang Shao (Gerrit)

            unread,
            Feb 27, 2026, 12:36:32 AMFeb 27
            to goph...@pubsubhelper.golang.org, Go LUCI, David Chase, Cherry Mui, golang-co...@googlegroups.com
            Attention needed from Cherry Mui and David Chase

            Junyang Shao voted and added 1 comment

            Votes added by Junyang Shao

            Commit-Queue+1

            1 comment

            File src/cmd/internal/obj/arm64/inst.go
            Line 488, Patchset 10:func (i *Inst) tryEncodeA64Inst(p *obj.Prog) (uint32, bool) {
            Cherry Mui . resolved

            Just "tryEncode".

            How is a Prog supposed to be converted to an Inst? It looks like this function expects the Inst to already be populated. But it still needs to classify each operand in the prog. That seems confusing. What is the expected workflow here?

            In general, I would think we want to either work with only Prog and Addr, or do a translation them work only with Inst and Operand, not both at same time in most code.

            Junyang Shao

            The Inst (`i`) here is the pre-populated entry in the instruction table (which is generated by the generator, which will be the next CL in the chain), it's just like an optab entry. So this is the logic to match a prog to an Inst, and along the matching, if it's a success then it returns the binary. The reason that this is a `tryEncode` instead of `encode` is documented in the CL description, also in the comment of `elemEncoder`.

            I think this layer of Inst -> Prog interop has to be somewhere to lower prog to inst, in asm7 it is scattered around various of switch cases, here they are just processed in a centralized stage which is this function. You can find an example of the workflow in the test I added (CL 747920).

            I have made the addr accesses better, thanks.

            Cherry Mui

            Reading it again, I think what you want to do is that you want to compute the encoder functions of a Prog, and work on the Prog and Addr. The `Inst` is actually an encoder, which doesn't carry data. That is a reasonable approach.

            If this is the case, we should make the name clearer. Instead of `Inst` and `Operand`, probably `encoder` and `fieldEncoder` (or `argEncoder`). So the workflow is, when a Prog comes in, we compute its encoder based on its As and operand classes, and use the encoder (which includes a list of argEncoder's) to encode the Addr's.

            Either way, I think we need to make the workflow clear. Let's write an example with one instruction. And document in a comment.

            Junyang Shao

            Thanks! Working on it.

            Junyang Shao

            I have added a e2e test, now the assembler can assemble
            `ZADD` (we add the prefix `Z` to all SVE instructions that takes a Z, for deduplication purposes.)

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Cherry Mui
            • David Chase
            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: comment
              Gerrit-Project: go
              Gerrit-Branch: master
              Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
              Gerrit-Change-Number: 742620
              Gerrit-PatchSet: 21
              Gerrit-Owner: Junyang Shao <shaoj...@google.com>
              Gerrit-Reviewer: Cherry Mui <cher...@google.com>
              Gerrit-Reviewer: David Chase <drc...@google.com>
              Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
              Gerrit-Attention: Cherry Mui <cher...@google.com>
              Gerrit-Attention: David Chase <drc...@google.com>
              Gerrit-Comment-Date: Fri, 27 Feb 2026 05:36:29 +0000
              unsatisfied_requirement
              satisfied_requirement
              open
              diffy

              Junyang Shao (Gerrit)

              unread,
              Feb 27, 2026, 12:37:31 AMFeb 27
              to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
              Attention needed from Cherry Mui, David Chase and Junyang Shao

              Junyang Shao uploaded new patchset

              Junyang Shao uploaded patch set #22 to this change.
              Open in Gerrit

              Related details

              Attention is currently required from:
              • Cherry Mui
              • David Chase
              • Junyang Shao
              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: newpatchset
              Gerrit-Project: go
              Gerrit-Branch: master
              Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
              Gerrit-Change-Number: 742620
              Gerrit-PatchSet: 22
              Gerrit-Owner: Junyang Shao <shaoj...@google.com>
              Gerrit-Reviewer: Cherry Mui <cher...@google.com>
              Gerrit-Reviewer: David Chase <drc...@google.com>
              Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
              Gerrit-Attention: Cherry Mui <cher...@google.com>
              Gerrit-Attention: David Chase <drc...@google.com>
              Gerrit-Attention: Junyang Shao <shaoj...@google.com>
              unsatisfied_requirement
              satisfied_requirement
              open
              diffy

              Junyang Shao (Gerrit)

              unread,
              Feb 27, 2026, 12:37:35 AMFeb 27
              to goph...@pubsubhelper.golang.org, Go LUCI, David Chase, Cherry Mui, golang-co...@googlegroups.com
              Attention needed from Cherry Mui and David Chase

              Junyang Shao voted Commit-Queue+1

              Commit-Queue+1
              Open in Gerrit

              Related details

              Attention is currently required from:
              • Cherry Mui
              • David Chase
              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: comment
              Gerrit-Project: go
              Gerrit-Branch: master
              Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
              Gerrit-Change-Number: 742620
              Gerrit-PatchSet: 22
              Gerrit-Owner: Junyang Shao <shaoj...@google.com>
              Gerrit-Reviewer: Cherry Mui <cher...@google.com>
              Gerrit-Reviewer: David Chase <drc...@google.com>
              Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
              Gerrit-Attention: Cherry Mui <cher...@google.com>
              Gerrit-Attention: David Chase <drc...@google.com>
              Gerrit-Comment-Date: Fri, 27 Feb 2026 05:37:32 +0000
              Gerrit-HasComments: No
              Gerrit-Has-Labels: Yes
              unsatisfied_requirement
              satisfied_requirement
              open
              diffy

              Junyang Shao (Gerrit)

              unread,
              Feb 27, 2026, 11:34:25 AMFeb 27
              to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
              Attention needed from Cherry Mui and David Chase

              Junyang Shao uploaded new patchset

              Junyang Shao uploaded patch set #23 to this change.
              Open in Gerrit

              Related details

              Attention is currently required from:
              • Cherry Mui
              • David Chase
              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: newpatchset
                Gerrit-Project: go
                Gerrit-Branch: master
                Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                Gerrit-Change-Number: 742620
                Gerrit-PatchSet: 23
                unsatisfied_requirement
                satisfied_requirement
                open
                diffy

                Junyang Shao (Gerrit)

                unread,
                Feb 27, 2026, 2:59:52 PMFeb 27
                to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                Attention needed from Cherry Mui and David Chase

                Junyang Shao uploaded new patchset

                Junyang Shao uploaded patch set #24 to this change.
                Following approvals got outdated and were removed:
                • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI

                Related details

                Attention is currently required from:
                • Cherry Mui
                • David Chase
                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: newpatchset
                  Gerrit-Project: go
                  Gerrit-Branch: master
                  Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                  Gerrit-Change-Number: 742620
                  Gerrit-PatchSet: 24
                  unsatisfied_requirement
                  satisfied_requirement
                  open
                  diffy

                  Junyang Shao (Gerrit)

                  unread,
                  Feb 27, 2026, 3:00:56 PMFeb 27
                  to goph...@pubsubhelper.golang.org, Go LUCI, David Chase, Cherry Mui, golang-co...@googlegroups.com
                  Attention needed from Cherry Mui and David Chase

                  Junyang Shao voted Commit-Queue+1

                  Commit-Queue+1
                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Cherry Mui
                  • David Chase
                  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: comment
                  Gerrit-Project: go
                  Gerrit-Branch: master
                  Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                  Gerrit-Change-Number: 742620
                  Gerrit-PatchSet: 24
                  Gerrit-Owner: Junyang Shao <shaoj...@google.com>
                  Gerrit-Reviewer: Cherry Mui <cher...@google.com>
                  Gerrit-Reviewer: David Chase <drc...@google.com>
                  Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
                  Gerrit-Attention: Cherry Mui <cher...@google.com>
                  Gerrit-Attention: David Chase <drc...@google.com>
                  Gerrit-Comment-Date: Fri, 27 Feb 2026 20:00:52 +0000
                  Gerrit-HasComments: No
                  Gerrit-Has-Labels: Yes
                  unsatisfied_requirement
                  satisfied_requirement
                  open
                  diffy

                  Junyang Shao (Gerrit)

                  unread,
                  Feb 27, 2026, 3:22:39 PMFeb 27
                  to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                  Attention needed from Cherry Mui, David Chase and Junyang Shao

                  Junyang Shao uploaded new patchset

                  Junyang Shao uploaded patch set #25 to this change.
                  Following approvals got outdated and were removed:
                  • TryBots-Pass: LUCI-TryBot-Result-1 by Go LUCI
                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Cherry Mui
                  • David Chase
                  • Junyang Shao
                  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: newpatchset
                  Gerrit-Project: go
                  Gerrit-Branch: master
                  Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                  Gerrit-Change-Number: 742620
                  Gerrit-PatchSet: 25
                  Gerrit-Owner: Junyang Shao <shaoj...@google.com>
                  Gerrit-Reviewer: Cherry Mui <cher...@google.com>
                  Gerrit-Reviewer: David Chase <drc...@google.com>
                  Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
                  Gerrit-Attention: Cherry Mui <cher...@google.com>
                  Gerrit-Attention: David Chase <drc...@google.com>
                  Gerrit-Attention: Junyang Shao <shaoj...@google.com>
                  unsatisfied_requirement
                  satisfied_requirement
                  open
                  diffy

                  Junyang Shao (Gerrit)

                  unread,
                  Feb 27, 2026, 3:22:49 PMFeb 27
                  to goph...@pubsubhelper.golang.org, Go LUCI, David Chase, Cherry Mui, golang-co...@googlegroups.com
                  Attention needed from Cherry Mui and David Chase

                  Junyang Shao voted Commit-Queue+1

                  Commit-Queue+1
                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Cherry Mui
                  • David Chase
                  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: comment
                  Gerrit-Project: go
                  Gerrit-Branch: master
                  Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                  Gerrit-Change-Number: 742620
                  Gerrit-PatchSet: 25
                  Gerrit-Owner: Junyang Shao <shaoj...@google.com>
                  Gerrit-Reviewer: Cherry Mui <cher...@google.com>
                  Gerrit-Reviewer: David Chase <drc...@google.com>
                  Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
                  Gerrit-Attention: Cherry Mui <cher...@google.com>
                  Gerrit-Attention: David Chase <drc...@google.com>
                  Gerrit-Comment-Date: Fri, 27 Feb 2026 20:22:45 +0000
                  Gerrit-HasComments: No
                  Gerrit-Has-Labels: Yes
                  unsatisfied_requirement
                  satisfied_requirement
                  open
                  diffy

                  Junyang Shao (Gerrit)

                  unread,
                  Feb 27, 2026, 4:01:28 PMFeb 27
                  to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                  Attention needed from Cherry Mui, David Chase and Junyang Shao

                  Junyang Shao uploaded new patchset

                  Junyang Shao uploaded patch set #26 to this change.
                  Following approvals got outdated and were removed:
                  • TryBots-Pass: LUCI-TryBot-Result-1 by Go LUCI
                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Cherry Mui
                  • David Chase
                  • Junyang Shao
                  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: newpatchset
                  Gerrit-Project: go
                  Gerrit-Branch: master
                  Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                  Gerrit-Change-Number: 742620
                  Gerrit-PatchSet: 26
                  Gerrit-Owner: Junyang Shao <shaoj...@google.com>
                  Gerrit-Reviewer: Cherry Mui <cher...@google.com>
                  Gerrit-Reviewer: David Chase <drc...@google.com>
                  Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
                  Gerrit-Attention: Cherry Mui <cher...@google.com>
                  Gerrit-Attention: David Chase <drc...@google.com>
                  Gerrit-Attention: Junyang Shao <shaoj...@google.com>
                  unsatisfied_requirement
                  satisfied_requirement
                  open
                  diffy

                  Junyang Shao (Gerrit)

                  unread,
                  Feb 27, 2026, 4:01:33 PMFeb 27
                  to goph...@pubsubhelper.golang.org, Go LUCI, David Chase, Cherry Mui, golang-co...@googlegroups.com
                  Attention needed from Cherry Mui and David Chase

                  Junyang Shao voted Commit-Queue+1

                  Commit-Queue+1
                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Cherry Mui
                  • David Chase
                  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: comment
                  Gerrit-Project: go
                  Gerrit-Branch: master
                  Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                  Gerrit-Change-Number: 742620
                  Gerrit-PatchSet: 26
                  Gerrit-Owner: Junyang Shao <shaoj...@google.com>
                  Gerrit-Reviewer: Cherry Mui <cher...@google.com>
                  Gerrit-Reviewer: David Chase <drc...@google.com>
                  Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
                  Gerrit-Attention: Cherry Mui <cher...@google.com>
                  Gerrit-Attention: David Chase <drc...@google.com>
                  Gerrit-Comment-Date: Fri, 27 Feb 2026 21:01:29 +0000
                  Gerrit-HasComments: No
                  Gerrit-Has-Labels: Yes
                  unsatisfied_requirement
                  satisfied_requirement
                  open
                  diffy

                  Alexander Musman (Gerrit)

                  unread,
                  Mar 1, 2026, 7:51:55 AMMar 1
                  to Junyang Shao, goph...@pubsubhelper.golang.org, Go LUCI, David Chase, Cherry Mui, golang-co...@googlegroups.com
                  Attention needed from Cherry Mui, David Chase and Junyang Shao

                  Alexander Musman added 2 comments

                  File src/cmd/internal/obj/arm64/inst.go
                  Line 129, Patchset 26 (Latest): for _, op := range i.args {
                  Alexander Musman . unresolved

                  Many Inst entries could share identical `args: []Operand` patterns (e.g. the three-operand `<Zm>.<T>, <Zn>.<T>, <Zd>.<T>` shape will appear many times with the same encoders). Would it be worth having the generator emit shared operand pattern variables? It would reduce table size and also give readable names to the distinct operand signatures, which might make the generated instruction table easier to audit.

                  Line 130, Patchset 26 (Latest): addr, ok := next()
                  Alexander Musman . unresolved

                  And taking that one step further — each such shared generated `args:[]Operand` pattern looks essentially like an NFA over (AClass, arrangement) pairs, with the element encoders as output actions on transitions. Constraints like `T=4×Tb` would just mean only certain paths exist (`S→B→B`, `S→H→H`, `H→B→B`, `D→H→H` for SDOT example above in comment) with no accepting path for invalid combinations, rather than needing runtime checks. Could that replace the `encoded` mapping for same BinarySymbolName checks? But that would need more states (not sure how much more) and could be less in line with the XML specs?

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Cherry Mui
                  • David Chase
                  • Junyang Shao
                  Submit Requirements:
                    • requirement is not satisfiedCode-Review
                    • requirement is not 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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                    Gerrit-Change-Number: 742620
                    Gerrit-PatchSet: 26
                    Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                    Gerrit-Attention: Cherry Mui <cher...@google.com>
                    Gerrit-Attention: David Chase <drc...@google.com>
                    Gerrit-Attention: Junyang Shao <shaoj...@google.com>
                    Gerrit-Comment-Date: Sun, 01 Mar 2026 12:51:48 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: No
                    unsatisfied_requirement
                    satisfied_requirement
                    open
                    diffy

                    Junyang Shao (Gerrit)

                    unread,
                    Mar 1, 2026, 1:46:49 PMMar 1
                    to goph...@pubsubhelper.golang.org, Alexander Musman, Go LUCI, David Chase, Cherry Mui, golang-co...@googlegroups.com
                    Attention needed from Alexander Musman, Cherry Mui and David Chase

                    Junyang Shao added 2 comments

                    File src/cmd/internal/obj/arm64/inst.go
                    Line 129, Patchset 26 (Latest): for _, op := range i.args {
                    Alexander Musman . unresolved

                    Many Inst entries could share identical `args: []Operand` patterns (e.g. the three-operand `<Zm>.<T>, <Zn>.<T>, <Zd>.<T>` shape will appear many times with the same encoders). Would it be worth having the generator emit shared operand pattern variables? It would reduce table size and also give readable names to the distinct operand signatures, which might make the generated instruction table easier to audit.

                    Junyang Shao

                    Thanks for the comment, yes we can do this to make the code smaller, I will do it in a later CL.

                    Alexander Musman . unresolved

                    And taking that one step further — each such shared generated `args:[]Operand` pattern looks essentially like an NFA over (AClass, arrangement) pairs, with the element encoders as output actions on transitions. Constraints like `T=4×Tb` would just mean only certain paths exist (`S→B→B`, `S→H→H`, `H→B→B`, `D→H→H` for SDOT example above in comment) with no accepting path for invalid combinations, rather than needing runtime checks. Could that replace the `encoded` mapping for same BinarySymbolName checks? But that would need more states (not sure how much more) and could be less in line with the XML specs?

                    Junyang Shao

                    I am not sure if I understand the logic here... Can you give me some example codes of the design in your mind? Thanks

                    Open in Gerrit

                    Related details

                    Attention is currently required from:
                    • Alexander Musman
                    • Cherry Mui
                    • David Chase
                    Submit Requirements:
                    • requirement is not satisfiedCode-Review
                    • requirement is not 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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                    Gerrit-Change-Number: 742620
                    Gerrit-PatchSet: 26
                    Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                    Gerrit-Attention: Cherry Mui <cher...@google.com>
                    Gerrit-Attention: David Chase <drc...@google.com>
                    Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                    Gerrit-Comment-Date: Sun, 01 Mar 2026 18:46:44 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: No
                    Comment-In-Reply-To: Alexander Musman <alexande...@gmail.com>
                    unsatisfied_requirement
                    satisfied_requirement
                    open
                    diffy

                    Alexander Musman (Gerrit)

                    unread,
                    Mar 1, 2026, 2:28:11 PMMar 1
                    to Junyang Shao, goph...@pubsubhelper.golang.org, Go LUCI, David Chase, Cherry Mui, golang-co...@googlegroups.com
                    Attention needed from Cherry Mui, David Chase and Junyang Shao

                    Alexander Musman added 2 comments

                    File src/cmd/internal/obj/arm64/inst.go
                    Line 129, Patchset 26 (Latest): for _, op := range i.args {
                    Alexander Musman . resolved

                    Many Inst entries could share identical `args: []Operand` patterns (e.g. the three-operand `<Zm>.<T>, <Zn>.<T>, <Zd>.<T>` shape will appear many times with the same encoders). Would it be worth having the generator emit shared operand pattern variables? It would reduce table size and also give readable names to the distinct operand signatures, which might make the generated instruction table easier to audit.

                    Junyang Shao

                    Thanks for the comment, yes we can do this to make the code smaller, I will do it in a later CL.

                    Alexander Musman

                    Acknowledged

                    Alexander Musman . unresolved

                    And taking that one step further — each such shared generated `args:[]Operand` pattern looks essentially like an NFA over (AClass, arrangement) pairs, with the element encoders as output actions on transitions. Constraints like `T=4×Tb` would just mean only certain paths exist (`S→B→B`, `S→H→H`, `H→B→B`, `D→H→H` for SDOT example above in comment) with no accepting path for invalid combinations, rather than needing runtime checks. Could that replace the `encoded` mapping for same BinarySymbolName checks? But that would need more states (not sure how much more) and could be less in line with the XML specs?

                    Junyang Shao

                    I am not sure if I understand the logic here... Can you give me some example codes of the design in your mind? Thanks

                    Alexander Musman
                    Well, for SDOT in comment methions the following variants from three different xml files:
                    1) `SDOT <Zda>.<T>, <Zn>.<Tb>, <Zm>.<Tb>` such that `T=4×Tb` (i.e. 2 possible variants, either T="S" with Tb="B" (1a) or T="D" with Tb="H"(1b) ).
                    2) `SDOT <Zda>.H, <Zn>.B, <Zm>.B`
                    3) `SDOT <Zda>.S, <Zn>.H, <Zm>.H`
                    That gives 4 possible variants which (if we build NFA from right to left on these cases) would give something like following:
                    ```
                    {ARNG,B} {ARNG,B} {ARNG,S}
                    S0 (SDOT) ──────→ S1 ──────→ S3 ──────→ [accept: .S .B .B → enc1a]
                    │
                    │{ARNG,H}
                    └──────→ [accept: .H .B .B → enc2]
                                  {ARNG,H}       {ARNG,H}       {ARNG,D}
                    └──────→ S2 ──────→ S4 ──────→ [accept: .D .H .H → enc1b]
                    │
                    │{ARNG,S}
                    └──────→ [accept: .S .H .H → enc3]
                    ```
                    Here each arrow denotes transition the code would do on argument with corresponding {aclass, arrangement} pair such as `{ARNG,H}`. Each `enc` would be some generated function responsible for encoding whole instruction. That would separate two concerns: "is this a valid operand combination?" (NFA) and "what bits do we emit?" (resulting encoder function). Current state could also help to emit diagnostic in future, e.g. in state `S4` if the next input is not `{ARNG,D}` or `{ARNG,S}`, the assembler could print out something like "expected vector register with `.D` or `.S` arrangement".
                    Open in Gerrit

                    Related details

                    Attention is currently required from:
                    • Cherry Mui
                    • David Chase
                    • Junyang Shao
                    Submit Requirements:
                    • requirement is not satisfiedCode-Review
                    • requirement is not 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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                    Gerrit-Change-Number: 742620
                    Gerrit-PatchSet: 26
                    Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                    Gerrit-Attention: Cherry Mui <cher...@google.com>
                    Gerrit-Attention: David Chase <drc...@google.com>
                    Gerrit-Attention: Junyang Shao <shaoj...@google.com>
                    Gerrit-Comment-Date: Sun, 01 Mar 2026 19:28:03 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: No
                    Comment-In-Reply-To: Alexander Musman <alexande...@gmail.com>
                    Comment-In-Reply-To: Junyang Shao <shaoj...@google.com>
                    unsatisfied_requirement
                    satisfied_requirement
                    open
                    diffy

                    Junyang Shao (Gerrit)

                    unread,
                    Mar 1, 2026, 11:13:56 PMMar 1
                    to goph...@pubsubhelper.golang.org, Alexander Musman, Go LUCI, David Chase, Cherry Mui, golang-co...@googlegroups.com
                    Attention needed from Alexander Musman, Cherry Mui and David Chase

                    Junyang Shao added 1 comment

                    File src/cmd/internal/obj/arm64/inst.go
                    Alexander Musman . resolved

                    And taking that one step further — each such shared generated `args:[]Operand` pattern looks essentially like an NFA over (AClass, arrangement) pairs, with the element encoders as output actions on transitions. Constraints like `T=4×Tb` would just mean only certain paths exist (`S→B→B`, `S→H→H`, `H→B→B`, `D→H→H` for SDOT example above in comment) with no accepting path for invalid combinations, rather than needing runtime checks. Could that replace the `encoded` mapping for same BinarySymbolName checks? But that would need more states (not sure how much more) and could be less in line with the XML specs?

                    Junyang Shao

                    I am not sure if I understand the logic here... Can you give me some example codes of the design in your mind? Thanks

                    Alexander Musman
                    Well, for SDOT in comment methions the following variants from three different xml files:
                    1) `SDOT <Zda>.<T>, <Zn>.<Tb>, <Zm>.<Tb>` such that `T=4×Tb` (i.e. 2 possible variants, either T="S" with Tb="B" (1a) or T="D" with Tb="H"(1b) ).
                    2) `SDOT <Zda>.H, <Zn>.B, <Zm>.B`
                    3) `SDOT <Zda>.S, <Zn>.H, <Zm>.H`
                    That gives 4 possible variants which (if we build NFA from right to left on these cases) would give something like following:
                    ```
                    {ARNG,B} {ARNG,B} {ARNG,S}
                    S0 (SDOT) ──────→ S1 ──────→ S3 ──────→ [accept: .S .B .B → enc1a]
                    │
                    │{ARNG,H}
                    └──────→ [accept: .H .B .B → enc2]
                                  {ARNG,H}       {ARNG,H}       {ARNG,D}
                    └──────→ S2 ──────→ S4 ──────→ [accept: .D .H .H → enc1b]
                    │
                    │{ARNG,S}
                    └──────→ [accept: .S .H .H → enc3]
                    ```
                    Here each arrow denotes transition the code would do on argument with corresponding {aclass, arrangement} pair such as `{ARNG,H}`. Each `enc` would be some generated function responsible for encoding whole instruction. That would separate two concerns: "is this a valid operand combination?" (NFA) and "what bits do we emit?" (resulting encoder function). Current state could also help to emit diagnostic in future, e.g. in state `S4` if the next input is not `{ARNG,D}` or `{ARNG,S}`, the assembler could print out something like "expected vector register with `.D` or `.S` arrangement".
                    Junyang Shao

                    Oh I see what you mean. Thanks for the comprehensive example. 😊

                    However this `T=4*Tb` logic is not something we can parse mechanically, it is actually specified in the natural language description of assembler symbols. This means we need to integrate the understanding of these natural language specs into the instruction matching phase, which will be scattered around everywhere.

                    The current design puts all those natural language understanding in `encoding_gen.go` and by checking `encoded` they can do the same thing as this NFA design.

                    I am leaning towards just keeping the current design.

                    We can still emit comprehensive enough diagnostics from the current design - for example we can emit all encodings tried ordered by how much partial match they got.

                    Open in Gerrit

                    Related details

                    Attention is currently required from:
                    • Alexander Musman
                    • Cherry Mui
                    • David Chase
                    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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                      Gerrit-Change-Number: 742620
                      Gerrit-PatchSet: 26
                      Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                      Gerrit-Attention: Cherry Mui <cher...@google.com>
                      Gerrit-Attention: David Chase <drc...@google.com>
                      Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                      Gerrit-Comment-Date: Mon, 02 Mar 2026 04:13:52 +0000
                      unsatisfied_requirement
                      satisfied_requirement
                      open
                      diffy

                      Junyang Shao (Gerrit)

                      unread,
                      Mar 4, 2026, 6:18:21 PMMar 4
                      to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                      Attention needed from Alexander Musman, Cherry Mui and David Chase

                      Junyang Shao uploaded new patchset

                      Junyang Shao uploaded patch set #27 to this change.
                      Following approvals got outdated and were removed:
                      • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
                      Open in Gerrit

                      Related details

                      Attention is currently required from:
                      • Alexander Musman
                      • Cherry Mui
                      • David Chase
                      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: newpatchset
                        Gerrit-Project: go
                        Gerrit-Branch: master
                        Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                        Gerrit-Change-Number: 742620
                        Gerrit-PatchSet: 27
                        unsatisfied_requirement
                        satisfied_requirement
                        open
                        diffy

                        Junyang Shao (Gerrit)

                        unread,
                        Mar 4, 2026, 6:22:59 PMMar 4
                        to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                        Attention needed from Alexander Musman, Cherry Mui and David Chase

                        Junyang Shao uploaded new patchset

                        Junyang Shao uploaded patch set #28 to this change.
                        Open in Gerrit

                        Related details

                        Attention is currently required from:
                        • Alexander Musman
                        • Cherry Mui
                        • David Chase
                        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: newpatchset
                        Gerrit-Project: go
                        Gerrit-Branch: master
                        Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                        Gerrit-Change-Number: 742620
                        Gerrit-PatchSet: 28
                        unsatisfied_requirement
                        satisfied_requirement
                        open
                        diffy

                        Junyang Shao (Gerrit)

                        unread,
                        Mar 4, 2026, 7:01:37 PMMar 4
                        to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                        Attention needed from Alexander Musman, Cherry Mui and David Chase

                        Junyang Shao uploaded new patchset

                        Junyang Shao uploaded patch set #29 to this change.
                        Open in Gerrit

                        Related details

                        Attention is currently required from:
                        • Alexander Musman
                        • Cherry Mui
                        • David Chase
                        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: newpatchset
                        Gerrit-Project: go
                        Gerrit-Branch: master
                        Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                        Gerrit-Change-Number: 742620
                        Gerrit-PatchSet: 29
                        unsatisfied_requirement
                        satisfied_requirement
                        open
                        diffy

                        Junyang Shao (Gerrit)

                        unread,
                        Mar 4, 2026, 7:02:28 PMMar 4
                        to goph...@pubsubhelper.golang.org, Alexander Musman, Go LUCI, David Chase, Cherry Mui, golang-co...@googlegroups.com
                        Attention needed from Alexander Musman, Cherry Mui and David Chase

                        Junyang Shao voted Commit-Queue+1

                        Commit-Queue+1
                        Open in Gerrit

                        Related details

                        Attention is currently required from:
                        • Alexander Musman
                        • Cherry Mui
                        • David Chase
                        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: comment
                        Gerrit-Project: go
                        Gerrit-Branch: master
                        Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                        Gerrit-Change-Number: 742620
                        Gerrit-PatchSet: 29
                        Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                        Gerrit-Attention: Cherry Mui <cher...@google.com>
                        Gerrit-Attention: David Chase <drc...@google.com>
                        Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                        Gerrit-Comment-Date: Thu, 05 Mar 2026 00:02:24 +0000
                        Gerrit-HasComments: No
                        Gerrit-Has-Labels: Yes
                        unsatisfied_requirement
                        satisfied_requirement
                        open
                        diffy

                        Junyang Shao (Gerrit)

                        unread,
                        Mar 4, 2026, 7:07:35 PMMar 4
                        to goph...@pubsubhelper.golang.org, Alexander Musman, Go LUCI, David Chase, Cherry Mui, golang-co...@googlegroups.com
                        Attention needed from Alexander Musman, Cherry Mui and David Chase

                        Junyang Shao added 1 comment

                        File src/cmd/internal/obj/arm64/inst_gen.go
                        Line 19, Patchset 29 (Latest):var AC_ARNG_164_226 = Operand{
                        Junyang Shao . unresolved

                        Probably we shouldn't export them, will fix

                        Open in Gerrit

                        Related details

                        Attention is currently required from:
                        • Alexander Musman
                        • Cherry Mui
                        • David Chase
                        Submit Requirements:
                          • requirement is not satisfiedCode-Review
                          • requirement is not 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: comment
                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                          Gerrit-Change-Number: 742620
                          Gerrit-PatchSet: 29
                          Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                          Gerrit-Attention: Cherry Mui <cher...@google.com>
                          Gerrit-Attention: David Chase <drc...@google.com>
                          Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                          Gerrit-Comment-Date: Thu, 05 Mar 2026 00:07:29 +0000
                          Gerrit-HasComments: Yes
                          Gerrit-Has-Labels: No
                          unsatisfied_requirement
                          open
                          diffy

                          Junyang Shao (Gerrit)

                          unread,
                          Mar 4, 2026, 7:27:32 PMMar 4
                          to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                          Attention needed from Alexander Musman, Cherry Mui and David Chase

                          Junyang Shao uploaded new patchset

                          Junyang Shao uploaded patch set #30 to this change.
                          Following approvals got outdated and were removed:
                          • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
                          Open in Gerrit

                          Related details

                          Attention is currently required from:
                          • Alexander Musman
                          • Cherry Mui
                          • David Chase
                          Submit Requirements:
                          • requirement is not satisfiedCode-Review
                          • requirement is not 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: newpatchset
                          Gerrit-Project: go
                          Gerrit-Branch: master
                          Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                          Gerrit-Change-Number: 742620
                          Gerrit-PatchSet: 30
                          unsatisfied_requirement
                          open
                          diffy

                          Junyang Shao (Gerrit)

                          unread,
                          Mar 4, 2026, 7:28:32 PMMar 4
                          to goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, David Chase, Cherry Mui, golang-co...@googlegroups.com
                          Attention needed from Alexander Musman, Cherry Mui and David Chase

                          Junyang Shao voted and added 1 comment

                          Votes added by Junyang Shao

                          Commit-Queue+1

                          1 comment

                          File src/cmd/internal/obj/arm64/inst_gen.go
                          Line 19, Patchset 29:var AC_ARNG_164_226 = Operand{
                          Junyang Shao . resolved

                          Probably we shouldn't export them, will fix

                          Junyang Shao

                          Done

                          Open in Gerrit

                          Related details

                          Attention is currently required from:
                          • Alexander Musman
                          • Cherry Mui
                          • David Chase
                          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: comment
                            Gerrit-Project: go
                            Gerrit-Branch: master
                            Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                            Gerrit-Change-Number: 742620
                            Gerrit-PatchSet: 30
                            Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                            Gerrit-Attention: Cherry Mui <cher...@google.com>
                            Gerrit-Attention: David Chase <drc...@google.com>
                            Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                            Gerrit-Comment-Date: Thu, 05 Mar 2026 00:28:29 +0000
                            Gerrit-HasComments: Yes
                            Gerrit-Has-Labels: Yes
                            Comment-In-Reply-To: Junyang Shao <shaoj...@google.com>
                            unsatisfied_requirement
                            satisfied_requirement
                            open
                            diffy

                            David Chase (Gerrit)

                            unread,
                            Mar 6, 2026, 11:01:48 AM (14 days ago) Mar 6
                            to Junyang Shao, goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, Cherry Mui, golang-co...@googlegroups.com
                            Attention needed from Alexander Musman, Cherry Mui and Junyang Shao

                            David Chase added 2 comments

                            File src/cmd/internal/obj/arm64/encoding_gen.go
                            Line 15, Patchset 30 (Latest): // Pg
                            ENC_18
                            David Chase . unresolved

                            I think this would be better if it were

                            	// 18
                            ENC_Pg

                            and maybe the "// 18" mentions why "18" has any special significance.

                            Etc for all the others, and into the next CL.

                            Line 25, Patchset 30 (Latest):// Check this is a merging predication
                            func encodeGen8(v uint32) (uint32, BinarySymbolName, bool) {
                            David Chase . unresolved

                            I don't have a great idea for all of these encodeGen functions, but the ones that just check, could be named for what they check, so
                            ```
                            func isMergePred(...)
                            ```
                            It's not a complete solution, but everywhere that they appear, someone reading will know that much just from looking at them. If "8" has significance, that can be mentioned in the comment.

                            Open in Gerrit

                            Related details

                            Attention is currently required from:
                            • Alexander Musman
                            • Cherry Mui
                            • Junyang Shao
                            Submit Requirements:
                              • requirement is not satisfiedCode-Review
                              • requirement is not 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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                              Gerrit-Change-Number: 742620
                              Gerrit-PatchSet: 30
                              Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                              Gerrit-Attention: Cherry Mui <cher...@google.com>
                              Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                              Gerrit-Attention: Junyang Shao <shaoj...@google.com>
                              Gerrit-Comment-Date: Fri, 06 Mar 2026 16:01:40 +0000
                              Gerrit-HasComments: Yes
                              Gerrit-Has-Labels: No
                              unsatisfied_requirement
                              satisfied_requirement
                              open
                              diffy

                              Junyang Shao (Gerrit)

                              unread,
                              Mar 6, 2026, 12:46:28 PM (13 days ago) Mar 6
                              to goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, David Chase, Cherry Mui, golang-co...@googlegroups.com
                              Attention needed from Alexander Musman, Cherry Mui and David Chase

                              Junyang Shao added 2 comments

                              File src/cmd/internal/obj/arm64/encoding_gen.go
                              David Chase . resolved

                              I think this would be better if it were

                              	// 18
                              ENC_Pg

                              and maybe the "// 18" mentions why "18" has any special significance.

                              Etc for all the others, and into the next CL.

                              Junyang Shao

                              If we are adopting this pattern, I am not sure why we will still have 18, 18 is just an ID generated by the generator.

                              Ack, will do in next CL.

                              Line 25, Patchset 30 (Latest):// Check this is a merging predication
                              func encodeGen8(v uint32) (uint32, BinarySymbolName, bool) {
                              David Chase . resolved

                              I don't have a great idea for all of these encodeGen functions, but the ones that just check, could be named for what they check, so
                              ```
                              func isMergePred(...)
                              ```
                              It's not a complete solution, but everywhere that they appear, someone reading will know that much just from looking at them. If "8" has significance, that can be mentioned in the comment.

                              Junyang Shao

                              Acked, they will all go to the new CL, thanks

                              Open in Gerrit

                              Related details

                              Attention is currently required from:
                              • Alexander Musman
                              • Cherry Mui
                              • David Chase
                              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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                Gerrit-Change-Number: 742620
                                Gerrit-PatchSet: 30
                                Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                                Gerrit-Attention: Cherry Mui <cher...@google.com>
                                Gerrit-Attention: David Chase <drc...@google.com>
                                Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                                Gerrit-Comment-Date: Fri, 06 Mar 2026 17:46:23 +0000
                                Gerrit-HasComments: Yes
                                Gerrit-Has-Labels: No
                                Comment-In-Reply-To: David Chase <drc...@google.com>
                                unsatisfied_requirement
                                satisfied_requirement
                                open
                                diffy

                                Junyang Shao (Gerrit)

                                unread,
                                Mar 6, 2026, 6:00:59 PM (13 days ago) Mar 6
                                to goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, David Chase, Cherry Mui, golang-co...@googlegroups.com
                                Attention needed from Alexander Musman, Cherry Mui and David Chase

                                Junyang Shao voted and added 1 comment

                                Votes added by Junyang Shao

                                Commit-Queue+1

                                1 comment

                                File src/cmd/internal/obj/arm64/encoding_gen.go
                                Line 25, Patchset 30 (Latest):// Check this is a merging predication
                                func encodeGen8(v uint32) (uint32, BinarySymbolName, bool) {
                                David Chase . resolved

                                I don't have a great idea for all of these encodeGen functions, but the ones that just check, could be named for what they check, so
                                ```
                                func isMergePred(...)
                                ```
                                It's not a complete solution, but everywhere that they appear, someone reading will know that much just from looking at them. If "8" has significance, that can be mentioned in the comment.

                                Junyang Shao

                                Acked, they will all go to the new CL, thanks

                                Junyang Shao

                                I just realize - this means those magic strings for operands and elements is going to have a "isMergePred" or "M" or "MP", etc.

                                I am not sure this is a good idea, a uniformed ID number looks easier for the user to locate the encoding functions.

                                Gerrit-Comment-Date: Fri, 06 Mar 2026 23:00:53 +0000
                                Gerrit-HasComments: Yes
                                Gerrit-Has-Labels: Yes
                                Comment-In-Reply-To: David Chase <drc...@google.com>
                                Comment-In-Reply-To: Junyang Shao <shaoj...@google.com>
                                unsatisfied_requirement
                                satisfied_requirement
                                open
                                diffy

                                Cherry Mui (Gerrit)

                                unread,
                                Mar 6, 2026, 6:19:55 PM (13 days ago) Mar 6
                                to Junyang Shao, goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, David Chase, golang-co...@googlegroups.com
                                Attention needed from Alexander Musman, David Chase and Junyang Shao

                                Cherry Mui added 7 comments

                                File src/cmd/internal/obj/arm64/anames_gen.go
                                Line 5, Patchset 30 (Latest):var A64Anames = []string{
                                Cherry Mui . unresolved

                                Again, remove the A64 prefix. Everywhere.

                                And we should put the names into one slice. You can generate a sveNames slice, append it to Anames.

                                File src/cmd/internal/obj/arm64/goops_gen.go
                                Line 8, Patchset 30 (Latest): AZADD obj.As = ALAST + 1 + iota
                                Cherry Mui . unresolved

                                ALAST is the very LAST one, by definition. Don't put anything after ALAST.

                                If necessary, define new constants, and adjust ALAST.

                                File src/cmd/internal/obj/arm64/inst.go
                                Line 27, Patchset 30 (Latest):type BinarySymbolName uint16
                                Cherry Mui . unresolved

                                What is this for? BinarySymbolName is a very confusing term in assembler/linker context. It would usually mean a symbol name in the binary, like an ELF symbol, which is probably not what you mean here.

                                Add a comment explaining what it is. And probably rename it.

                                Line 102, Patchset 30 (Latest):func encodeAddr(a *obj.Addr, acl AClass, index int) uint32 {
                                Cherry Mui . unresolved

                                What is the meaning if the index? Why an Addr has multiple elements? How are they indexed?

                                Line 125, Patchset 30 (Latest):// tryEncode tries to encode p to i, it returns the encoded binary and ok signal.
                                Cherry Mui . unresolved

                                This doesn't sound right. i (as an Inst) doesn't seem to carry data, so "encode p to i" is not right. Again, we should rename the type.

                                Line 488, Patchset 10:func (i *Inst) tryEncodeA64Inst(p *obj.Prog) (uint32, bool) {
                                Cherry Mui . unresolved

                                Just "tryEncode".

                                How is a Prog supposed to be converted to an Inst? It looks like this function expects the Inst to already be populated. But it still needs to classify each operand in the prog. That seems confusing. What is the expected workflow here?

                                In general, I would think we want to either work with only Prog and Addr, or do a translation them work only with Inst and Operand, not both at same time in most code.

                                Junyang Shao

                                The Inst (`i`) here is the pre-populated entry in the instruction table (which is generated by the generator, which will be the next CL in the chain), it's just like an optab entry. So this is the logic to match a prog to an Inst, and along the matching, if it's a success then it returns the binary. The reason that this is a `tryEncode` instead of `encode` is documented in the CL description, also in the comment of `elemEncoder`.

                                I think this layer of Inst -> Prog interop has to be somewhere to lower prog to inst, in asm7 it is scattered around various of switch cases, here they are just processed in a centralized stage which is this function. You can find an example of the workflow in the test I added (CL 747920).

                                I have made the addr accesses better, thanks.

                                Cherry Mui

                                Reading it again, I think what you want to do is that you want to compute the encoder functions of a Prog, and work on the Prog and Addr. The `Inst` is actually an encoder, which doesn't carry data. That is a reasonable approach.

                                If this is the case, we should make the name clearer. Instead of `Inst` and `Operand`, probably `encoder` and `fieldEncoder` (or `argEncoder`). So the workflow is, when a Prog comes in, we compute its encoder based on its As and operand classes, and use the encoder (which includes a list of argEncoder's) to encode the Addr's.

                                Either way, I think we need to make the workflow clear. Let's write an example with one instruction. And document in a comment.

                                Junyang Shao

                                Thanks! Working on it.

                                Junyang Shao

                                I have added a e2e test, now the assembler can assemble
                                `ZADD` (we add the prefix `Z` to all SVE instructions that takes a Z, for deduplication purposes.)

                                Cherry Mui

                                I don't think this comment is addressed. At least, the confusing naming Inst and Operand are still there.

                                File src/cmd/internal/obj/util.go
                                Line 517, Patchset 30 (Latest): RBaseARM64 = 8 * 1024 // range [8k, 13k)
                                Cherry Mui . unresolved

                                Is this still right?

                                Open in Gerrit

                                Related details

                                Attention is currently required from:
                                • Alexander Musman
                                • David Chase
                                • Junyang Shao
                                Submit Requirements:
                                  • requirement is not satisfiedCode-Review
                                  • requirement is not 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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                  Gerrit-Change-Number: 742620
                                  Gerrit-PatchSet: 30
                                  Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                                  Gerrit-Attention: David Chase <drc...@google.com>
                                  Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                                  Gerrit-Attention: Junyang Shao <shaoj...@google.com>
                                  Gerrit-Comment-Date: Fri, 06 Mar 2026 23:19:51 +0000
                                  Gerrit-HasComments: Yes
                                  Gerrit-Has-Labels: No
                                  unsatisfied_requirement
                                  satisfied_requirement
                                  open
                                  diffy

                                  Junyang Shao (Gerrit)

                                  unread,
                                  Mar 6, 2026, 7:32:12 PM (13 days ago) Mar 6
                                  to goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, David Chase, Cherry Mui, golang-co...@googlegroups.com
                                  Attention needed from Alexander Musman, Cherry Mui and David Chase

                                  Junyang Shao added 2 comments

                                  File src/cmd/internal/obj/arm64/inst.go
                                  Line 27, Patchset 30 (Latest):type BinarySymbolName uint16
                                  Cherry Mui . unresolved

                                  What is this for? BinarySymbolName is a very confusing term in assembler/linker context. It would usually mean a symbol name in the binary, like an ELF symbol, which is probably not what you mean here.

                                  Add a comment explaining what it is. And probably rename it.

                                  Junyang Shao

                                  It's those symbol names in the xml binary specification.
                                  i.e. Zdn, Zm, Pg

                                  I can rename it `machineCodeSymbolName`.

                                  Line 102, Patchset 30 (Latest):func encodeAddr(a *obj.Addr, acl AClass, index int) uint32 {
                                  Cherry Mui . resolved

                                  What is the meaning if the index? Why an Addr has multiple elements? How are they indexed?

                                  Junyang Shao

                                  `index` is an index into the element list, you can find it in `inst_gen.go`.

                                  Open in Gerrit

                                  Related details

                                  Attention is currently required from:
                                  • Alexander Musman
                                  • Cherry Mui
                                  • David Chase
                                  Submit Requirements:
                                  • requirement is not satisfiedCode-Review
                                  • requirement is not 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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                  Gerrit-Change-Number: 742620
                                  Gerrit-PatchSet: 30
                                  Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                                  Gerrit-Attention: Cherry Mui <cher...@google.com>
                                  Gerrit-Attention: David Chase <drc...@google.com>
                                  Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                                  Gerrit-Comment-Date: Sat, 07 Mar 2026 00:32:07 +0000
                                  unsatisfied_requirement
                                  satisfied_requirement
                                  open
                                  diffy

                                  David Chase (Gerrit)

                                  unread,
                                  Mar 9, 2026, 3:30:06 PM (10 days ago) Mar 9
                                  to Junyang Shao, goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, Cherry Mui, golang-co...@googlegroups.com
                                  Attention needed from Alexander Musman, Cherry Mui and Junyang Shao

                                  David Chase added 3 comments

                                  File src/cmd/internal/obj/arm64/encoding_gen.go
                                  Line 25, Patchset 30 (Latest):// Check this is a merging predication
                                  func encodeGen8(v uint32) (uint32, BinarySymbolName, bool) {
                                  David Chase . unresolved

                                  I don't have a great idea for all of these encodeGen functions, but the ones that just check, could be named for what they check, so
                                  ```
                                  func isMergePred(...)
                                  ```
                                  It's not a complete solution, but everywhere that they appear, someone reading will know that much just from looking at them. If "8" has significance, that can be mentioned in the comment.

                                  Junyang Shao

                                  Acked, they will all go to the new CL, thanks

                                  Junyang Shao

                                  I just realize - this means those magic strings for operands and elements is going to have a "isMergePred" or "M" or "MP", etc.

                                  I am not sure this is a good idea, a uniformed ID number looks easier for the user to locate the encoding functions.

                                  David Chase

                                  The number is not better. "isMergePred" is no worse than "encodeGen8" in those magic strings, and might be better -- it means it isn't doing any actual encoding, for example.

                                  Line 53, Patchset 30 (Latest):func encodeGen164(v uint32) (uint32, BinarySymbolName, bool) {
                                  David Chase . unresolved

                                  Similarly in the renaming, perhaps this would could be "Enc_Zm_5_10".
                                  And above, could be "Enc_Pg_10_13"

                                  Line 65, Patchset 30 (Latest):func encodeGen226(v uint32) (uint32, BinarySymbolName, bool) {
                                  David Chase . unresolved

                                  this one's harder, maybe it doesn't get a special name?

                                  Open in Gerrit

                                  Related details

                                  Attention is currently required from:
                                  • Alexander Musman
                                  • Cherry Mui
                                  • Junyang Shao
                                  Submit Requirements:
                                  • requirement is not satisfiedCode-Review
                                  • requirement is not 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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                  Gerrit-Change-Number: 742620
                                  Gerrit-PatchSet: 30
                                  Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                                  Gerrit-Attention: Cherry Mui <cher...@google.com>
                                  Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                                  Gerrit-Attention: Junyang Shao <shaoj...@google.com>
                                  Gerrit-Comment-Date: Mon, 09 Mar 2026 19:30:02 +0000
                                  Gerrit-HasComments: Yes
                                  Gerrit-Has-Labels: No
                                  unsatisfied_requirement
                                  satisfied_requirement
                                  open
                                  diffy

                                  Cherry Mui (Gerrit)

                                  unread,
                                  Mar 9, 2026, 4:48:31 PM (10 days ago) Mar 9
                                  to Junyang Shao, goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, David Chase, golang-co...@googlegroups.com
                                  Attention needed from Alexander Musman and Junyang Shao

                                  Cherry Mui added 2 comments

                                  File src/cmd/internal/obj/arm64/inst.go
                                  Line 27, Patchset 30 (Latest):type BinarySymbolName uint16
                                  Cherry Mui . unresolved

                                  What is this for? BinarySymbolName is a very confusing term in assembler/linker context. It would usually mean a symbol name in the binary, like an ELF symbol, which is probably not what you mean here.

                                  Add a comment explaining what it is. And probably rename it.

                                  Junyang Shao

                                  It's those symbol names in the xml binary specification.
                                  i.e. Zdn, Zm, Pg

                                  I can rename it `machineCodeSymbolName`.

                                  Cherry Mui

                                  Let's avoid the word "Symbol". If is a confusing name in this context. Maybe "component" or "operandComponent"?

                                  Line 102, Patchset 30 (Latest):func encodeAddr(a *obj.Addr, acl AClass, index int) uint32 {
                                  Cherry Mui . unresolved

                                  What is the meaning if the index? Why an Addr has multiple elements? How are they indexed?

                                  Junyang Shao

                                  `index` is an index into the element list, you can find it in `inst_gen.go`.

                                  Cherry Mui

                                  It looks like it is to identify a component of an Addr, like the "Zm" or "T" from a "Zm.T"? Add a comment explain this.

                                  This function doesn't actually encode the Addr, but extract the component. So the function probably should be renamed to addrComponent or so.

                                  This also makes me wonder: should we just "flatten" it? I.e. instead of iterating first on Addr, then on the components of it, just directly iterate on the components. Same for the encoder side: one flattened list of component encoders, instead of two levels ([]Operand, then []elemEncoder).

                                  Open in Gerrit

                                  Related details

                                  Attention is currently required from:
                                  • Alexander Musman
                                  • Junyang Shao
                                  Submit Requirements:
                                  • requirement is not satisfiedCode-Review
                                  • requirement is not 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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                  Gerrit-Change-Number: 742620
                                  Gerrit-PatchSet: 30
                                  Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                                  Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                                  Gerrit-Attention: Junyang Shao <shaoj...@google.com>
                                  Gerrit-Comment-Date: Mon, 09 Mar 2026 20:48:26 +0000
                                  Gerrit-HasComments: Yes
                                  Gerrit-Has-Labels: No
                                  unsatisfied_requirement
                                  satisfied_requirement
                                  open
                                  diffy

                                  Junyang Shao (Gerrit)

                                  unread,
                                  Mar 10, 2026, 2:19:17 PM (9 days ago) Mar 10
                                  to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                                  Attention needed from Alexander Musman and Junyang Shao

                                  Junyang Shao uploaded new patchset

                                  Junyang Shao uploaded patch set #31 to this change.
                                  Following approvals got outdated and were removed:
                                  • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI

                                  Related details

                                  Attention is currently required from:
                                  • Alexander Musman
                                  • Junyang Shao
                                  Submit Requirements:
                                    • requirement is not satisfiedCode-Review
                                    • requirement is not 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: newpatchset
                                    Gerrit-Project: go
                                    Gerrit-Branch: master
                                    Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                    Gerrit-Change-Number: 742620
                                    Gerrit-PatchSet: 31
                                    unsatisfied_requirement
                                    open
                                    diffy

                                    Junyang Shao (Gerrit)

                                    unread,
                                    Mar 10, 2026, 4:32:10 PM (9 days ago) Mar 10
                                    to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                                    Attention needed from Alexander Musman and Junyang Shao

                                    Junyang Shao uploaded new patchset

                                    Junyang Shao uploaded patch set #32 to this change.
                                    Open in Gerrit

                                    Related details

                                    Attention is currently required from:
                                    • Alexander Musman
                                    • Junyang Shao
                                    Submit Requirements:
                                    • requirement is not satisfiedCode-Review
                                    • requirement is not 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: newpatchset
                                    Gerrit-Project: go
                                    Gerrit-Branch: master
                                    Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                    Gerrit-Change-Number: 742620
                                    Gerrit-PatchSet: 32
                                    unsatisfied_requirement
                                    open
                                    diffy

                                    Junyang Shao (Gerrit)

                                    unread,
                                    Mar 10, 2026, 4:37:29 PM (9 days ago) Mar 10
                                    to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                                    Attention needed from Alexander Musman and Junyang Shao

                                    Junyang Shao uploaded new patchset

                                    Junyang Shao uploaded patch set #33 to this change.
                                    Open in Gerrit

                                    Related details

                                    Attention is currently required from:
                                    • Alexander Musman
                                    • Junyang Shao
                                    Submit Requirements:
                                    • requirement is not satisfiedCode-Review
                                    • requirement is not 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: newpatchset
                                    Gerrit-Project: go
                                    Gerrit-Branch: master
                                    Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                    Gerrit-Change-Number: 742620
                                    Gerrit-PatchSet: 33
                                    unsatisfied_requirement
                                    open
                                    diffy

                                    Junyang Shao (Gerrit)

                                    unread,
                                    Mar 10, 2026, 4:38:09 PM (9 days ago) Mar 10
                                    to goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, David Chase, Cherry Mui, golang-co...@googlegroups.com
                                    Attention needed from Alexander Musman, Cherry Mui and David Chase

                                    Junyang Shao voted and added 10 comments

                                    Votes added by Junyang Shao

                                    Commit-Queue+1

                                    10 comments

                                    File src/cmd/internal/obj/arm64/anames_gen.go
                                    Line 5, Patchset 30:var A64Anames = []string{
                                    Cherry Mui . resolved

                                    Again, remove the A64 prefix. Everywhere.

                                    And we should put the names into one slice. You can generate a sveNames slice, append it to Anames.

                                    Junyang Shao

                                    Done

                                    File src/cmd/internal/obj/arm64/encoding_gen.go
                                    Line 25, Patchset 30:// Check this is a merging predication

                                    func encodeGen8(v uint32) (uint32, BinarySymbolName, bool) {
                                    David Chase . resolved

                                    I don't have a great idea for all of these encodeGen functions, but the ones that just check, could be named for what they check, so
                                    ```
                                    func isMergePred(...)
                                    ```
                                    It's not a complete solution, but everywhere that they appear, someone reading will know that much just from looking at them. If "8" has significance, that can be mentioned in the comment.

                                    Junyang Shao

                                    Acked, they will all go to the new CL, thanks

                                    Junyang Shao

                                    I just realize - this means those magic strings for operands and elements is going to have a "isMergePred" or "M" or "MP", etc.

                                    I am not sure this is a good idea, a uniformed ID number looks easier for the user to locate the encoding functions.

                                    David Chase

                                    The number is not better. "isMergePred" is no worse than "encodeGen8" in those magic strings, and might be better -- it means it isn't doing any actual encoding, for example.

                                    Junyang Shao
                                    I am not sure why do you think this is better.
                                    Let's see an example here:
                                    ```
                                    // ABS <Zd>.<T>, <Pg>/M, <Zn>.<T>
                                    {
                                    goOp: AZABS,
                                    fixedBits: 0x416a000,
                                    args: oc_ARNG_173_226_173_226_PREGZM_141_8_141_8_ARNG_123_226_123_226, // <Zn>.<T>, <Pg>/M, <Zd>.<T>
                                    },
                                    ```
                                    In your new naming scheme, it will appear to be:
                                    ```
                                    // ABS <Zd>.<T>, <Pg>/M, <Zn>.<T>
                                    {
                                    goOp: AZABS,
                                    fixedBits: 0x416a000,
                                    args: oc_ARNG_Zn_5_10_size_22_24_Zn_5_10_size_22_24_PREGZM_Pg_10_13_MP._Pg_10_13_MP_ARNG_Zd_0_5_size_22_24_Zd_0_5_size_22_24, // <Zn>.<T>, <Pg>/M, <Zd>.<T>
                                    },
                                    ```
                                    Here, `size_22_24` means it's a `size` component encoded in the 22 to 24 bits.
                                    However, this has a problem, as size encoding has different semantics.
                                    For example we have these 2 guys:
                                    ```
                                    // Is the size specifier,
                                    // size <T>
                                    // 01 H
                                    // 1x D
                                    // bit range mappings:
                                    // size: [22:24)
                                    func encodeGen234(v uint32) (uint32, BinarySymbolName, bool) {
                                    switch v {
                                    case ARNG_H:
                                    return 1 << 22, ENC_57, true
                                    case ARNG_D:
                                    return 3 << 22, ENC_57, true
                                    }
                                    return 0, ENC_57, false
                                    }
                                    // Is the size specifier,
                                    // size <Tb>
                                    // 00 B
                                    // 01 H
                                    // 10 S
                                    // 11 D
                                    // bit range mappings:
                                    // size: [22:24)
                                    func encodeGen235(v uint32) (uint32, BinarySymbolName, bool) {
                                    switch v {
                                    case ARNG_B:
                                    return 0 << 22, ENC_57, true
                                    case ARNG_H:
                                    return 1 << 22, ENC_57, true
                                    case ARNG_S:
                                    return 2 << 22, ENC_57, true
                                    case ARNG_D:
                                    return 3 << 22, ENC_57, true
                                    }
                                    return 0, ENC_57, false
                                    }
                                    ```
                                    How are we going to do with it? Split `size_22_24` to `size_22_24_type1` and `size_22_24_type2`? But `type1` and `type2` does not say about the semantics of these encoding functions, how can I find them now? Their IDs are gone, I will need to manually grep `size`, or maybe also grep `[22, 24)`, to find the actual descriptions of this encoding function. Now reading these data becomes a nightmare.

                                    I just don't think this whole logic make sense, right now the user has a truth table (namely `encoding_gen.go`), and they can just grab the IDs from that magic string and go look at that encoding function and they will understand it.

                                    These encoding functions are just irregular like that, let's just name them by IDs and don't create more reading indirections, it might make you reading a specific example easier, but the nature of this spec is not really as nice as what you think of.

                                    Line 53, Patchset 30:func encodeGen164(v uint32) (uint32, BinarySymbolName, bool) {
                                    David Chase . resolved

                                    Similarly in the renaming, perhaps this would could be "Enc_Zm_5_10".
                                    And above, could be "Enc_Pg_10_13"

                                    Junyang Shao

                                    I also don't think this is a good idea, see my other comments aggregating all your naming ideas.

                                    Line 65, Patchset 30:func encodeGen226(v uint32) (uint32, BinarySymbolName, bool) {
                                    David Chase . resolved

                                    this one's harder, maybe it doesn't get a special name?

                                    Junyang Shao

                                    I don't think we should give them special names at all, just give them IDs. See my other long comment for details.

                                    File src/cmd/internal/obj/arm64/goops_gen.go
                                    Line 8, Patchset 30: AZADD obj.As = ALAST + 1 + iota
                                    Cherry Mui . resolved

                                    ALAST is the very LAST one, by definition. Don't put anything after ALAST.

                                    If necessary, define new constants, and adjust ALAST.

                                    Junyang Shao

                                    Done

                                    File src/cmd/internal/obj/arm64/inst.go
                                    Line 27, Patchset 30:type BinarySymbolName uint16
                                    Cherry Mui . resolved

                                    What is this for? BinarySymbolName is a very confusing term in assembler/linker context. It would usually mean a symbol name in the binary, like an ELF symbol, which is probably not what you mean here.

                                    Add a comment explaining what it is. And probably rename it.

                                    Junyang Shao

                                    It's those symbol names in the xml binary specification.
                                    i.e. Zdn, Zm, Pg

                                    I can rename it `machineCodeSymbolName`.

                                    Cherry Mui

                                    Let's avoid the word "Symbol". If is a confusing name in this context. Maybe "component" or "operandComponent"?

                                    Junyang Shao

                                    Thanks, that sounds like a better name, and indeed we don't need to export them.
                                    I think we probably don't need to export most of these data types here, so I unexported them altogether.

                                    I still export `AClass` because they might be needed by the assembler parser at some point when I support more addressing mode.

                                    Line 102, Patchset 30:func encodeAddr(a *obj.Addr, acl AClass, index int) uint32 {
                                    Cherry Mui . resolved

                                    What is the meaning if the index? Why an Addr has multiple elements? How are they indexed?

                                    Junyang Shao

                                    `index` is an index into the element list, you can find it in `inst_gen.go`.

                                    Cherry Mui

                                    It looks like it is to identify a component of an Addr, like the "Zm" or "T" from a "Zm.T"? Add a comment explain this.

                                    This function doesn't actually encode the Addr, but extract the component. So the function probably should be renamed to addrComponent or so.

                                    This also makes me wonder: should we just "flatten" it? I.e. instead of iterating first on Addr, then on the components of it, just directly iterate on the components. Same for the encoder side: one flattened list of component encoders, instead of two levels ([]Operand, then []elemEncoder).

                                    Junyang Shao

                                    I think the switch case comment documented this pretty well, but to make it clearer I also copy-pasted it to the function comment.

                                    I am not sure I understand the flattening idea. What do you mean iterate on components? Before we iterate the `obj.Addr`s, we simply won't know its `AClass`, and we won't know its component layouts. And the assembling pipeline upstream gave us a list of `obj.Addr`s, not a list of components. So we have to iterate `obj.Addr`s first.

                                    And we won't be able to remove the switch case too, because every index has its unique semantics for every `AClass`, so we need a place to check those `{AClass, index}` pairs and it will eventually be a switch case.

                                    Line 125, Patchset 30:// tryEncode tries to encode p to i, it returns the encoded binary and ok signal.
                                    Cherry Mui . unresolved

                                    This doesn't sound right. i (as an Inst) doesn't seem to carry data, so "encode p to i" is not right. Again, we should rename the type.

                                    Junyang Shao

                                    May you elaborate more why this isn't right?

                                    I changed the comment, does this look right to you now?

                                    Line 488, Patchset 10:func (i *Inst) tryEncodeA64Inst(p *obj.Prog) (uint32, bool) {
                                    Cherry Mui . resolved

                                    Just "tryEncode".

                                    How is a Prog supposed to be converted to an Inst? It looks like this function expects the Inst to already be populated. But it still needs to classify each operand in the prog. That seems confusing. What is the expected workflow here?

                                    In general, I would think we want to either work with only Prog and Addr, or do a translation them work only with Inst and Operand, not both at same time in most code.

                                    Junyang Shao

                                    The Inst (`i`) here is the pre-populated entry in the instruction table (which is generated by the generator, which will be the next CL in the chain), it's just like an optab entry. So this is the logic to match a prog to an Inst, and along the matching, if it's a success then it returns the binary. The reason that this is a `tryEncode` instead of `encode` is documented in the CL description, also in the comment of `elemEncoder`.

                                    I think this layer of Inst -> Prog interop has to be somewhere to lower prog to inst, in asm7 it is scattered around various of switch cases, here they are just processed in a centralized stage which is this function. You can find an example of the workflow in the test I added (CL 747920).

                                    I have made the addr accesses better, thanks.

                                    Cherry Mui

                                    Reading it again, I think what you want to do is that you want to compute the encoder functions of a Prog, and work on the Prog and Addr. The `Inst` is actually an encoder, which doesn't carry data. That is a reasonable approach.

                                    If this is the case, we should make the name clearer. Instead of `Inst` and `Operand`, probably `encoder` and `fieldEncoder` (or `argEncoder`). So the workflow is, when a Prog comes in, we compute its encoder based on its As and operand classes, and use the encoder (which includes a list of argEncoder's) to encode the Addr's.

                                    Either way, I think we need to make the workflow clear. Let's write an example with one instruction. And document in a comment.

                                    Junyang Shao

                                    Thanks! Working on it.

                                    Junyang Shao

                                    I have added a e2e test, now the assembler can assemble
                                    `ZADD` (we add the prefix `Z` to all SVE instructions that takes a Z, for deduplication purposes.)

                                    Cherry Mui

                                    I don't think this comment is addressed. At least, the confusing naming Inst and Operand are still there.

                                    Junyang Shao

                                    I have renamed `Inst` to `instEncoder`, I keep the `inst` to distinguish with `elemEncoders`.

                                    File src/cmd/internal/obj/util.go
                                    Line 517, Patchset 30: RBaseARM64 = 8 * 1024 // range [8k, 13k)
                                    Cherry Mui . resolved

                                    Is this still right?

                                    Junyang Shao

                                    Thanks for noticing this, updated.

                                    Open in Gerrit

                                    Related details

                                    Attention is currently required from:
                                    • Alexander Musman
                                    • Cherry Mui
                                    • David Chase
                                    Submit Requirements:
                                    • requirement is not satisfiedCode-Review
                                    • requirement is not 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: comment
                                    Gerrit-Project: go
                                    Gerrit-Branch: master
                                    Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                    Gerrit-Change-Number: 742620
                                    Gerrit-PatchSet: 32
                                    Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                                    Gerrit-Attention: Cherry Mui <cher...@google.com>
                                    Gerrit-Attention: David Chase <drc...@google.com>
                                    Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                                    Gerrit-Comment-Date: Tue, 10 Mar 2026 20:38:05 +0000
                                    Gerrit-HasComments: Yes
                                    Gerrit-Has-Labels: Yes
                                    Comment-In-Reply-To: Cherry Mui <cher...@google.com>
                                    unsatisfied_requirement
                                    open
                                    diffy

                                    David Chase (Gerrit)

                                    unread,
                                    Mar 10, 2026, 4:47:17 PM (9 days ago) Mar 10
                                    to Junyang Shao, goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, Cherry Mui, golang-co...@googlegroups.com
                                    Attention needed from Alexander Musman, Cherry Mui and Junyang Shao

                                    David Chase added 1 comment

                                    File src/cmd/internal/obj/arm64/encoding_gen.go
                                    Line 25, Patchset 30:// Check this is a merging predication
                                    func encodeGen8(v uint32) (uint32, BinarySymbolName, bool) {
                                    David Chase . unresolved
                                    David Chase

                                    I would replace oc_ARNG_173_226_173_226_PREGZM_141_8_141_8_ARNG_123_226_123_226
                                    with Zn_T__PgM__Zd_T__2.

                                    Open in Gerrit

                                    Related details

                                    Attention is currently required from:
                                    • Alexander Musman
                                    • Cherry Mui
                                    • Junyang Shao
                                    Submit Requirements:
                                    • requirement is not satisfiedCode-Review
                                    • requirement is not 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: comment
                                    Gerrit-Project: go
                                    Gerrit-Branch: master
                                    Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                    Gerrit-Change-Number: 742620
                                    Gerrit-PatchSet: 33
                                    Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                                    Gerrit-Attention: Cherry Mui <cher...@google.com>
                                    Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                                    Gerrit-Attention: Junyang Shao <shaoj...@google.com>
                                    Gerrit-Comment-Date: Tue, 10 Mar 2026 20:47:12 +0000
                                    Gerrit-HasComments: Yes
                                    Gerrit-Has-Labels: No
                                    unsatisfied_requirement
                                    open
                                    diffy

                                    Junyang Shao (Gerrit)

                                    unread,
                                    Mar 10, 2026, 4:55:59 PM (9 days ago) Mar 10
                                    to goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, David Chase, Cherry Mui, golang-co...@googlegroups.com
                                    Attention needed from Alexander Musman, Cherry Mui and David Chase

                                    Junyang Shao added 1 comment

                                    File src/cmd/internal/obj/arm64/encoding_gen.go
                                    Line 25, Patchset 30:// Check this is a merging predication
                                    func encodeGen8(v uint32) (uint32, BinarySymbolName, bool) {
                                    David Chase . resolved
                                    Junyang Shao

                                    I still don't understand why that is better, it's now saying nothing more than "I have Z, P, Z registers", which is already in the comment of this magic string.

                                    We can simply replace `oc_ARNG_173_226_173_226_PREGZM_141_8_141_8_ARNG_123_226_123_226` with `Magic1`, and it will be the same thing.

                                    Open in Gerrit

                                    Related details

                                    Attention is currently required from:
                                    • Alexander Musman
                                    • Cherry Mui
                                    • David Chase
                                    Submit Requirements:
                                    • requirement is not satisfiedCode-Review
                                    • requirement is not 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: comment
                                    Gerrit-Project: go
                                    Gerrit-Branch: master
                                    Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                    Gerrit-Change-Number: 742620
                                    Gerrit-PatchSet: 33
                                    Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                                    Gerrit-Attention: Cherry Mui <cher...@google.com>
                                    Gerrit-Attention: David Chase <drc...@google.com>
                                    Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                                    Gerrit-Comment-Date: Tue, 10 Mar 2026 20:55:56 +0000
                                    unsatisfied_requirement
                                    open
                                    diffy

                                    Junyang Shao (Gerrit)

                                    unread,
                                    Mar 10, 2026, 6:09:01 PM (9 days ago) Mar 10
                                    to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                                    Attention needed from Alexander Musman, Cherry Mui and David Chase

                                    Junyang Shao uploaded new patchset

                                    Junyang Shao uploaded patch set #34 to this change.
                                    Open in Gerrit

                                    Related details

                                    Attention is currently required from:
                                    • Alexander Musman
                                    • Cherry Mui
                                    • David Chase
                                    Submit Requirements:
                                    • requirement is not satisfiedCode-Review
                                    • requirement is not 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: newpatchset
                                    Gerrit-Project: go
                                    Gerrit-Branch: master
                                    Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                    Gerrit-Change-Number: 742620
                                    Gerrit-PatchSet: 34
                                    unsatisfied_requirement
                                    open
                                    diffy

                                    Junyang Shao (Gerrit)

                                    unread,
                                    Mar 10, 2026, 6:09:43 PM (9 days ago) Mar 10
                                    to goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, David Chase, Cherry Mui, golang-co...@googlegroups.com
                                    Attention needed from Alexander Musman, Cherry Mui and David Chase

                                    Junyang Shao voted and added 1 comment

                                    Votes added by Junyang Shao

                                    Commit-Queue+1

                                    1 comment

                                    File src/cmd/internal/obj/arm64/encoding_gen.go
                                    Junyang Shao

                                    I have applied your naming schemes.

                                    Open in Gerrit

                                    Related details

                                    Attention is currently required from:
                                    • Alexander Musman
                                    • Cherry Mui
                                    • David Chase
                                    Submit Requirements:
                                    • requirement is not satisfiedCode-Review
                                    • requirement is not 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: comment
                                    Gerrit-Project: go
                                    Gerrit-Branch: master
                                    Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                    Gerrit-Change-Number: 742620
                                    Gerrit-PatchSet: 34
                                    Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                                    Gerrit-Attention: Cherry Mui <cher...@google.com>
                                    Gerrit-Attention: David Chase <drc...@google.com>
                                    Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                                    Gerrit-Comment-Date: Tue, 10 Mar 2026 22:09:40 +0000
                                    Gerrit-HasComments: Yes
                                    Gerrit-Has-Labels: Yes
                                    unsatisfied_requirement
                                    open
                                    diffy

                                    David Chase (Gerrit)

                                    unread,
                                    Mar 10, 2026, 9:45:49 PM (9 days ago) Mar 10
                                    to Junyang Shao, goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, Cherry Mui, golang-co...@googlegroups.com
                                    Attention needed from Alexander Musman, Cherry Mui and Junyang Shao

                                    David Chase added 6 comments

                                    File src/cmd/asm/internal/asm/testdata/arm64sveenc.s
                                    Line 17, Patchset 34 (Latest): // TODO: ADDQP //
                                    David Chase . unresolved

                                    not sure if we care about stray white space in asm testdata, but this is stray whitespace.

                                    File src/cmd/internal/obj/arm64/a.out.go
                                    Line 232, Patchset 34 (Latest):// you should subtract obj.RBaseARM64 first. From this difference, bit 11
                                    David Chase . unresolved

                                    bit 11, or bit 12?

                                    Line 249, Patchset 34 (Latest):// Special registers, after subtracting obj.RBaseARM64, bit 12 indicates
                                    David Chase . unresolved

                                    12, or 13?

                                    Line 1030, Patchset 34 (Parent): ALAST
                                    David Chase . resolved

                                    I am curious where this went, wondering if it landed in an SVE-related file.
                                    Yes, it did.

                                    File src/cmd/internal/obj/arm64/encoding_gen.go
                                    Line 1, Patchset 34 (Latest):// license that can be found in the LICENSE file.
                                    David Chase . unresolved

                                    Not sure what happened here, caused a bunch of failures.

                                    File src/cmd/internal/obj/arm64/inst_gen.go
                                    Line 13, Patchset 34 (Latest): // ABS <Zd>.<T>, <Pg>/M, <Zn>.<T>
                                    David Chase . unresolved

                                    If we could reverse this, I think that would be good.

                                    Open in Gerrit

                                    Related details

                                    Attention is currently required from:
                                    • Alexander Musman
                                    • Cherry Mui
                                    • Junyang Shao
                                    Submit Requirements:
                                    • requirement is not satisfiedCode-Review
                                    • requirement is not 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: comment
                                    Gerrit-Project: go
                                    Gerrit-Branch: master
                                    Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                    Gerrit-Change-Number: 742620
                                    Gerrit-PatchSet: 34
                                    Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                                    Gerrit-Attention: Cherry Mui <cher...@google.com>
                                    Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                                    Gerrit-Attention: Junyang Shao <shaoj...@google.com>
                                    Gerrit-Comment-Date: Wed, 11 Mar 2026 01:45:45 +0000
                                    Gerrit-HasComments: Yes
                                    Gerrit-Has-Labels: No
                                    unsatisfied_requirement
                                    open
                                    diffy

                                    David Chase (Gerrit)

                                    unread,
                                    Mar 10, 2026, 9:46:57 PM (9 days ago) Mar 10
                                    to Junyang Shao, goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, Cherry Mui, golang-co...@googlegroups.com
                                    Attention needed from Alexander Musman, Cherry Mui and Junyang Shao

                                    David Chase added 1 comment

                                    File src/cmd/internal/obj/arm64/encoding_gen.go
                                    Line 25, Patchset 30:// Check this is a merging predication
                                    func encodeGen8(v uint32) (uint32, BinarySymbolName, bool) {
                                    David Chase . resolved

                                    I don't have a great idea for all of these encodeGen functions, but the ones that just check, could be named for what they check, so


                                    ```
                                    func isMergePred(...)
                                    ```
                                    It's not a complete solution, but everywhere that they appear, someone reading will know that much just from looking at them. If "8" has significance, that can be mentioned in the comment.

                                    Junyang Shao

                                    Acked, they will all go to the new CL, thanks

                                    Junyang Shao

                                    I just realize - this means those magic strings for operands and elements is going to have a "isMergePred" or "M" or "MP", etc.

                                    I am not sure this is a good idea, a uniformed ID number looks easier for the user to locate the encoding functions.

                                    David Chase

                                    The number is not better. "isMergePred" is no worse than "encodeGen8" in those magic strings, and might be better -- it means it isn't doing any actual encoding, for example.

                                    Junyang Shao
                                    I am not sure why do you think this is better.
                                    Let's see an example here:
                                    ```
                                    	// ABS  <Zd>.<T>, <Pg>/M, <Zn>.<T>
                                    	{
                                    goOp: AZABS,
                                    fixedBits: 0x416a000,
                                    args: oc_ARNG_173_226_173_226_PREGZM_141_8_141_8_ARNG_123_226_123_226, // <Zn>.<T>, <Pg>/M, <Zd>.<T>
                                    },
                                    ```
                                    In your new naming scheme, it will appear to be:
                                    ```
                                    	// ABS  <Zd>.<T>, <Pg>/M, <Zn>.<T>
                                    David Chase

                                    Done

                                    Gerrit-Comment-Date: Wed, 11 Mar 2026 01:46:54 +0000
                                    Gerrit-HasComments: Yes
                                    Gerrit-Has-Labels: No
                                    unsatisfied_requirement
                                    open
                                    diffy

                                    Junyang Shao (Gerrit)

                                    unread,
                                    Mar 11, 2026, 12:13:24 PM (8 days ago) Mar 11
                                    to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                                    Attention needed from Alexander Musman, Cherry Mui and Junyang Shao

                                    Junyang Shao uploaded new patchset

                                    Junyang Shao uploaded patch set #35 to this change.
                                    Following approvals got outdated and were removed:
                                    • TryBots-Pass: LUCI-TryBot-Result-1 by Go LUCI
                                    Open in Gerrit

                                    Related details

                                    Attention is currently required from:
                                    • Alexander Musman
                                    • Cherry Mui
                                    • Junyang Shao
                                    Submit Requirements:
                                    • requirement is not satisfiedCode-Review
                                    • requirement is not 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: newpatchset
                                    Gerrit-Project: go
                                    Gerrit-Branch: master
                                    Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                    Gerrit-Change-Number: 742620
                                    Gerrit-PatchSet: 35
                                    unsatisfied_requirement
                                    open
                                    diffy

                                    Junyang Shao (Gerrit)

                                    unread,
                                    Mar 11, 2026, 12:13:30 PM (8 days ago) Mar 11
                                    to goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, David Chase, Cherry Mui, golang-co...@googlegroups.com
                                    Attention needed from Alexander Musman, Cherry Mui and David Chase

                                    Junyang Shao voted and added 5 comments

                                    Votes added by Junyang Shao

                                    Commit-Queue+1

                                    5 comments

                                    File src/cmd/asm/internal/asm/testdata/arm64sveenc.s
                                    Line 17, Patchset 34: // TODO: ADDQP //
                                    David Chase . resolved

                                    not sure if we care about stray white space in asm testdata, but this is stray whitespace.

                                    Junyang Shao

                                    Done

                                    File src/cmd/internal/obj/arm64/a.out.go
                                    Line 232, Patchset 34:// you should subtract obj.RBaseARM64 first. From this difference, bit 11
                                    David Chase . resolved

                                    bit 11, or bit 12?

                                    Junyang Shao

                                    Thanks for noticing this, yes it should be bit 12

                                    Line 249, Patchset 34:// Special registers, after subtracting obj.RBaseARM64, bit 12 indicates
                                    David Chase . resolved

                                    12, or 13?

                                    Junyang Shao

                                    Done

                                    File src/cmd/internal/obj/arm64/encoding_gen.go
                                    Line 1, Patchset 34:// license that can be found in the LICENSE file.
                                    David Chase . resolved

                                    Not sure what happened here, caused a bunch of failures.

                                    Junyang Shao

                                    Hmm I didn't recall that I wrote it like that, maybe my antigravity is naughty.

                                    File src/cmd/internal/obj/arm64/inst_gen.go
                                    Line 13, Patchset 34: // ABS <Zd>.<T>, <Pg>/M, <Zn>.<T>
                                    David Chase . unresolved

                                    If we could reverse this, I think that would be good.

                                    Junyang Shao

                                    This is handy for the users to locate the ARM spec (they are from ARM spec directly), are we sure that's what the user want?

                                    Open in Gerrit

                                    Related details

                                    Attention is currently required from:
                                    • Alexander Musman
                                    • Cherry Mui
                                    • David Chase
                                    Submit Requirements:
                                    • requirement is not satisfiedCode-Review
                                    • requirement is not 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: comment
                                    Gerrit-Project: go
                                    Gerrit-Branch: master
                                    Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                    Gerrit-Change-Number: 742620
                                    Gerrit-PatchSet: 35
                                    Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                                    Gerrit-Attention: Cherry Mui <cher...@google.com>
                                    Gerrit-Attention: David Chase <drc...@google.com>
                                    Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                                    Gerrit-Comment-Date: Wed, 11 Mar 2026 16:13:26 +0000
                                    unsatisfied_requirement
                                    open
                                    diffy

                                    Cherry Mui (Gerrit)

                                    unread,
                                    Mar 11, 2026, 12:16:06 PM (8 days ago) Mar 11
                                    to Junyang Shao, goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, David Chase, golang-co...@googlegroups.com
                                    Attention needed from Alexander Musman, David Chase and Junyang Shao

                                    Cherry Mui added 1 comment

                                    File src/cmd/internal/obj/arm64/inst_gen.go
                                    Line 13, Patchset 34: // ABS <Zd>.<T>, <Pg>/M, <Zn>.<T>
                                    David Chase . unresolved

                                    If we could reverse this, I think that would be good.

                                    Junyang Shao

                                    This is handy for the users to locate the ARM spec (they are from ARM spec directly), are we sure that's what the user want?

                                    Cherry Mui

                                    We should use one set of conventions in a package. Otherwise it is just confusing. As this is the Go assembler, we should use Go syntax everywhere.

                                    The Go-GNU syntax translation should be included in doc.go.

                                    Open in Gerrit

                                    Related details

                                    Attention is currently required from:
                                    • Alexander Musman
                                    • David Chase
                                    • Junyang Shao
                                    Submit Requirements:
                                    • requirement is not satisfiedCode-Review
                                    • requirement is not 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: comment
                                    Gerrit-Project: go
                                    Gerrit-Branch: master
                                    Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                    Gerrit-Change-Number: 742620
                                    Gerrit-PatchSet: 35
                                    Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                                    Gerrit-Attention: David Chase <drc...@google.com>
                                    Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                                    Gerrit-Attention: Junyang Shao <shaoj...@google.com>
                                    Gerrit-Comment-Date: Wed, 11 Mar 2026 16:16:02 +0000
                                    unsatisfied_requirement
                                    open
                                    diffy

                                    Junyang Shao (Gerrit)

                                    unread,
                                    Mar 11, 2026, 12:22:51 PM (8 days ago) Mar 11
                                    to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                                    Attention needed from Alexander Musman, David Chase and Junyang Shao

                                    Junyang Shao uploaded new patchset

                                    Junyang Shao uploaded patch set #36 to this change.
                                    Open in Gerrit

                                    Related details

                                    Attention is currently required from:
                                    • Alexander Musman
                                    • David Chase
                                    • Junyang Shao
                                    Submit Requirements:
                                    • requirement is not satisfiedCode-Review
                                    • requirement is not 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: newpatchset
                                    Gerrit-Project: go
                                    Gerrit-Branch: master
                                    Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                    Gerrit-Change-Number: 742620
                                    Gerrit-PatchSet: 36
                                    unsatisfied_requirement
                                    open
                                    diffy

                                    Junyang Shao (Gerrit)

                                    unread,
                                    Mar 11, 2026, 12:29:44 PM (8 days ago) Mar 11
                                    to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                                    Attention needed from Alexander Musman, David Chase and Junyang Shao

                                    Junyang Shao uploaded new patchset

                                    Junyang Shao uploaded patch set #37 to this change.
                                    Open in Gerrit

                                    Related details

                                    Attention is currently required from:
                                    • Alexander Musman
                                    • David Chase
                                    • Junyang Shao
                                    Submit Requirements:
                                    • requirement is not satisfiedCode-Review
                                    • requirement is not 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: newpatchset
                                    Gerrit-Project: go
                                    Gerrit-Branch: master
                                    Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                    Gerrit-Change-Number: 742620
                                    Gerrit-PatchSet: 37
                                    unsatisfied_requirement
                                    open
                                    diffy

                                    Junyang Shao (Gerrit)

                                    unread,
                                    Mar 11, 2026, 12:29:58 PM (8 days ago) Mar 11
                                    to goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, David Chase, Cherry Mui, golang-co...@googlegroups.com
                                    Attention needed from Alexander Musman, Cherry Mui and David Chase

                                    Junyang Shao voted and added 1 comment

                                    Votes added by Junyang Shao

                                    Commit-Queue+1

                                    1 comment

                                    File src/cmd/internal/obj/arm64/inst_gen.go
                                    Line 13, Patchset 34: // ABS <Zd>.<T>, <Pg>/M, <Zn>.<T>
                                    David Chase . resolved

                                    If we could reverse this, I think that would be good.

                                    Junyang Shao

                                    This is handy for the users to locate the ARM spec (they are from ARM spec directly), are we sure that's what the user want?

                                    Cherry Mui

                                    We should use one set of conventions in a package. Otherwise it is just confusing. As this is the Go assembler, we should use Go syntax everywhere.

                                    The Go-GNU syntax translation should be included in doc.go.

                                    Junyang Shao

                                    Done

                                    Open in Gerrit

                                    Related details

                                    Attention is currently required from:
                                    • Alexander Musman
                                    • Cherry Mui
                                    • David Chase
                                    Submit Requirements:
                                    • requirement is not satisfiedCode-Review
                                    • requirement is not 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: comment
                                    Gerrit-Project: go
                                    Gerrit-Branch: master
                                    Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                    Gerrit-Change-Number: 742620
                                    Gerrit-PatchSet: 37
                                    Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                                    Gerrit-Attention: Cherry Mui <cher...@google.com>
                                    Gerrit-Attention: David Chase <drc...@google.com>
                                    Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                                    Gerrit-Comment-Date: Wed, 11 Mar 2026 16:29:55 +0000
                                    Gerrit-HasComments: Yes
                                    Gerrit-Has-Labels: Yes
                                    Comment-In-Reply-To: Cherry Mui <cher...@google.com>
                                    unsatisfied_requirement
                                    open
                                    diffy

                                    Junyang Shao (Gerrit)

                                    unread,
                                    Mar 11, 2026, 12:47:51 PM (8 days ago) Mar 11
                                    to goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, David Chase, Cherry Mui, golang-co...@googlegroups.com
                                    Attention needed from Alexander Musman, Cherry Mui and David Chase

                                    Junyang Shao voted Commit-Queue+1

                                    Commit-Queue+1
                                    Open in Gerrit

                                    Related details

                                    Attention is currently required from:
                                    • Alexander Musman
                                    • Cherry Mui
                                    • David Chase
                                    Submit Requirements:
                                    • requirement is not satisfiedCode-Review
                                    • requirement is not 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: comment
                                    Gerrit-Project: go
                                    Gerrit-Branch: master
                                    Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                    Gerrit-Change-Number: 742620
                                    Gerrit-PatchSet: 38
                                    Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                                    Gerrit-Attention: Cherry Mui <cher...@google.com>
                                    Gerrit-Attention: David Chase <drc...@google.com>
                                    Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                                    Gerrit-Comment-Date: Wed, 11 Mar 2026 16:47:48 +0000
                                    Gerrit-HasComments: No
                                    Gerrit-Has-Labels: Yes
                                    unsatisfied_requirement
                                    open
                                    diffy

                                    Cherry Mui (Gerrit)

                                    unread,
                                    Mar 11, 2026, 3:54:17 PM (8 days ago) Mar 11
                                    to Junyang Shao, goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, David Chase, golang-co...@googlegroups.com
                                    Attention needed from Alexander Musman, David Chase and Junyang Shao

                                    Cherry Mui added 1 comment

                                    File src/cmd/internal/obj/arm64/inst.go
                                    Line 145, Patchset 38 (Latest):// tryEncode tries to encode p into the instruction encoding i represents,
                                    Cherry Mui . unresolved

                                    encode p with i

                                    Open in Gerrit

                                    Related details

                                    Attention is currently required from:
                                    • Alexander Musman
                                    • David Chase
                                    • Junyang Shao
                                    Submit Requirements:
                                      • requirement is not satisfiedCode-Review
                                      • requirement is not 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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                      Gerrit-Change-Number: 742620
                                      Gerrit-PatchSet: 38
                                      Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                                      Gerrit-Attention: David Chase <drc...@google.com>
                                      Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                                      Gerrit-Attention: Junyang Shao <shaoj...@google.com>
                                      Gerrit-Comment-Date: Wed, 11 Mar 2026 19:54:14 +0000
                                      Gerrit-HasComments: Yes
                                      Gerrit-Has-Labels: No
                                      unsatisfied_requirement
                                      satisfied_requirement
                                      open
                                      diffy

                                      Junyang Shao (Gerrit)

                                      unread,
                                      Mar 11, 2026, 4:11:51 PM (8 days ago) Mar 11
                                      to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                                      Attention needed from Alexander Musman, David Chase and Junyang Shao

                                      Junyang Shao uploaded new patchset

                                      Junyang Shao uploaded patch set #39 to this change.
                                      Following approvals got outdated and were removed:
                                      • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
                                      Open in Gerrit

                                      Related details

                                      Attention is currently required from:
                                      • Alexander Musman
                                      • David Chase
                                      • Junyang Shao
                                      Submit Requirements:
                                        • requirement is not satisfiedCode-Review
                                        • requirement is not 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: newpatchset
                                        Gerrit-Project: go
                                        Gerrit-Branch: master
                                        Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                        Gerrit-Change-Number: 742620
                                        Gerrit-PatchSet: 39
                                        unsatisfied_requirement
                                        open
                                        diffy

                                        Junyang Shao (Gerrit)

                                        unread,
                                        Mar 11, 2026, 4:13:05 PM (8 days ago) Mar 11
                                        to goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, David Chase, Cherry Mui, golang-co...@googlegroups.com
                                        Attention needed from Alexander Musman, Cherry Mui and David Chase

                                        Junyang Shao voted and added 2 comments

                                        Votes added by Junyang Shao

                                        Commit-Queue+1

                                        2 comments

                                        File src/cmd/internal/obj/arm64/inst.go
                                        Line 125, Patchset 30:// tryEncode tries to encode p to i, it returns the encoded binary and ok signal.
                                        Cherry Mui . resolved

                                        This doesn't sound right. i (as an Inst) doesn't seem to carry data, so "encode p to i" is not right. Again, we should rename the type.

                                        Junyang Shao

                                        May you elaborate more why this isn't right?

                                        I changed the comment, does this look right to you now?

                                        Junyang Shao

                                        Done

                                        Line 145, Patchset 38:// tryEncode tries to encode p into the instruction encoding i represents,
                                        Cherry Mui . resolved

                                        encode p with i

                                        Junyang Shao

                                        Done

                                        Open in Gerrit

                                        Related details

                                        Attention is currently required from:
                                        • Alexander Musman
                                        • Cherry Mui
                                        • David Chase
                                        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: comment
                                          Gerrit-Project: go
                                          Gerrit-Branch: master
                                          Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                          Gerrit-Change-Number: 742620
                                          Gerrit-PatchSet: 39
                                          Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                                          Gerrit-Attention: Cherry Mui <cher...@google.com>
                                          Gerrit-Attention: David Chase <drc...@google.com>
                                          Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                                          Gerrit-Comment-Date: Wed, 11 Mar 2026 20:13:02 +0000
                                          Gerrit-HasComments: Yes
                                          Gerrit-Has-Labels: Yes
                                          Comment-In-Reply-To: Cherry Mui <cher...@google.com>
                                          Comment-In-Reply-To: Junyang Shao <shaoj...@google.com>
                                          unsatisfied_requirement
                                          satisfied_requirement
                                          open
                                          diffy

                                          Cherry Mui (Gerrit)

                                          unread,
                                          Mar 13, 2026, 2:45:16 PM (6 days ago) Mar 13
                                          to Junyang Shao, goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, David Chase, golang-co...@googlegroups.com
                                          Attention needed from Alexander Musman, David Chase and Junyang Shao

                                          Cherry Mui added 11 comments

                                          File src/cmd/internal/obj/arm64/a.out.go
                                          Line 225, Patchset 39 (Latest): REG_ZARNG // Zn.<T>
                                          REG_PARNG // Pn.<T> or Pn/M, Pn/Z
                                          Cherry Mui . unresolved

                                          Are these masks? Merge mask and zero mask? Maybe they should not be called arrangement (ARNG).

                                          Line 1175, Patchset 30: AB = obj.AJMP
                                          ABL = obj.ACALL
                                          Cherry Mui . unresolved

                                          It is fine to keep these two here. It has nothing to do with SVE.

                                          Line 1218, Patchset 39 (Latest): ARNG_M
                                          ARNG_Z
                                          Cherry Mui . unresolved

                                          Same here. If these are not arrangements, give them a different name.

                                          File src/cmd/internal/obj/arm64/encoding_gen.go
                                          Line 25, Patchset 30:// Check this is a merging predication
                                          func encodeGen8(v uint32) (uint32, BinarySymbolName, bool) {
                                          David Chase . unresolved

                                          I don't have a great idea for all of these encodeGen functions, but the ones that just check, could be named for what they check, so
                                          ```
                                          func isMergePred(...)
                                          ```
                                          It's not a complete solution, but everywhere that they appear, someone reading will know that much just from looking at them. If "8" has significance, that can be mentioned in the comment.

                                          Junyang Shao

                                          Acked, they will all go to the new CL, thanks

                                          Junyang Shao

                                          I just realize - this means those magic strings for operands and elements is going to have a "isMergePred" or "M" or "MP", etc.

                                          I am not sure this is a good idea, a uniformed ID number looks easier for the user to locate the encoding functions.

                                          David Chase

                                          The number is not better. "isMergePred" is no worse than "encodeGen8" in those magic strings, and might be better -- it means it isn't doing any actual encoding, for example.

                                          Junyang Shao
                                          I am not sure why do you think this is better.
                                          Let's see an example here:
                                          ```
                                          	// ABS  <Zd>.<T>, <Pg>/M, <Zn>.<T>
                                          	{
                                          goOp: AZABS,
                                          fixedBits: 0x416a000,
                                          args: oc_ARNG_173_226_173_226_PREGZM_141_8_141_8_ARNG_123_226_123_226, // <Zn>.<T>, <Pg>/M, <Zd>.<T>
                                          },
                                          ```
                                          In your new naming scheme, it will appear to be:
                                          ```
                                          	// ABS  <Zd>.<T>, <Pg>/M, <Zn>.<T>
                                          Cherry Mui

                                          Is this resolved? As of PS39, the encoding functions are still named with numbers.

                                          File src/cmd/internal/obj/arm64/goops_gen.go
                                          Line 8, Patchset 39 (Latest): APAND obj.As = AAUTIB1716 + 1 + iota
                                          Cherry Mui . unresolved

                                          Instead of using a specific instruction, it is probably better to define something like ASVEStart in a.out.go, to mark the start of SVE instructions. Then it doesn't need to change if we add more non-SVE instructions.

                                          File src/cmd/internal/obj/arm64/inst.go
                                          Line 58, Patchset 39 (Latest): elemEncoders []func(uint32) (uint32, component, bool)
                                          Cherry Mui . unresolved

                                          Does the "component" result depend on the input of the function? It seems every encode function always returns the same value? If this is the case, it seems a bit weird to write it as a return value. Maybe use a separate field?

                                          Line 85, Patchset 39 (Latest):// Right now AClass is just stored at the lower 5 bits of the Offset field...
                                          Cherry Mui . unresolved

                                          Where is it stored?

                                          Line 102, Patchset 30:func encodeAddr(a *obj.Addr, acl AClass, index int) uint32 {
                                          Cherry Mui . unresolved

                                          What is the meaning if the index? Why an Addr has multiple elements? How are they indexed?

                                          Junyang Shao

                                          `index` is an index into the element list, you can find it in `inst_gen.go`.

                                          Cherry Mui

                                          It looks like it is to identify a component of an Addr, like the "Zm" or "T" from a "Zm.T"? Add a comment explain this.

                                          This function doesn't actually encode the Addr, but extract the component. So the function probably should be renamed to addrComponent or so.

                                          This also makes me wonder: should we just "flatten" it? I.e. instead of iterating first on Addr, then on the components of it, just directly iterate on the components. Same for the encoder side: one flattened list of component encoders, instead of two levels ([]Operand, then []elemEncoder).

                                          Junyang Shao

                                          I think the switch case comment documented this pretty well, but to make it clearer I also copy-pasted it to the function comment.

                                          I am not sure I understand the flattening idea. What do you mean iterate on components? Before we iterate the `obj.Addr`s, we simply won't know its `AClass`, and we won't know its component layouts. And the assembling pipeline upstream gave us a list of `obj.Addr`s, not a list of components. So we have to iterate `obj.Addr`s first.

                                          And we won't be able to remove the switch case too, because every index has its unique semantics for every `AClass`, so we need a place to check those `{AClass, index}` pairs and it will eventually be a switch case.

                                          Cherry Mui

                                          Thanks. The function should probably still be renamed, to addrComponent or so. It doesn't actually encode an Addr.

                                          Line 154, Patchset 39 (Latest): for _, op := range i.args {
                                          Cherry Mui . unresolved

                                          Instead of range over i.args, we can flip and range over opsInProg(p). Then we don't need a pull iterator. We can directly index into i.args.

                                          While this code is not performance critical, a coroutine for every instruction is probably still too much.

                                          File src/cmd/internal/obj/arm64/list7.go
                                          Line 95, Patchset 39 (Latest): case ARNG_M:
                                          return "M"
                                          case ARNG_Z:
                                          return "Z"
                                          Cherry Mui . unresolved

                                          Are these masks? Merge mask and zero mask?

                                          Line 95, Patchset 39 (Latest): case ARNG_M:
                                          return "M"
                                          case ARNG_Z:
                                          return "Z"
                                          Cherry Mui . unresolved

                                          Are these masks? Merge mask and zero mask?

                                          Open in Gerrit

                                          Related details

                                          Attention is currently required from:
                                          • Alexander Musman
                                          • David Chase
                                          • Junyang Shao
                                          Submit Requirements:
                                            • requirement is not satisfiedCode-Review
                                            • requirement is not 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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                            Gerrit-Change-Number: 742620
                                            Gerrit-PatchSet: 39
                                            Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                                            Gerrit-Attention: David Chase <drc...@google.com>
                                            Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                                            Gerrit-Attention: Junyang Shao <shaoj...@google.com>
                                            Gerrit-Comment-Date: Fri, 13 Mar 2026 18:45:13 +0000
                                            Gerrit-HasComments: Yes
                                            Gerrit-Has-Labels: No
                                            Comment-In-Reply-To: Cherry Mui <cher...@google.com>
                                            unsatisfied_requirement
                                            satisfied_requirement
                                            open
                                            diffy

                                            Junyang Shao (Gerrit)

                                            unread,
                                            Mar 13, 2026, 5:01:34 PM (6 days ago) Mar 13
                                            to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                                            Attention needed from Alexander Musman, David Chase and Junyang Shao

                                            Junyang Shao uploaded new patchset

                                            Junyang Shao uploaded patch set #40 to this change.
                                            Following approvals got outdated and were removed:
                                            • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI

                                            Related details

                                            Attention is currently required from:
                                            • Alexander Musman
                                            • David Chase
                                            • Junyang Shao
                                            Submit Requirements:
                                              • requirement is not satisfiedCode-Review
                                              • requirement is not 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: newpatchset
                                              Gerrit-Project: go
                                              Gerrit-Branch: master
                                              Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                              Gerrit-Change-Number: 742620
                                              Gerrit-PatchSet: 40
                                              unsatisfied_requirement
                                              open
                                              diffy

                                              Junyang Shao (Gerrit)

                                              unread,
                                              Mar 13, 2026, 5:34:51 PM (6 days ago) Mar 13
                                              to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                                              Attention needed from Alexander Musman, David Chase and Junyang Shao

                                              Junyang Shao uploaded new patchset

                                              Junyang Shao uploaded patch set #41 to this change.
                                              Open in Gerrit

                                              Related details

                                              Attention is currently required from:
                                              • Alexander Musman
                                              • David Chase
                                              • Junyang Shao
                                              Submit Requirements:
                                              • requirement is not satisfiedCode-Review
                                              • requirement is not 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: newpatchset
                                              Gerrit-Project: go
                                              Gerrit-Branch: master
                                              Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                              Gerrit-Change-Number: 742620
                                              Gerrit-PatchSet: 41
                                              unsatisfied_requirement
                                              open
                                              diffy

                                              Junyang Shao (Gerrit)

                                              unread,
                                              Mar 13, 2026, 5:37:09 PM (6 days ago) Mar 13
                                              to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                                              Attention needed from Alexander Musman, David Chase and Junyang Shao

                                              Junyang Shao uploaded new patchset

                                              Junyang Shao uploaded patch set #42 to this change.
                                              Open in Gerrit

                                              Related details

                                              Attention is currently required from:
                                              • Alexander Musman
                                              • David Chase
                                              • Junyang Shao
                                              Submit Requirements:
                                              • requirement is not satisfiedCode-Review
                                              • requirement is not 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: newpatchset
                                              Gerrit-Project: go
                                              Gerrit-Branch: master
                                              Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                              Gerrit-Change-Number: 742620
                                              Gerrit-PatchSet: 42
                                              unsatisfied_requirement
                                              open
                                              diffy

                                              Junyang Shao (Gerrit)

                                              unread,
                                              Mar 13, 2026, 5:37:20 PM (6 days ago) Mar 13
                                              to goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, David Chase, Cherry Mui, golang-co...@googlegroups.com
                                              Attention needed from Alexander Musman, Cherry Mui and David Chase

                                              Junyang Shao voted and added 11 comments

                                              Votes added by Junyang Shao

                                              Commit-Queue+1

                                              11 comments

                                              File src/cmd/internal/obj/arm64/a.out.go
                                              Line 225, Patchset 39: REG_ZARNG // Zn.<T>

                                              REG_PARNG // Pn.<T> or Pn/M, Pn/Z
                                              Cherry Mui . resolved

                                              Are these masks? Merge mask and zero mask? Maybe they should not be called arrangement (ARNG).

                                              Junyang Shao

                                              `REG_ZARNG` is Z register with arrangement, it's a vector register.
                                              `REG_PARNG` is a combination of P register with arrangement and P register with Masking and Zeroing predications.

                                              I can call it `REG_PARNGZM` to note that they are such a combination.
                                              P with arrangement and P with predication have exactly the same `Prog` layout pattern, that's why I merged them.

                                              Line 1175, Patchset 30: AB = obj.AJMP
                                              ABL = obj.ACALL
                                              Cherry Mui . resolved

                                              It is fine to keep these two here. It has nothing to do with SVE.

                                              Junyang Shao

                                              Done

                                              Line 1218, Patchset 39: ARNG_M
                                              ARNG_Z
                                              Cherry Mui . resolved

                                              Same here. If these are not arrangements, give them a different name.

                                              Junyang Shao

                                              Done

                                              File src/cmd/internal/obj/arm64/encoding_gen.go
                                              Line 25, Patchset 30:// Check this is a merging predication
                                              func encodeGen8(v uint32) (uint32, BinarySymbolName, bool) {
                                              David Chase . resolved
                                              Junyang Shao

                                              Hope you like the new names.

                                              File src/cmd/internal/obj/arm64/goops_gen.go
                                              Line 8, Patchset 39: APAND obj.As = AAUTIB1716 + 1 + iota
                                              Cherry Mui . resolved

                                              Instead of using a specific instruction, it is probably better to define something like ASVEStart in a.out.go, to mark the start of SVE instructions. Then it doesn't need to change if we add more non-SVE instructions.

                                              Junyang Shao

                                              Done

                                              File src/cmd/internal/obj/arm64/inst.go
                                              Line 58, Patchset 39: elemEncoders []func(uint32) (uint32, component, bool)
                                              Cherry Mui . resolved

                                              Does the "component" result depend on the input of the function? It seems every encode function always returns the same value? If this is the case, it seems a bit weird to write it as a return value. Maybe use a separate field?

                                              Junyang Shao

                                              Done

                                              Line 85, Patchset 39:// Right now AClass is just stored at the lower 5 bits of the Offset field...
                                              Cherry Mui . resolved

                                              Where is it stored?

                                              Junyang Shao

                                              Stale comment.

                                              Line 102, Patchset 30:func encodeAddr(a *obj.Addr, acl AClass, index int) uint32 {
                                              Cherry Mui . resolved

                                              What is the meaning if the index? Why an Addr has multiple elements? How are they indexed?

                                              Junyang Shao

                                              `index` is an index into the element list, you can find it in `inst_gen.go`.

                                              Cherry Mui

                                              It looks like it is to identify a component of an Addr, like the "Zm" or "T" from a "Zm.T"? Add a comment explain this.

                                              This function doesn't actually encode the Addr, but extract the component. So the function probably should be renamed to addrComponent or so.

                                              This also makes me wonder: should we just "flatten" it? I.e. instead of iterating first on Addr, then on the components of it, just directly iterate on the components. Same for the encoder side: one flattened list of component encoders, instead of two levels ([]Operand, then []elemEncoder).

                                              Junyang Shao

                                              I think the switch case comment documented this pretty well, but to make it clearer I also copy-pasted it to the function comment.

                                              I am not sure I understand the flattening idea. What do you mean iterate on components? Before we iterate the `obj.Addr`s, we simply won't know its `AClass`, and we won't know its component layouts. And the assembling pipeline upstream gave us a list of `obj.Addr`s, not a list of components. So we have to iterate `obj.Addr`s first.

                                              And we won't be able to remove the switch case too, because every index has its unique semantics for every `AClass`, so we need a place to check those `{AClass, index}` pairs and it will eventually be a switch case.

                                              Cherry Mui

                                              Thanks. The function should probably still be renamed, to addrComponent or so. It doesn't actually encode an Addr.

                                              Junyang Shao

                                              Done

                                              Line 154, Patchset 39: for _, op := range i.args {
                                              Cherry Mui . resolved

                                              Instead of range over i.args, we can flip and range over opsInProg(p). Then we don't need a pull iterator. We can directly index into i.args.

                                              While this code is not performance critical, a coroutine for every instruction is probably still too much.

                                              Junyang Shao

                                              Done

                                              File src/cmd/internal/obj/arm64/list7.go

                                              return "M"
                                              case ARNG_Z:
                                              return "Z"
                                              Cherry Mui . resolved

                                              Are these masks? Merge mask and zero mask?

                                              Junyang Shao

                                              Done


                                              return "M"
                                              case ARNG_Z:
                                              return "Z"
                                              Cherry Mui . resolved

                                              Are these masks? Merge mask and zero mask?

                                              Junyang Shao

                                              Done

                                              Open in Gerrit

                                              Related details

                                              Attention is currently required from:
                                              • Alexander Musman
                                              • Cherry Mui
                                              • David Chase
                                              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: comment
                                                Gerrit-Project: go
                                                Gerrit-Branch: master
                                                Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                                Gerrit-Change-Number: 742620
                                                Gerrit-PatchSet: 42
                                                Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                                                Gerrit-Attention: Cherry Mui <cher...@google.com>
                                                Gerrit-Attention: David Chase <drc...@google.com>
                                                Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                                                Gerrit-Comment-Date: Fri, 13 Mar 2026 21:37:16 +0000
                                                Gerrit-HasComments: Yes
                                                Gerrit-Has-Labels: Yes
                                                unsatisfied_requirement
                                                satisfied_requirement
                                                open
                                                diffy

                                                Cherry Mui (Gerrit)

                                                unread,
                                                Mar 13, 2026, 5:56:47 PM (6 days ago) Mar 13
                                                to Junyang Shao, goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, David Chase, golang-co...@googlegroups.com
                                                Attention needed from Alexander Musman, David Chase and Junyang Shao

                                                Cherry Mui added 8 comments

                                                Patchset-level comments
                                                File-level comment, Patchset 42 (Latest):
                                                Cherry Mui . resolved

                                                Looks good overall. Thanks.

                                                File src/cmd/asm/internal/arch/arch.go
                                                Line 319, Patchset 42 (Latest): if s == "SVESTART" {
                                                sveStartIndex = i
                                                }
                                                if sveStartIndex != -1 {
                                                instructions[s] = arm64.ASVESTART + obj.As(i) - obj.As(sveStartIndex)
                                                Cherry Mui . unresolved

                                                Why this code needs to know SVESTART? It should still be sequential, right?

                                                File src/cmd/asm/internal/asm/asm.go
                                                Line 745, Patchset 42 (Latest): case op > arm64.ASVESTART:
                                                Cherry Mui . unresolved

                                                Probably define an IsARM64SVE helper function.

                                                File src/cmd/asm/internal/asm/testdata/arm64sveenc.s
                                                Line 6, Patchset 42 (Latest): ZABS Z11.B, P5.M, Z6.B // 66b51604
                                                ZABS Z11.B, P5.Z, Z6.B // 66b50604
                                                ZADCLB Z1.S, Z26.S, Z25.S // 59d30145
                                                Cherry Mui . unresolved

                                                Minor: would be good to align the comments.

                                                File src/cmd/internal/obj/arm64/a.out.go
                                                Line 1193, Patchset 42 (Latest): ASVESTART = AAUTIB1716 + 1
                                                Cherry Mui . unresolved

                                                Define this right after AAUTIB1716, so it doesn't need explicit +1.

                                                File src/cmd/internal/obj/arm64/asm7.go
                                                Line 2188, Patchset 42 (Latest):var sveOptab = Optab{0, C_GOK, C_GOK, C_GOK, C_GOK, C_GOK, 120, 4, 0, 0, 0}
                                                Cherry Mui . unresolved

                                                Probably define a case number that is far from others, so we have plenty of room to add instructions if necessary.

                                                File src/cmd/internal/obj/arm64/encoding_gen.go
                                                Line 7, Patchset 42 (Latest): // (tszh :: tszl)
                                                Cherry Mui . unresolved

                                                What is this?

                                                File src/cmd/internal/obj/arm64/inst_gen.go
                                                Line 11, Patchset 42 (Latest): // ABS <Zn>.<T>, <Pg>/M, <Zd>.<T>
                                                Cherry Mui . unresolved

                                                Could we use the Go assembly name, ZABS?

                                                Open in Gerrit

                                                Related details

                                                Attention is currently required from:
                                                • Alexander Musman
                                                • David Chase
                                                • Junyang Shao
                                                Submit Requirements:
                                                  • requirement is not satisfiedCode-Review
                                                  • requirement is not 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: comment
                                                  Gerrit-Project: go
                                                  Gerrit-Branch: master
                                                  Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                                  Gerrit-Change-Number: 742620
                                                  Gerrit-PatchSet: 42
                                                  Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                                                  Gerrit-Attention: David Chase <drc...@google.com>
                                                  Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                                                  Gerrit-Attention: Junyang Shao <shaoj...@google.com>
                                                  Gerrit-Comment-Date: Fri, 13 Mar 2026 21:56:42 +0000
                                                  Gerrit-HasComments: Yes
                                                  Gerrit-Has-Labels: No
                                                  unsatisfied_requirement
                                                  open
                                                  diffy

                                                  Junyang Shao (Gerrit)

                                                  unread,
                                                  Mar 13, 2026, 6:12:14 PM (6 days ago) Mar 13
                                                  to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                                                  Attention needed from Alexander Musman, David Chase and Junyang Shao

                                                  Junyang Shao uploaded new patchset

                                                  Junyang Shao uploaded patch set #43 to this change.
                                                  Following approvals got outdated and were removed:
                                                  • TryBots-Pass: LUCI-TryBot-Result-1 by Go LUCI
                                                  Open in Gerrit

                                                  Related details

                                                  Attention is currently required from:
                                                  • Alexander Musman
                                                  • David Chase
                                                  • Junyang Shao
                                                  Submit Requirements:
                                                  • requirement is not satisfiedCode-Review
                                                  • requirement is not 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: newpatchset
                                                  Gerrit-Project: go
                                                  Gerrit-Branch: master
                                                  Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                                  Gerrit-Change-Number: 742620
                                                  Gerrit-PatchSet: 43
                                                  unsatisfied_requirement
                                                  open
                                                  diffy

                                                  Junyang Shao (Gerrit)

                                                  unread,
                                                  Mar 13, 2026, 6:12:55 PM (6 days ago) Mar 13
                                                  to goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, David Chase, Cherry Mui, golang-co...@googlegroups.com
                                                  Attention needed from Alexander Musman, Cherry Mui and David Chase

                                                  Junyang Shao voted and added 7 comments

                                                  Votes added by Junyang Shao

                                                  Commit-Queue+1

                                                  7 comments

                                                  File src/cmd/asm/internal/arch/arch.go
                                                  Line 319, Patchset 42: if s == "SVESTART" {

                                                  sveStartIndex = i
                                                  }
                                                  if sveStartIndex != -1 {
                                                  instructions[s] = arm64.ASVESTART + obj.As(i) - obj.As(sveStartIndex)
                                                  Cherry Mui . resolved

                                                  Why this code needs to know SVESTART? It should still be sequential, right?

                                                  Junyang Shao

                                                  Yes, that was some stale code I was stumbled on, removed.

                                                  File src/cmd/asm/internal/asm/asm.go
                                                  Line 745, Patchset 42: case op > arm64.ASVESTART:
                                                  Cherry Mui . resolved

                                                  Probably define an IsARM64SVE helper function.

                                                  Junyang Shao

                                                  Done

                                                  File src/cmd/asm/internal/asm/testdata/arm64sveenc.s
                                                  Line 6, Patchset 42: ZABS Z11.B, P5.M, Z6.B // 66b51604

                                                  ZABS Z11.B, P5.Z, Z6.B // 66b50604
                                                  ZADCLB Z1.S, Z26.S, Z25.S // 59d30145
                                                  Cherry Mui . resolved

                                                  Minor: would be good to align the comments.

                                                  Junyang Shao

                                                  Done

                                                  File src/cmd/internal/obj/arm64/a.out.go
                                                  Line 1193, Patchset 42: ASVESTART = AAUTIB1716 + 1
                                                  Cherry Mui . resolved

                                                  Define this right after AAUTIB1716, so it doesn't need explicit +1.

                                                  Junyang Shao

                                                  Done

                                                  File src/cmd/internal/obj/arm64/asm7.go
                                                  Line 2188, Patchset 42:var sveOptab = Optab{0, C_GOK, C_GOK, C_GOK, C_GOK, C_GOK, 120, 4, 0, 0, 0}
                                                  Cherry Mui . resolved

                                                  Probably define a case number that is far from others, so we have plenty of room to add instructions if necessary.

                                                  Junyang Shao

                                                  I think the largest we can do for `int8` is 127, I set it to 127.

                                                  File src/cmd/internal/obj/arm64/encoding_gen.go
                                                  Line 7, Patchset 42: // (tszh :: tszl)
                                                  Cherry Mui . resolved

                                                  What is this?

                                                  Junyang Shao

                                                  It's the component symbol string, handy for the user and myself to map back to the assembly. See one example in this file:
                                                  https://developer.arm.com/documentation/ddi0602/2025-12/SVE-Instructions/SRI--Shift-right-and-insert--immediate--?lang=en

                                                  If you think they are not necessary, I have removed them.

                                                  File src/cmd/internal/obj/arm64/inst_gen.go
                                                  Line 11, Patchset 42: // ABS <Zn>.<T>, <Pg>/M, <Zd>.<T>
                                                  Cherry Mui . resolved

                                                  Could we use the Go assembly name, ZABS?

                                                  Junyang Shao

                                                  Done

                                                  Open in Gerrit

                                                  Related details

                                                  Attention is currently required from:
                                                  • Alexander Musman
                                                  • Cherry Mui
                                                  • David Chase
                                                  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: comment
                                                    Gerrit-Project: go
                                                    Gerrit-Branch: master
                                                    Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                                    Gerrit-Change-Number: 742620
                                                    Gerrit-PatchSet: 43
                                                    Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                                                    Gerrit-Attention: Cherry Mui <cher...@google.com>
                                                    Gerrit-Attention: David Chase <drc...@google.com>
                                                    Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                                                    Gerrit-Comment-Date: Fri, 13 Mar 2026 22:12:51 +0000
                                                    unsatisfied_requirement
                                                    satisfied_requirement
                                                    open
                                                    diffy

                                                    Cherry Mui (Gerrit)

                                                    unread,
                                                    Mar 13, 2026, 6:25:43 PM (6 days ago) Mar 13
                                                    to Junyang Shao, goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, David Chase, golang-co...@googlegroups.com
                                                    Attention needed from Alexander Musman, David Chase and Junyang Shao

                                                    Cherry Mui added 1 comment

                                                    File src/cmd/internal/obj/arm64/encoding_gen.go
                                                    Line 7, Patchset 42: // (tszh :: tszl)
                                                    Cherry Mui . unresolved

                                                    What is this?

                                                    Junyang Shao

                                                    It's the component symbol string, handy for the user and myself to map back to the assembly. See one example in this file:
                                                    https://developer.arm.com/documentation/ddi0602/2025-12/SVE-Instructions/SRI--Shift-right-and-insert--immediate--?lang=en

                                                    If you think they are not necessary, I have removed them.

                                                    Cherry Mui

                                                    I didn't mean to remove all the comments (but it is fine to remove as it is just repeating the constant name). I was wondering what "tszh :: tszl" specifically means. Others are pretty understandable.

                                                    Open in Gerrit

                                                    Related details

                                                    Attention is currently required from:
                                                    • Alexander Musman
                                                    • David Chase
                                                    • Junyang Shao
                                                    Submit Requirements:
                                                      • requirement is not satisfiedCode-Review
                                                      • requirement is not 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: comment
                                                      Gerrit-Project: go
                                                      Gerrit-Branch: master
                                                      Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                                      Gerrit-Change-Number: 742620
                                                      Gerrit-PatchSet: 43
                                                      Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                                                      Gerrit-Attention: David Chase <drc...@google.com>
                                                      Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                                                      Gerrit-Attention: Junyang Shao <shaoj...@google.com>
                                                      Gerrit-Comment-Date: Fri, 13 Mar 2026 22:25:37 +0000
                                                      Gerrit-HasComments: Yes
                                                      Gerrit-Has-Labels: No
                                                      Comment-In-Reply-To: Cherry Mui <cher...@google.com>
                                                      Comment-In-Reply-To: Junyang Shao <shaoj...@google.com>
                                                      unsatisfied_requirement
                                                      open
                                                      diffy

                                                      Junyang Shao (Gerrit)

                                                      unread,
                                                      Mar 13, 2026, 6:47:02 PM (6 days ago) Mar 13
                                                      to goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, David Chase, Cherry Mui, golang-co...@googlegroups.com
                                                      Attention needed from Alexander Musman, Cherry Mui and David Chase

                                                      Junyang Shao voted and added 1 comment

                                                      Votes added by Junyang Shao

                                                      Commit-Queue+1

                                                      1 comment

                                                      File src/cmd/internal/obj/arm64/encoding_gen.go
                                                      Line 7, Patchset 42: // (tszh :: tszl)
                                                      Cherry Mui . resolved

                                                      What is this?

                                                      Junyang Shao

                                                      It's the component symbol string, handy for the user and myself to map back to the assembly. See one example in this file:
                                                      https://developer.arm.com/documentation/ddi0602/2025-12/SVE-Instructions/SRI--Shift-right-and-insert--immediate--?lang=en

                                                      If you think they are not necessary, I have removed them.

                                                      Cherry Mui

                                                      I didn't mean to remove all the comments (but it is fine to remove as it is just repeating the constant name). I was wondering what "tszh :: tszl" specifically means. Others are pretty understandable.

                                                      Junyang Shao

                                                      Ack. Since you mentioned it's ok to remove, so I think this comment is resolved.

                                                      Open in Gerrit

                                                      Related details

                                                      Attention is currently required from:
                                                      • Alexander Musman
                                                      • Cherry Mui
                                                      • David Chase
                                                      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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                                        Gerrit-Change-Number: 742620
                                                        Gerrit-PatchSet: 43
                                                        Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                                                        Gerrit-Attention: Cherry Mui <cher...@google.com>
                                                        Gerrit-Attention: David Chase <drc...@google.com>
                                                        Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                                                        Gerrit-Comment-Date: Fri, 13 Mar 2026 22:46:57 +0000
                                                        Gerrit-HasComments: Yes
                                                        Gerrit-Has-Labels: Yes
                                                        unsatisfied_requirement
                                                        satisfied_requirement
                                                        open
                                                        diffy

                                                        David Chase (Gerrit)

                                                        unread,
                                                        Mar 16, 2026, 9:26:26 PM (3 days ago) Mar 16
                                                        to Junyang Shao, goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, Cherry Mui, golang-co...@googlegroups.com
                                                        Attention needed from Alexander Musman, Cherry Mui and Junyang Shao

                                                        David Chase added 13 comments

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

                                                        I think these should all be easy, some of them are fixed in the generating CL. +1 for now, will do another pass later.

                                                        File src/cmd/internal/obj/arm64/asm7.go
                                                        Line 7956, Patchset 43 (Latest): } else if reg <= REG_Z31 && reg >= REG_Z0 {
                                                        David Chase . unresolved

                                                        It is a minor thing, but I try to write these in the style `LOW <= x && x <= HIGH` to make it even more obvious that it is one variable (x) in the range LOW <= x <= HIGH (which is what we would write as informal mathematics, if not legal Go).

                                                        But, see below, I notice that you are mimicking the existing style. Sigh.

                                                        Line 7973, Patchset 43 (Latest): } else if reg <= REG_PN15 && reg >= REG_P0 {
                                                        David Chase . unresolved

                                                        Same as above, `REG_P0 <= reg && reg <= REG_PN15`.

                                                        Line 7994, Patchset 43 (Latest): } else if reg <= REG_V31 && reg >= REG_V0 {
                                                        David Chase . resolved

                                                        and here I see that you were just matching the unfortunate style of whoever it was who was here earlier. Oh well.

                                                        File src/cmd/internal/obj/arm64/encoding_gen.go
                                                        Line 30, Patchset 43 (Latest):// Check this is a B arrangement
                                                        func encodeArngBCheck(v uint32) (uint32, bool) {
                                                        David Chase . unresolved

                                                        Change the generated comment to start with the function name so that these are all doc comments, even though not exported:
                                                        ```
                                                        // encodeArngBCheck checks that v is a B arrangement
                                                        ```

                                                        Line 86, Patchset 43 (Latest):// For the "Byte and halfword" variant: is the size specifier,
                                                        David Chase . unresolved

                                                        I think this (and others begining "For the..." below) should read
                                                        ```
                                                        // encodeSzByteHalfword encodes the size specifier for the "Byte and halfword" variant

                                                        Line 154, Patchset 43 (Latest):// Is an arrangement specifier,
                                                        David Chase . unresolved

                                                        I think this should at least lead with the name of the function, I am less sure of the best systematic rewrite (since this is auto-generated). But perhaps:
                                                        ```
                                                        // encodeSize16B8H4S2D encodes an arrangement specifier,
                                                        ```

                                                        Line 196, Patchset 43 (Latest):// Is the name of the destination SIMD&FP register, encoded in the "Vd" field.
                                                        David Chase . unresolved

                                                        For comments in this style, "Is the name of ... , encoded in ...", perhaps
                                                        ```
                                                        // encodeVd encodes the name of the destination SIMD&FP register, in the "Vd" field.
                                                        ```

                                                        I am less thrilled about the comma, but looking ahead, if applied mechanically, it probably needs to be there. Possibly the comma insertion could be conditional on a comma in the preceding text.

                                                        Line 203, Patchset 43 (Latest):// Is the name of the destination scalable predicate register PN8-PN15, with predicate-as-counter encoding, encoded in the "PNd" field.
                                                        David Chase . unresolved

                                                        Similarly (this one is more complex), trying:
                                                        ```
                                                        // encodePNd encodes the name of the destination scalable predicate register PN8-PN15, with predicate-as-counter encoding, in the "PNd" field.
                                                        ```

                                                        Line 339, Patchset 43 (Latest):func encodePn592(v uint32) (uint32, bool) {
                                                        David Chase . unresolved

                                                        Change the name of encode functions with multiple versions to include a "v<number>" suffix, in this case "encodePn59v2". Use "v" because (1) underscore would make the concatenated names (that include underscores) even more confusing to read and (2) there is no conflict with "v" followed by a number in the other encodings.

                                                        ALSO, for the first version of this function (similarly for all others with variants) use a "v1" suffix so that anyone who sees that one will know that there are others, and that, if there is no "v<number>" suffix, that there are no others.

                                                        File src/cmd/internal/obj/arm64/inst.go
                                                        Line 60, Patchset 43 (Latest): // the first encoding domain entails the rest 2. And at instruction matching phase we simply
                                                        David Chase . unresolved

                                                        "other 2" ?

                                                        Line 144, Patchset 43 (Latest): panic(fmt.Sprintf("unknown elm index at %d in AClass %d", index, acl))
                                                        David Chase . unresolved

                                                        fmt.Errorf would be better I think (here and elsewhere).

                                                        Line 154, Patchset 43 (Latest): // Some elements are encoded in the same symbol, they need to be equal.
                                                        David Chase . unresolved

                                                        I think the words here need an update, one of them is now "component" I think, since the map key is "component". Are components encoded into symbols, or elements encoded into components?

                                                        Open in Gerrit

                                                        Related details

                                                        Attention is currently required from:
                                                        • Alexander Musman
                                                        • Cherry Mui
                                                        • Junyang Shao
                                                        Submit Requirements:
                                                          • requirement is not satisfiedCode-Review
                                                          • requirement is not 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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                                          Gerrit-Change-Number: 742620
                                                          Gerrit-PatchSet: 43
                                                          Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                                                          Gerrit-Attention: Cherry Mui <cher...@google.com>
                                                          Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                                                          Gerrit-Attention: Junyang Shao <shaoj...@google.com>
                                                          Gerrit-Comment-Date: Tue, 17 Mar 2026 01:26:20 +0000
                                                          Gerrit-HasComments: Yes
                                                          Gerrit-Has-Labels: No
                                                          unsatisfied_requirement
                                                          satisfied_requirement
                                                          open
                                                          diffy

                                                          David Chase (Gerrit)

                                                          unread,
                                                          Mar 16, 2026, 9:26:36 PM (3 days ago) Mar 16
                                                          to Junyang Shao, goph...@pubsubhelper.golang.org, Go LUCI, Alexander Musman, Cherry Mui, golang-co...@googlegroups.com
                                                          Attention needed from Alexander Musman, Cherry Mui and Junyang Shao

                                                          David Chase voted Code-Review+1

                                                          Code-Review+1
                                                          Open in Gerrit

                                                          Related details

                                                          Attention is currently required from:
                                                          • Alexander Musman
                                                          • Cherry Mui
                                                          • Junyang Shao
                                                          Submit Requirements:
                                                            • requirement is not satisfiedCode-Review
                                                            • requirement is not 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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                                            Gerrit-Change-Number: 742620
                                                            Gerrit-PatchSet: 43
                                                            Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                                                            Gerrit-Attention: Cherry Mui <cher...@google.com>
                                                            Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                                                            Gerrit-Attention: Junyang Shao <shaoj...@google.com>
                                                            Gerrit-Comment-Date: Tue, 17 Mar 2026 01:26:32 +0000
                                                            Gerrit-HasComments: No
                                                            Gerrit-Has-Labels: Yes
                                                            unsatisfied_requirement
                                                            satisfied_requirement
                                                            open
                                                            diffy

                                                            Junyang Shao (Gerrit)

                                                            unread,
                                                            Mar 17, 2026, 5:26:04 PM (2 days ago) Mar 17
                                                            to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                                                            Attention needed from Alexander Musman, Cherry Mui and Junyang Shao

                                                            Junyang Shao uploaded new patchset

                                                            Junyang Shao uploaded patch set #44 to this change.
                                                            Following approvals got outdated and were removed:
                                                            • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
                                                            Open in Gerrit

                                                            Related details

                                                            Attention is currently required from:
                                                            • Alexander Musman
                                                            • Cherry Mui
                                                            • Junyang Shao
                                                            Submit Requirements:
                                                              • requirement is not satisfiedCode-Review
                                                              • requirement is not satisfiedNo-Unresolved-Comments
                                                              • requirement satisfiedReview-Enforcement
                                                              • requirement is not satisfiedTryBots-Pass
                                                              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                                                              Gerrit-MessageType: newpatchset
                                                              Gerrit-Project: go
                                                              Gerrit-Branch: master
                                                              Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                                              Gerrit-Change-Number: 742620
                                                              Gerrit-PatchSet: 44
                                                              unsatisfied_requirement
                                                              satisfied_requirement
                                                              open
                                                              diffy

                                                              Junyang Shao (Gerrit)

                                                              unread,
                                                              Mar 17, 2026, 5:26:29 PM (2 days ago) Mar 17
                                                              to goph...@pubsubhelper.golang.org, David Chase, Go LUCI, Alexander Musman, Cherry Mui, golang-co...@googlegroups.com
                                                              Attention needed from Alexander Musman, Cherry Mui and David Chase

                                                              Junyang Shao voted and added 11 comments

                                                              Votes added by Junyang Shao

                                                              Commit-Queue+1

                                                              11 comments

                                                              File src/cmd/internal/obj/arm64/asm7.go
                                                              Line 7956, Patchset 43: } else if reg <= REG_Z31 && reg >= REG_Z0 {
                                                              David Chase . resolved

                                                              It is a minor thing, but I try to write these in the style `LOW <= x && x <= HIGH` to make it even more obvious that it is one variable (x) in the range LOW <= x <= HIGH (which is what we would write as informal mathematics, if not legal Go).

                                                              But, see below, I notice that you are mimicking the existing style. Sigh.

                                                              Junyang Shao

                                                              Done

                                                              Line 7973, Patchset 43: } else if reg <= REG_PN15 && reg >= REG_P0 {
                                                              David Chase . resolved

                                                              Same as above, `REG_P0 <= reg && reg <= REG_PN15`.

                                                              Junyang Shao

                                                              Done

                                                              File src/cmd/internal/obj/arm64/encoding_gen.go
                                                              Line 30, Patchset 43:// Check this is a B arrangement

                                                              func encodeArngBCheck(v uint32) (uint32, bool) {
                                                              David Chase . resolved

                                                              Change the generated comment to start with the function name so that these are all doc comments, even though not exported:
                                                              ```
                                                              // encodeArngBCheck checks that v is a B arrangement
                                                              ```

                                                              Junyang Shao

                                                              Done

                                                              Line 86, Patchset 43:// For the "Byte and halfword" variant: is the size specifier,
                                                              David Chase . resolved

                                                              I think this (and others begining "For the..." below) should read
                                                              ```
                                                              // encodeSzByteHalfword encodes the size specifier for the "Byte and halfword" variant

                                                              Junyang Shao

                                                              Done

                                                              Line 154, Patchset 43:// Is an arrangement specifier,
                                                              David Chase . resolved

                                                              I think this should at least lead with the name of the function, I am less sure of the best systematic rewrite (since this is auto-generated). But perhaps:
                                                              ```
                                                              // encodeSize16B8H4S2D encodes an arrangement specifier,
                                                              ```

                                                              Junyang Shao

                                                              For the sake of not parsing natural language, I just make them uniformly:
                                                              ```
                                                              // {{.Name}} is the implementation of the following encoding logic:
                                                              // {{.OriginalComment}}
                                                              ```

                                                              Line 196, Patchset 43:// Is the name of the destination SIMD&FP register, encoded in the "Vd" field.
                                                              David Chase . resolved

                                                              For comments in this style, "Is the name of ... , encoded in ...", perhaps
                                                              ```
                                                              // encodeVd encodes the name of the destination SIMD&FP register, in the "Vd" field.
                                                              ```

                                                              I am less thrilled about the comma, but looking ahead, if applied mechanically, it probably needs to be there. Possibly the comma insertion could be conditional on a comma in the preceding text.

                                                              Junyang Shao

                                                              Done

                                                              Line 203, Patchset 43:// Is the name of the destination scalable predicate register PN8-PN15, with predicate-as-counter encoding, encoded in the "PNd" field.
                                                              David Chase . resolved

                                                              Similarly (this one is more complex), trying:
                                                              ```
                                                              // encodePNd encodes the name of the destination scalable predicate register PN8-PN15, with predicate-as-counter encoding, in the "PNd" field.
                                                              ```

                                                              Junyang Shao

                                                              Done

                                                              Line 339, Patchset 43:func encodePn592(v uint32) (uint32, bool) {
                                                              David Chase . resolved

                                                              Change the name of encode functions with multiple versions to include a "v<number>" suffix, in this case "encodePn59v2". Use "v" because (1) underscore would make the concatenated names (that include underscores) even more confusing to read and (2) there is no conflict with "v" followed by a number in the other encodings.

                                                              ALSO, for the first version of this function (similarly for all others with variants) use a "v1" suffix so that anyone who sees that one will know that there are others, and that, if there is no "v<number>" suffix, that there are no others.

                                                              Junyang Shao

                                                              Done

                                                              File src/cmd/internal/obj/arm64/inst.go
                                                              Line 60, Patchset 43: // the first encoding domain entails the rest 2. And at instruction matching phase we simply
                                                              David Chase . resolved

                                                              "other 2" ?

                                                              Junyang Shao

                                                              Done

                                                              Line 144, Patchset 43: panic(fmt.Sprintf("unknown elm index at %d in AClass %d", index, acl))
                                                              David Chase . resolved

                                                              fmt.Errorf would be better I think (here and elsewhere).

                                                              Junyang Shao

                                                              Done

                                                              Line 154, Patchset 43: // Some elements are encoded in the same symbol, they need to be equal.
                                                              David Chase . resolved

                                                              I think the words here need an update, one of them is now "component" I think, since the map key is "component". Are components encoded into symbols, or elements encoded into components?

                                                              Junyang Shao

                                                              They are component now.

                                                              Open in Gerrit

                                                              Related details

                                                              Attention is currently required from:
                                                              • Alexander Musman
                                                              • Cherry Mui
                                                              • David Chase
                                                              Submit Requirements:
                                                                • requirement is not satisfiedCode-Review
                                                                • requirement satisfiedNo-Unresolved-Comments
                                                                • requirement satisfiedReview-Enforcement
                                                                • requirement is not 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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                                                Gerrit-Change-Number: 742620
                                                                Gerrit-PatchSet: 44
                                                                Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                                                                Gerrit-Attention: Cherry Mui <cher...@google.com>
                                                                Gerrit-Attention: David Chase <drc...@google.com>
                                                                Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                                                                Gerrit-Comment-Date: Tue, 17 Mar 2026 21:26:25 +0000
                                                                Gerrit-HasComments: Yes
                                                                Gerrit-Has-Labels: Yes
                                                                Comment-In-Reply-To: David Chase <drc...@google.com>
                                                                unsatisfied_requirement
                                                                satisfied_requirement
                                                                open
                                                                diffy

                                                                Cherry Mui (Gerrit)

                                                                unread,
                                                                Mar 18, 2026, 3:47:11 PM (2 days ago) Mar 18
                                                                to Junyang Shao, goph...@pubsubhelper.golang.org, Go LUCI, David Chase, Alexander Musman, golang-co...@googlegroups.com
                                                                Attention needed from Alexander Musman, David Chase and Junyang Shao

                                                                Cherry Mui added 1 comment

                                                                File src/cmd/asm/internal/asm/testdata/arm64sveenc.s
                                                                File-level comment, Patchset 44 (Latest):
                                                                Cherry Mui . unresolved

                                                                Would be good to have a test for the error case. It should error out, and should not panic.

                                                                Open in Gerrit

                                                                Related details

                                                                Attention is currently required from:
                                                                • Alexander Musman
                                                                • David Chase
                                                                • Junyang Shao
                                                                Submit Requirements:
                                                                  • requirement is not satisfiedCode-Review
                                                                  • requirement is not 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: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                                                  Gerrit-Change-Number: 742620
                                                                  Gerrit-PatchSet: 44
                                                                  Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                                                                  Gerrit-Attention: David Chase <drc...@google.com>
                                                                  Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                                                                  Gerrit-Attention: Junyang Shao <shaoj...@google.com>
                                                                  Gerrit-Comment-Date: Wed, 18 Mar 2026 19:47:07 +0000
                                                                  Gerrit-HasComments: Yes
                                                                  Gerrit-Has-Labels: No
                                                                  unsatisfied_requirement
                                                                  satisfied_requirement
                                                                  open
                                                                  diffy

                                                                  Junyang Shao (Gerrit)

                                                                  unread,
                                                                  Mar 19, 2026, 5:52:52 PM (6 hours ago) Mar 19
                                                                  to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                                                                  Attention needed from Alexander Musman, David Chase and Junyang Shao

                                                                  Junyang Shao uploaded new patchset

                                                                  Junyang Shao uploaded patch set #45 to this change.
                                                                  Following approvals got outdated and were removed:
                                                                  • Code-Review: +1 by David Chase
                                                                  • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI

                                                                  Related details

                                                                  Attention is currently required from:
                                                                  • Alexander Musman
                                                                  • David Chase
                                                                  • Junyang Shao
                                                                  Submit Requirements:
                                                                    • requirement is not satisfiedCode-Review
                                                                    • requirement is not 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: newpatchset
                                                                    Gerrit-Project: go
                                                                    Gerrit-Branch: master
                                                                    Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                                                    Gerrit-Change-Number: 742620
                                                                    Gerrit-PatchSet: 45
                                                                    unsatisfied_requirement
                                                                    open
                                                                    diffy

                                                                    Junyang Shao (Gerrit)

                                                                    unread,
                                                                    Mar 19, 2026, 5:53:19 PM (6 hours ago) Mar 19
                                                                    to goph...@pubsubhelper.golang.org, Go LUCI, David Chase, Alexander Musman, Cherry Mui, golang-co...@googlegroups.com
                                                                    Attention needed from Alexander Musman, Cherry Mui and David Chase

                                                                    Junyang Shao voted and added 1 comment

                                                                    Votes added by Junyang Shao

                                                                    Commit-Queue+1

                                                                    1 comment

                                                                    File src/cmd/asm/internal/asm/testdata/arm64sveenc.s

                                                                    Would be good to have a test for the error case. It should error out, and should not panic.

                                                                    Junyang Shao

                                                                    Just added them in another file, please take a look

                                                                    Open in Gerrit

                                                                    Related details

                                                                    Attention is currently required from:
                                                                    • Alexander Musman
                                                                    • Cherry Mui
                                                                    • David Chase
                                                                    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: comment
                                                                      Gerrit-Project: go
                                                                      Gerrit-Branch: master
                                                                      Gerrit-Change-Id: I483f170c776fcd8edd8b8b04520f9d69ee0855dd
                                                                      Gerrit-Change-Number: 742620
                                                                      Gerrit-PatchSet: 45
                                                                      Gerrit-Owner: Junyang Shao <shaoj...@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: Alexander Musman <alexande...@gmail.com>
                                                                      Gerrit-Attention: Cherry Mui <cher...@google.com>
                                                                      Gerrit-Attention: David Chase <drc...@google.com>
                                                                      Gerrit-Attention: Alexander Musman <alexande...@gmail.com>
                                                                      Gerrit-Comment-Date: Thu, 19 Mar 2026 21:53:15 +0000
                                                                      Gerrit-HasComments: Yes
                                                                      Gerrit-Has-Labels: Yes
                                                                      Comment-In-Reply-To: Cherry Mui <cher...@google.com>
                                                                      unsatisfied_requirement
                                                                      satisfied_requirement
                                                                      open
                                                                      diffy

                                                                      Junyang Shao (Gerrit)

                                                                      unread,
                                                                      Mar 19, 2026, 5:53:59 PM (6 hours ago) Mar 19
                                                                      to goph...@pubsubhelper.golang.org, Go LUCI, David Chase, Alexander Musman, Cherry Mui, golang-co...@googlegroups.com
                                                                      Attention needed from Alexander Musman, Cherry Mui and David Chase

                                                                      Junyang Shao added 1 comment

                                                                      File src/cmd/asm/internal/asm/testdata/arm64sveenc.s
                                                                      Line 49, Patchset 45 (Latest): SETFFR // 00902c25
                                                                      Junyang Shao . resolved

                                                                      This instruction does not have an error case, because it has no operand, as long as the mnemonic is correct it is correct.

                                                                      Gerrit-Comment-Date: Thu, 19 Mar 2026 21:53:56 +0000
                                                                      Gerrit-HasComments: Yes
                                                                      Gerrit-Has-Labels: No
                                                                      unsatisfied_requirement
                                                                      satisfied_requirement
                                                                      open
                                                                      diffy
                                                                      Reply all
                                                                      Reply to author
                                                                      Forward
                                                                      0 new messages