[go] cmd/compile/internal/riscv64: use CNOP for compiler inserted NOPs

16 views
Skip to first unread message

Joel Sing (Gerrit)

unread,
Aug 28, 2023, 11:43:36 AM8/28/23
to Mark Ryan, M Zhuo, Cherry Mui, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Cherry Mui, M Zhuo, Mark Ryan.

Joel Sing would like Mark Ryan, M Zhuo and Cherry Mui to review this change.

View Change

cmd/compile/internal/riscv64: use CNOP for compiler inserted NOPs

This simplifies code generation, while also being a compressed
instruction that results in smaller code size.

Change-Id: I24258353688554042c2a836deed4830cc673e985
---
M src/cmd/compile/internal/riscv64/gsubr.go
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/cmd/compile/internal/riscv64/gsubr.go b/src/cmd/compile/internal/riscv64/gsubr.go
index 74bccf8..ee05963 100644
--- a/src/cmd/compile/internal/riscv64/gsubr.go
+++ b/src/cmd/compile/internal/riscv64/gsubr.go
@@ -11,10 +11,5 @@
)

func ginsnop(pp *objw.Progs) *obj.Prog {
- // Hardware nop is ADD $0, ZERO
- p := pp.Prog(riscv.AADD)
- p.From.Type = obj.TYPE_CONST
- p.Reg = riscv.REG_ZERO
- p.To = obj.Addr{Type: obj.TYPE_REG, Reg: riscv.REG_ZERO}
- return p
+ return pp.Prog(riscv.ACNOP)
}

To view, visit change 523478. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I24258353688554042c2a836deed4830cc673e985
Gerrit-Change-Number: 523478
Gerrit-PatchSet: 1
Gerrit-Owner: Joel Sing <jo...@sing.id.au>
Gerrit-Reviewer: Cherry Mui <cher...@google.com>
Gerrit-Reviewer: M Zhuo <m...@golangcn.org>
Gerrit-Reviewer: Mark Ryan <mark...@rivosinc.com>
Gerrit-Attention: Mark Ryan <mark...@rivosinc.com>
Gerrit-Attention: M Zhuo <m...@golangcn.org>
Gerrit-Attention: Cherry Mui <cher...@google.com>

Joel Sing (Gerrit)

unread,
Jan 3, 2025, 11:03:50 AMJan 3
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
Attention needed from Cherry Mui, Joel Sing, Mark Ryan and Meng Zhuo

Joel Sing uploaded new patchset

Joel Sing uploaded patch set #3 to this change.
Open in Gerrit

Related details

Attention is currently required from:
  • Cherry Mui
  • Joel Sing
  • Mark Ryan
  • Meng Zhuo
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Holds
  • 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: I24258353688554042c2a836deed4830cc673e985
Gerrit-Change-Number: 523478
Gerrit-PatchSet: 3
Gerrit-Owner: Joel Sing <jo...@sing.id.au>
Gerrit-Reviewer: Cherry Mui <cher...@google.com>
Gerrit-Reviewer: Mark Ryan <mark...@rivosinc.com>
Gerrit-Reviewer: Meng Zhuo <mengzh...@gmail.com>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-Attention: Mark Ryan <mark...@rivosinc.com>
Gerrit-Attention: Joel Sing <jo...@sing.id.au>
Gerrit-Attention: Meng Zhuo <mengzh...@gmail.com>
Gerrit-Attention: Cherry Mui <cher...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Joel Sing (Gerrit)

unread,
Aug 8, 2025, 1:03:09 PMAug 8
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
Attention needed from Cherry Mui, Joel Sing, Mark Ryan and Meng Zhuo

Joel Sing uploaded new patchset

Joel Sing uploaded patch set #5 to this change.
Open in Gerrit

Related details

Attention is currently required from:
  • Cherry Mui
  • Joel Sing
  • Mark Ryan
  • Meng Zhuo
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Holds
  • 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: I24258353688554042c2a836deed4830cc673e985
Gerrit-Change-Number: 523478
Gerrit-PatchSet: 5
unsatisfied_requirement
satisfied_requirement
open
diffy

Joel Sing (Gerrit)

unread,
Aug 8, 2025, 1:05:26 PMAug 8
to goph...@pubsubhelper.golang.org, Russ Cox, Meng Zhuo, Mark Ryan, Cherry Mui, golang-co...@googlegroups.com
Attention needed from Cherry Mui, Joel Sing, Mark Ryan, Meng Zhuo and Russ Cox

Joel Sing removed a vote from this change

Removed Hold+1 by Russ Cox <r...@golang.org>
Open in Gerrit

Related details

Attention is currently required from:
  • Cherry Mui
  • Joel Sing
  • Mark Ryan
  • Meng Zhuo
  • Russ Cox
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: deleteVote
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I24258353688554042c2a836deed4830cc673e985
    Gerrit-Change-Number: 523478
    Gerrit-PatchSet: 5
    Gerrit-Owner: Joel Sing <jo...@sing.id.au>
    Gerrit-Reviewer: Cherry Mui <cher...@google.com>
    Gerrit-Reviewer: Mark Ryan <mark...@rivosinc.com>
    Gerrit-Reviewer: Meng Zhuo <mengzh...@gmail.com>
    Gerrit-Reviewer: Russ Cox <r...@golang.org>
    Gerrit-Attention: Mark Ryan <mark...@rivosinc.com>
    Gerrit-Attention: Joel Sing <jo...@sing.id.au>
    Gerrit-Attention: Meng Zhuo <mengzh...@gmail.com>
    Gerrit-Attention: Russ Cox <r...@golang.org>
    Gerrit-Attention: Cherry Mui <cher...@google.com>
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Joel Sing (Gerrit)

    unread,
    Aug 8, 2025, 1:05:45 PMAug 8
    to goph...@pubsubhelper.golang.org, Russ Cox, Meng Zhuo, Mark Ryan, Cherry Mui, golang-co...@googlegroups.com
    Attention needed from Cherry Mui, Mark Ryan, Meng Zhuo and Russ Cox

    Joel Sing voted and added 1 comment

    Votes added by Joel Sing

    Commit-Queue+1

    1 comment

    Patchset-level comments
    File-level comment, Patchset 1:
    Russ Cox . resolved

    This would require compressed instructions in any RISC-V host running Go, so let's hold off on that until we have an accepted proposal to do so.

    Joel Sing

    Proposal has been accepted, removing hold.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cherry Mui
    • Mark Ryan
    • Meng Zhuo
    • Russ Cox
    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: I24258353688554042c2a836deed4830cc673e985
    Gerrit-Change-Number: 523478
    Gerrit-PatchSet: 5
    Gerrit-Owner: Joel Sing <jo...@sing.id.au>
    Gerrit-Reviewer: Cherry Mui <cher...@google.com>
    Gerrit-Reviewer: Joel Sing <jo...@sing.id.au>
    Gerrit-Reviewer: Mark Ryan <mark...@rivosinc.com>
    Gerrit-Reviewer: Meng Zhuo <mengzh...@gmail.com>
    Gerrit-Reviewer: Russ Cox <r...@golang.org>
    Gerrit-Attention: Mark Ryan <mark...@rivosinc.com>
    Gerrit-Attention: Meng Zhuo <mengzh...@gmail.com>
    Gerrit-Attention: Russ Cox <r...@golang.org>
    Gerrit-Attention: Cherry Mui <cher...@google.com>
    Gerrit-Comment-Date: Fri, 08 Aug 2025 17:05:39 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Russ Cox <r...@golang.org>
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Joel Sing (Gerrit)

    unread,
    Aug 18, 2025, 11:19:09 AMAug 18
    to goph...@pubsubhelper.golang.org, Go LUCI, Russ Cox, Meng Zhuo, Mark Ryan, Cherry Mui, golang-co...@googlegroups.com
    Attention needed from Cherry Mui, Mark Ryan, Meng Zhuo and Russ Cox

    Joel Sing voted Commit-Queue+1

    Commit-Queue+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cherry Mui
    • Mark Ryan
    • Meng Zhuo
    • Russ Cox
    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: I24258353688554042c2a836deed4830cc673e985
    Gerrit-Change-Number: 523478
    Gerrit-PatchSet: 6
    Gerrit-Owner: Joel Sing <jo...@sing.id.au>
    Gerrit-Reviewer: Cherry Mui <cher...@google.com>
    Gerrit-Reviewer: Joel Sing <jo...@sing.id.au>
    Gerrit-Reviewer: Mark Ryan <mark...@rivosinc.com>
    Gerrit-Reviewer: Meng Zhuo <mengzh...@gmail.com>
    Gerrit-Reviewer: Russ Cox <r...@golang.org>
    Gerrit-Attention: Mark Ryan <mark...@rivosinc.com>
    Gerrit-Attention: Meng Zhuo <mengzh...@gmail.com>
    Gerrit-Attention: Russ Cox <r...@golang.org>
    Gerrit-Attention: Cherry Mui <cher...@google.com>
    Gerrit-Comment-Date: Mon, 18 Aug 2025 15:19:02 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Joel Sing (Gerrit)

    unread,
    Aug 21, 2025, 10:11:09 AMAug 21
    to goph...@pubsubhelper.golang.org, Go LUCI, Russ Cox, Meng Zhuo, Mark Ryan, Cherry Mui, golang-co...@googlegroups.com
    Attention needed from Cherry Mui, Mark Ryan, Meng Zhuo and Russ Cox

    Joel Sing voted Commit-Queue+1

    Commit-Queue+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cherry Mui
    • Mark Ryan
    • Meng Zhuo
    • Russ Cox
    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: I24258353688554042c2a836deed4830cc673e985
    Gerrit-Change-Number: 523478
    Gerrit-PatchSet: 7
    Gerrit-Owner: Joel Sing <jo...@sing.id.au>
    Gerrit-Reviewer: Cherry Mui <cher...@google.com>
    Gerrit-Reviewer: Joel Sing <jo...@sing.id.au>
    Gerrit-Reviewer: Mark Ryan <mark...@rivosinc.com>
    Gerrit-Reviewer: Meng Zhuo <mengzh...@gmail.com>
    Gerrit-Reviewer: Russ Cox <r...@golang.org>
    Gerrit-Attention: Mark Ryan <mark...@rivosinc.com>
    Gerrit-Attention: Meng Zhuo <mengzh...@gmail.com>
    Gerrit-Attention: Russ Cox <r...@golang.org>
    Gerrit-Attention: Cherry Mui <cher...@google.com>
    Gerrit-Comment-Date: Thu, 21 Aug 2025 14:11:00 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Joel Sing (Gerrit)

    unread,
    Oct 20, 2025, 12:40:22 AMOct 20
    to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
    Attention needed from Cherry Mui, Mark Ryan, Meng Zhuo and Russ Cox

    Joel Sing uploaded new patchset

    Joel Sing uploaded patch set #8 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
    • Mark Ryan
    • Meng Zhuo
    • Russ Cox
    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: I24258353688554042c2a836deed4830cc673e985
    Gerrit-Change-Number: 523478
    Gerrit-PatchSet: 8
    Gerrit-Owner: Joel Sing <jo...@sing.id.au>
    Gerrit-Reviewer: Cherry Mui <cher...@google.com>
    Gerrit-Reviewer: Joel Sing <jo...@sing.id.au>
    Gerrit-Reviewer: Mark Ryan <mark...@rivosinc.com>
    Gerrit-Reviewer: Meng Zhuo <mengzh...@gmail.com>
    Gerrit-Reviewer: Russ Cox <r...@golang.org>
    Gerrit-Attention: Russ Cox <r...@golang.org>
    Gerrit-Attention: Cherry Mui <cher...@google.com>
    Gerrit-Attention: Meng Zhuo <mengzh...@gmail.com>
    Gerrit-Attention: Mark Ryan <mark...@rivosinc.com>
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Joel Sing (Gerrit)

    unread,
    Oct 20, 2025, 3:06:04 AMOct 20
    to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
    Attention needed from Cherry Mui, Mark Ryan, Meng Zhuo and Russ Cox

    Joel Sing uploaded new patchset

    Joel Sing uploaded patch set #9 to this change.
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cherry Mui
    • Mark Ryan
    • Meng Zhuo
    • Russ Cox
    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: I24258353688554042c2a836deed4830cc673e985
    Gerrit-Change-Number: 523478
    Gerrit-PatchSet: 9
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Joel Sing (Gerrit)

    unread,
    Oct 20, 2025, 3:08:33 AMOct 20
    to goph...@pubsubhelper.golang.org, Go LUCI, Russ Cox, Meng Zhuo, Mark Ryan, Cherry Mui, golang-co...@googlegroups.com
    Attention needed from Cherry Mui, Mark Ryan, Meng Zhuo and Russ Cox

    Joel Sing voted Commit-Queue+1

    Commit-Queue+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cherry Mui
    • Mark Ryan
    • Meng Zhuo
    • Russ Cox
    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: I24258353688554042c2a836deed4830cc673e985
    Gerrit-Change-Number: 523478
    Gerrit-PatchSet: 9
    Gerrit-Owner: Joel Sing <jo...@sing.id.au>
    Gerrit-Reviewer: Cherry Mui <cher...@google.com>
    Gerrit-Reviewer: Joel Sing <jo...@sing.id.au>
    Gerrit-Reviewer: Mark Ryan <mark...@rivosinc.com>
    Gerrit-Reviewer: Meng Zhuo <mengzh...@gmail.com>
    Gerrit-Reviewer: Russ Cox <r...@golang.org>
    Gerrit-Attention: Russ Cox <r...@golang.org>
    Gerrit-Attention: Cherry Mui <cher...@google.com>
    Gerrit-Attention: Meng Zhuo <mengzh...@gmail.com>
    Gerrit-Attention: Mark Ryan <mark...@rivosinc.com>
    Gerrit-Comment-Date: Mon, 20 Oct 2025 07:08:27 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Joel Sing (Gerrit)

    unread,
    Oct 20, 2025, 3:58:31 AMOct 20
    to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
    Attention needed from Cherry Mui, Joel Sing, Mark Ryan, Meng Zhuo and Russ Cox

    Joel Sing uploaded new patchset

    Joel Sing 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
    • Joel Sing
    • Mark Ryan
    • Meng Zhuo
    • Russ Cox
    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: I24258353688554042c2a836deed4830cc673e985
    Gerrit-Change-Number: 523478
    Gerrit-PatchSet: 10
    Gerrit-Owner: Joel Sing <jo...@sing.id.au>
    Gerrit-Reviewer: Cherry Mui <cher...@google.com>
    Gerrit-Reviewer: Joel Sing <jo...@sing.id.au>
    Gerrit-Reviewer: Mark Ryan <mark...@rivosinc.com>
    Gerrit-Reviewer: Meng Zhuo <mengzh...@gmail.com>
    Gerrit-Reviewer: Russ Cox <r...@golang.org>
    Gerrit-Attention: Russ Cox <r...@golang.org>
    Gerrit-Attention: Cherry Mui <cher...@google.com>
    Gerrit-Attention: Joel Sing <jo...@sing.id.au>
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Joel Sing (Gerrit)

    unread,
    Oct 20, 2025, 3:59:47 AMOct 20
    to goph...@pubsubhelper.golang.org, Go LUCI, Russ Cox, Meng Zhuo, Mark Ryan, Cherry Mui, golang-co...@googlegroups.com
    Attention needed from Cherry Mui, Mark Ryan, Meng Zhuo and Russ Cox

    Joel Sing voted Commit-Queue+1

    Commit-Queue+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cherry Mui
    • Mark Ryan
    • Meng Zhuo
    • Russ Cox
    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: I24258353688554042c2a836deed4830cc673e985
    Gerrit-Change-Number: 523478
    Gerrit-PatchSet: 10
    Gerrit-Owner: Joel Sing <jo...@sing.id.au>
    Gerrit-Reviewer: Cherry Mui <cher...@google.com>
    Gerrit-Reviewer: Joel Sing <jo...@sing.id.au>
    Gerrit-Reviewer: Mark Ryan <mark...@rivosinc.com>
    Gerrit-Reviewer: Meng Zhuo <mengzh...@gmail.com>
    Gerrit-Reviewer: Russ Cox <r...@golang.org>
    Gerrit-Attention: Russ Cox <r...@golang.org>
    Gerrit-Attention: Cherry Mui <cher...@google.com>
    Gerrit-Attention: Meng Zhuo <mengzh...@gmail.com>
    Gerrit-Attention: Mark Ryan <mark...@rivosinc.com>
    Gerrit-Comment-Date: Mon, 20 Oct 2025 07:59:39 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Joel Sing (Gerrit)

    unread,
    Oct 20, 2025, 4:46:11 AMOct 20
    to goph...@pubsubhelper.golang.org, Go LUCI, Russ Cox, Meng Zhuo, Mark Ryan, Cherry Mui, golang-co...@googlegroups.com
    Gerrit-Comment-Date: Mon, 20 Oct 2025 08:46:03 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Joel Sing (Gerrit)

    unread,
    Oct 20, 2025, 5:36:48 AMOct 20
    to goph...@pubsubhelper.golang.org, Go LUCI, Russ Cox, Meng Zhuo, Mark Ryan, Cherry Mui, golang-co...@googlegroups.com
    Attention needed from Cherry Mui, Joel Sing, Mark Ryan, Meng Zhuo and Russ Cox

    Joel Sing removed a vote from this change

    Removed LUCI-TryBot-Result-1 by Go LUCI <golang...@luci-project-accounts.iam.gserviceaccount.com>
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cherry Mui
    • Joel Sing
    • Mark Ryan
    • Meng Zhuo
    • Russ Cox
    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: deleteVote
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I24258353688554042c2a836deed4830cc673e985
    Gerrit-Change-Number: 523478
    Gerrit-PatchSet: 10
    Gerrit-Owner: Joel Sing <jo...@sing.id.au>
    Gerrit-Reviewer: Cherry Mui <cher...@google.com>
    Gerrit-Reviewer: Joel Sing <jo...@sing.id.au>
    Gerrit-Reviewer: Mark Ryan <mark...@rivosinc.com>
    Gerrit-Reviewer: Meng Zhuo <mengzh...@gmail.com>
    Gerrit-Reviewer: Russ Cox <r...@golang.org>
    Gerrit-Attention: Russ Cox <r...@golang.org>
    Gerrit-Attention: Cherry Mui <cher...@google.com>
    Gerrit-Attention: Joel Sing <jo...@sing.id.au>
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Joel Sing (Gerrit)

    unread,
    Oct 20, 2025, 5:36:57 AMOct 20
    to goph...@pubsubhelper.golang.org, Go LUCI, Russ Cox, Meng Zhuo, Mark Ryan, Cherry Mui, golang-co...@googlegroups.com
    Attention needed from Cherry Mui, Mark Ryan, Meng Zhuo and Russ Cox

    Joel Sing voted Commit-Queue+1

    Commit-Queue+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cherry Mui
    • Mark Ryan
    • Meng Zhuo
    • Russ Cox
    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: I24258353688554042c2a836deed4830cc673e985
    Gerrit-Change-Number: 523478
    Gerrit-PatchSet: 10
    Gerrit-Owner: Joel Sing <jo...@sing.id.au>
    Gerrit-Reviewer: Cherry Mui <cher...@google.com>
    Gerrit-Reviewer: Joel Sing <jo...@sing.id.au>
    Gerrit-Reviewer: Mark Ryan <mark...@rivosinc.com>
    Gerrit-Reviewer: Meng Zhuo <mengzh...@gmail.com>
    Gerrit-Reviewer: Russ Cox <r...@golang.org>
    Gerrit-Attention: Russ Cox <r...@golang.org>
    Gerrit-Attention: Cherry Mui <cher...@google.com>
    Gerrit-Attention: Meng Zhuo <mengzh...@gmail.com>
    Gerrit-Attention: Mark Ryan <mark...@rivosinc.com>
    Gerrit-Comment-Date: Mon, 20 Oct 2025 09:36:52 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Cherry Mui (Gerrit)

    unread,
    Oct 20, 2025, 9:19:23 AMOct 20
    to Joel Sing, goph...@pubsubhelper.golang.org, Go LUCI, Meng Zhuo, Mark Ryan, golang-co...@googlegroups.com
    Attention needed from Joel Sing, Mark Ryan and Meng Zhuo

    Cherry Mui voted and added 2 comments

    Votes added by Cherry Mui

    Code-Review+1

    2 comments

    File src/cmd/asm/internal/flags/flags.go
    Line 19, Patchset 10 (Latest): Compress = flag.Bool("compress", true, "use compressed instructions (if supported by architecture)")
    Cherry Mui . unresolved

    Do you need both this and `CompressInstructions` below?

    File src/cmd/internal/obj/riscv/obj.go
    Line 4869, Patchset 10 (Latest): if compress && p.Mark&(NEED_PCREL_ITYPE_RELOC|NEED_PCREL_STYPE_RELOC|NEED_GOT_PCREL_ITYPE_RELOC) == 0 {
    Cherry Mui . unresolved

    Maybe define a named constant for a bit mask of all relocations, so if we add more relocations later it is unlikely to miss them. CALL and JAL relocations are not included because we don't compress CALL/JAL instructions? It doesn't seem to hurt if we include them as well.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Joel Sing
    • Mark Ryan
    • Meng Zhuo
    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: I24258353688554042c2a836deed4830cc673e985
      Gerrit-Change-Number: 523478
      Gerrit-PatchSet: 10
      Gerrit-Owner: Joel Sing <jo...@sing.id.au>
      Gerrit-Reviewer: Cherry Mui <cher...@google.com>
      Gerrit-Reviewer: Joel Sing <jo...@sing.id.au>
      Gerrit-Reviewer: Mark Ryan <mark...@rivosinc.com>
      Gerrit-Reviewer: Meng Zhuo <mengzh...@gmail.com>
      Gerrit-Attention: Joel Sing <jo...@sing.id.au>
      Gerrit-Attention: Meng Zhuo <mengzh...@gmail.com>
      Gerrit-Attention: Mark Ryan <mark...@rivosinc.com>
      Gerrit-Comment-Date: Mon, 20 Oct 2025 13:18:53 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      unsatisfied_requirement
      satisfied_requirement
      open
      diffy

      Mark Ryan (Gerrit)

      unread,
      Oct 24, 2025, 4:23:54 AMOct 24
      to Joel Sing, goph...@pubsubhelper.golang.org, Cherry Mui, Go LUCI, Meng Zhuo, golang-co...@googlegroups.com
      Attention needed from Joel Sing and Meng Zhuo

      Mark Ryan added 1 comment

      Patchset-level comments
      File-level comment, Patchset 10 (Latest):
      Mark Ryan . resolved

      Provide a `compressedinstructions` compiler and assembler debug
      flag, such that the compression pass can be disabled via
      `-gcflags=all=-d=compressinstructions=0`.

      Note that to completely disable compressed instructions I need to specify both asmflags and gcflags

      ```
      -asmflags=all=-d=compressinstructions=0 -gcflags=all=-d=compressinstructions=0
      ```

      If I just use gcflags, normal Go code is compiled without compressed instructions but hand coded assembly is still compressed. This might not be obvious to people (it wasn't to me initially) so we might need to document this somewhere.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Joel Sing
      • Meng Zhuo
      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: I24258353688554042c2a836deed4830cc673e985
      Gerrit-Change-Number: 523478
      Gerrit-PatchSet: 10
      Gerrit-Owner: Joel Sing <jo...@sing.id.au>
      Gerrit-Reviewer: Cherry Mui <cher...@google.com>
      Gerrit-Reviewer: Joel Sing <jo...@sing.id.au>
      Gerrit-Reviewer: Mark Ryan <mark...@rivosinc.com>
      Gerrit-Reviewer: Meng Zhuo <mengzh...@gmail.com>
      Gerrit-Attention: Joel Sing <jo...@sing.id.au>
      Gerrit-Attention: Meng Zhuo <mengzh...@gmail.com>
      Gerrit-Comment-Date: Fri, 24 Oct 2025 08:23:45 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      unsatisfied_requirement
      satisfied_requirement
      open
      diffy

      Mark Ryan (Gerrit)

      unread,
      Nov 6, 2025, 8:45:00 AM (5 days ago) Nov 6
      to Joel Sing, goph...@pubsubhelper.golang.org, Cherry Mui, Go LUCI, Meng Zhuo, golang-co...@googlegroups.com
      Attention needed from Joel Sing and Meng Zhuo

      Mark Ryan added 5 comments

      Patchset-level comments
      Mark Ryan . resolved

      Looks pretty good in general. Just a few comments.

      File src/cmd/internal/obj/riscv/obj.go
      Line 3607, Patchset 10 (Latest): if ins.rd != REG_X0 && ins.rd == ins.rs1 {
      Mark Ryan . unresolved

      I think we need to check the imm here as well as rd0. The spec says

      ```
      The C.SLLI code points with shamt=0 or with rd=x0 are HINTs.
      ```

      So we shouldn't compress

      ```
      SLLI $0, X10, X10
      ```

      for example. Currently we do. I checked with binutils and it does not compress this instruction.

      Line 3611, Patchset 10 (Latest): case ASRLI:
      Mark Ryan . unresolved

      The C.SRLI code points with shamt=0 are HINTs.

      Line 3622, Patchset 10 (Latest): if ins.rd != REG_X0 && ins.rd == ins.rs1 && ins.rs2 != REG_X0 {
      Mark Ryan . unresolved

      We could compress ADD X10, X0, X11. binutils does seem to compress this to a c.mv. However, this sequence should be very uncommon in Go as one should normally write MOV X10, X11, which turns into a ADDI and so does get compressed. So maybe not worth the extra code.

      Line 3645, Patchset 10 (Latest): case AAND:
      Mark Ryan . unresolved

      We're missing CANDI here. ANDI is fairly common so if we compress it we might save a few more bytes.

      Gerrit-Comment-Date: Thu, 06 Nov 2025 13:44:53 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      unsatisfied_requirement
      satisfied_requirement
      open
      diffy

      Mark Ryan (Gerrit)

      unread,
      Nov 10, 2025, 4:15:35 AM (yesterday) Nov 10
      to Joel Sing, goph...@pubsubhelper.golang.org, Cherry Mui, Go LUCI, Meng Zhuo, golang-co...@googlegroups.com
      Attention needed from Joel Sing and Meng Zhuo

      Mark Ryan added 1 comment

      Patchset-level comments
      Mark Ryan . resolved

      Provide a `compressedinstructions` compiler and assembler debug


      flag, such that the compression pass can be disabled via
      `-gcflags=all=-d=compressinstructions=0`.

      Note that to completely disable compressed instructions I need to specify both asmflags and gcflags

      ```
      -asmflags=all=-d=compressinstructions=0 -gcflags=all=-d=compressinstructions=0
      ```

      If I just use gcflags, normal Go code is compiled without compressed instructions but hand coded assembly is still compressed. This might not be obvious to people (it wasn't to me initially) so we might need to document this somewhere.

      Mark Ryan

      I've updated the RISC-V assembler documentation patch to mention the compressed instruction set and these two debug options.

      https://go-review.googlesource.com/c/go/+/719221/1

      Gerrit-Comment-Date: Mon, 10 Nov 2025 09:15:26 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Mark Ryan <mark...@rivosinc.com>
      unsatisfied_requirement
      satisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages