[go] cmd/compile/internal/ssa: simplify riscv64 FCLASSD rewrite rules

4 views
Skip to first unread message

Michael Munday (Gerrit)

unread,
Nov 3, 2025, 6:15:47 PM (2 days ago) Nov 3
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Michael Munday has uploaded the change for review

Commit message

cmd/compile/internal/ssa: simplify riscv64 FCLASSD rewrite rules

We don't need to check that the bit patterns of the constants
match, it is sufficient to just check the constant is equal to the
given value.

While we're here also change the FCLASSD rules to use a bit pattern
for the mask. I think this improves readability, particularly as
more uses of FCLASSD get added (e.g. CL 717560).

These changes should not affect codegen.
Change-Id: I92a6338dc71e6a71e04306f67d7d86016c6e9c47

Change diff

diff --git a/src/cmd/compile/internal/ssa/_gen/RISCV64.rules b/src/cmd/compile/internal/ssa/_gen/RISCV64.rules
index 49bdbc8..31829a5 100644
--- a/src/cmd/compile/internal/ssa/_gen/RISCV64.rules
+++ b/src/cmd/compile/internal/ssa/_gen/RISCV64.rules
@@ -823,16 +823,16 @@
(F(MADD|NMADD|MSUB|NMSUB)D x y neg:(FNEGD z)) && neg.Uses == 1 => (F(MSUB|NMSUB|MADD|NMADD)D x y z)

// Test for -∞ (bit 0) using 64 bit classify instruction.
-(FLTD x (FMOVDconst [c])) && float64ExactBits(c, -math.MaxFloat64) => (ANDI [1] (FCLASSD x))
-(FLED (FMOVDconst [c]) x) && float64ExactBits(c, -math.MaxFloat64) => (SNEZ (ANDI <typ.Int64> [0xff &^ 1] (FCLASSD x)))
-(FEQD x (FMOVDconst [c])) && float64ExactBits(c, math.Inf(-1)) => (ANDI [1] (FCLASSD x))
-(FNED x (FMOVDconst [c])) && float64ExactBits(c, math.Inf(-1)) => (SEQZ (ANDI <typ.Int64> [1] (FCLASSD x)))
+(FLTD x (FMOVDconst [-math.MaxFloat64])) => (ANDI [0b00_0000_0001] (FCLASSD x))
+(FLED (FMOVDconst [-math.MaxFloat64]) x) => (SNEZ (ANDI <typ.Int64> [0b00_1111_1110] (FCLASSD x)))
+(FEQD x (FMOVDconst [math.Inf(-1)])) => (ANDI [0b00_0000_0001] (FCLASSD x))
+(FNED x (FMOVDconst [math.Inf(-1)])) => (SEQZ (ANDI <typ.Int64> [0b00_0000_0001] (FCLASSD x)))

// Test for +∞ (bit 7) using 64 bit classify instruction.
-(FLTD (FMOVDconst [c]) x) && float64ExactBits(c, math.MaxFloat64) => (SNEZ (ANDI <typ.Int64> [1<<7] (FCLASSD x)))
-(FLED x (FMOVDconst [c])) && float64ExactBits(c, math.MaxFloat64) => (SNEZ (ANDI <typ.Int64> [0xff &^ (1<<7)] (FCLASSD x)))
-(FEQD x (FMOVDconst [c])) && float64ExactBits(c, math.Inf(1)) => (SNEZ (ANDI <typ.Int64> [1<<7] (FCLASSD x)))
-(FNED x (FMOVDconst [c])) && float64ExactBits(c, math.Inf(1)) => (SEQZ (ANDI <typ.Int64> [1<<7] (FCLASSD x)))
+(FLTD (FMOVDconst [math.MaxFloat64]) x) => (SNEZ (ANDI <typ.Int64> [0b00_1000_0000] (FCLASSD x)))
+(FLED x (FMOVDconst [math.MaxFloat64])) => (SNEZ (ANDI <typ.Int64> [0b00_0111_1111] (FCLASSD x)))
+(FEQD x (FMOVDconst [math.Inf(1)])) => (SNEZ (ANDI <typ.Int64> [0b00_1000_0000] (FCLASSD x)))
+(FNED x (FMOVDconst [math.Inf(1)])) => (SEQZ (ANDI <typ.Int64> [0b00_1000_0000] (FCLASSD x)))

//
// Optimisations for rva22u64 and above.
diff --git a/src/cmd/compile/internal/ssa/rewrite.go b/src/cmd/compile/internal/ssa/rewrite.go
index a822ebc..0730897 100644
--- a/src/cmd/compile/internal/ssa/rewrite.go
+++ b/src/cmd/compile/internal/ssa/rewrite.go
@@ -765,10 +765,6 @@
return i
}

-func float64ExactBits(f float64, c float64) bool {
- return math.Float64bits(f) == math.Float64bits(c)
-}
-
func flagConstantToAuxInt(x flagConstant) int64 {
return int64(x)
}
diff --git a/src/cmd/compile/internal/ssa/rewriteRISCV64.go b/src/cmd/compile/internal/ssa/rewriteRISCV64.go
index 8a390eb..52870fe 100644
--- a/src/cmd/compile/internal/ssa/rewriteRISCV64.go
+++ b/src/cmd/compile/internal/ssa/rewriteRISCV64.go
@@ -3582,21 +3582,16 @@
v_0 := v.Args[0]
b := v.Block
typ := &b.Func.Config.Types
- // match: (FEQD x (FMOVDconst [c]))
- // cond: float64ExactBits(c, math.Inf(-1))
- // result: (ANDI [1] (FCLASSD x))
+ // match: (FEQD x (FMOVDconst [math.Inf(-1)]))
+ // result: (ANDI [0b00_0000_0001] (FCLASSD x))
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
x := v_0
- if v_1.Op != OpRISCV64FMOVDconst {
- continue
- }
- c := auxIntToFloat64(v_1.AuxInt)
- if !(float64ExactBits(c, math.Inf(-1))) {
+ if v_1.Op != OpRISCV64FMOVDconst || auxIntToFloat64(v_1.AuxInt) != math.Inf(-1) {
continue
}
v.reset(OpRISCV64ANDI)
- v.AuxInt = int64ToAuxInt(1)
+ v.AuxInt = int64ToAuxInt(0b00_0000_0001)
v0 := b.NewValue0(v.Pos, OpRISCV64FCLASSD, typ.Int64)
v0.AddArg(x)
v.AddArg(v0)
@@ -3604,22 +3599,17 @@
}
break
}
- // match: (FEQD x (FMOVDconst [c]))
- // cond: float64ExactBits(c, math.Inf(1))
- // result: (SNEZ (ANDI <typ.Int64> [1<<7] (FCLASSD x)))
+ // match: (FEQD x (FMOVDconst [math.Inf(1)]))
+ // result: (SNEZ (ANDI <typ.Int64> [0b00_1000_0000] (FCLASSD x)))
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
x := v_0
- if v_1.Op != OpRISCV64FMOVDconst {
- continue
- }
- c := auxIntToFloat64(v_1.AuxInt)
- if !(float64ExactBits(c, math.Inf(1))) {
+ if v_1.Op != OpRISCV64FMOVDconst || auxIntToFloat64(v_1.AuxInt) != math.Inf(1) {
continue
}
v.reset(OpRISCV64SNEZ)
v0 := b.NewValue0(v.Pos, OpRISCV64ANDI, typ.Int64)
- v0.AuxInt = int64ToAuxInt(1 << 7)
+ v0.AuxInt = int64ToAuxInt(0b00_1000_0000)
v1 := b.NewValue0(v.Pos, OpRISCV64FCLASSD, typ.Int64)
v1.AddArg(x)
v0.AddArg(v1)
@@ -3635,42 +3625,32 @@
v_0 := v.Args[0]
b := v.Block
typ := &b.Func.Config.Types
- // match: (FLED (FMOVDconst [c]) x)
- // cond: float64ExactBits(c, -math.MaxFloat64)
- // result: (SNEZ (ANDI <typ.Int64> [0xff &^ 1] (FCLASSD x)))
+ // match: (FLED (FMOVDconst [-math.MaxFloat64]) x)
+ // result: (SNEZ (ANDI <typ.Int64> [0b00_1111_1110] (FCLASSD x)))
for {
- if v_0.Op != OpRISCV64FMOVDconst {
+ if v_0.Op != OpRISCV64FMOVDconst || auxIntToFloat64(v_0.AuxInt) != -math.MaxFloat64 {
break
}
- c := auxIntToFloat64(v_0.AuxInt)
x := v_1
- if !(float64ExactBits(c, -math.MaxFloat64)) {
- break
- }
v.reset(OpRISCV64SNEZ)
v0 := b.NewValue0(v.Pos, OpRISCV64ANDI, typ.Int64)
- v0.AuxInt = int64ToAuxInt(0xff &^ 1)
+ v0.AuxInt = int64ToAuxInt(0b00_1111_1110)
v1 := b.NewValue0(v.Pos, OpRISCV64FCLASSD, typ.Int64)
v1.AddArg(x)
v0.AddArg(v1)
v.AddArg(v0)
return true
}
- // match: (FLED x (FMOVDconst [c]))
- // cond: float64ExactBits(c, math.MaxFloat64)
- // result: (SNEZ (ANDI <typ.Int64> [0xff &^ (1<<7)] (FCLASSD x)))
+ // match: (FLED x (FMOVDconst [math.MaxFloat64]))
+ // result: (SNEZ (ANDI <typ.Int64> [0b00_0111_1111] (FCLASSD x)))
for {
x := v_0
- if v_1.Op != OpRISCV64FMOVDconst {
- break
- }
- c := auxIntToFloat64(v_1.AuxInt)
- if !(float64ExactBits(c, math.MaxFloat64)) {
+ if v_1.Op != OpRISCV64FMOVDconst || auxIntToFloat64(v_1.AuxInt) != math.MaxFloat64 {
break
}
v.reset(OpRISCV64SNEZ)
v0 := b.NewValue0(v.Pos, OpRISCV64ANDI, typ.Int64)
- v0.AuxInt = int64ToAuxInt(0xff &^ (1 << 7))
+ v0.AuxInt = int64ToAuxInt(0b00_0111_1111)
v1 := b.NewValue0(v.Pos, OpRISCV64FCLASSD, typ.Int64)
v1.AddArg(x)
v0.AddArg(v1)
@@ -3684,40 +3664,30 @@
v_0 := v.Args[0]
b := v.Block
typ := &b.Func.Config.Types
- // match: (FLTD x (FMOVDconst [c]))
- // cond: float64ExactBits(c, -math.MaxFloat64)
- // result: (ANDI [1] (FCLASSD x))
+ // match: (FLTD x (FMOVDconst [-math.MaxFloat64]))
+ // result: (ANDI [0b00_0000_0001] (FCLASSD x))
for {
x := v_0
- if v_1.Op != OpRISCV64FMOVDconst {
- break
- }
- c := auxIntToFloat64(v_1.AuxInt)
- if !(float64ExactBits(c, -math.MaxFloat64)) {
+ if v_1.Op != OpRISCV64FMOVDconst || auxIntToFloat64(v_1.AuxInt) != -math.MaxFloat64 {
break
}
v.reset(OpRISCV64ANDI)
- v.AuxInt = int64ToAuxInt(1)
+ v.AuxInt = int64ToAuxInt(0b00_0000_0001)
v0 := b.NewValue0(v.Pos, OpRISCV64FCLASSD, typ.Int64)
v0.AddArg(x)
v.AddArg(v0)
return true
}
- // match: (FLTD (FMOVDconst [c]) x)
- // cond: float64ExactBits(c, math.MaxFloat64)
- // result: (SNEZ (ANDI <typ.Int64> [1<<7] (FCLASSD x)))
+ // match: (FLTD (FMOVDconst [math.MaxFloat64]) x)
+ // result: (SNEZ (ANDI <typ.Int64> [0b00_1000_0000] (FCLASSD x)))
for {
- if v_0.Op != OpRISCV64FMOVDconst {
+ if v_0.Op != OpRISCV64FMOVDconst || auxIntToFloat64(v_0.AuxInt) != math.MaxFloat64 {
break
}
- c := auxIntToFloat64(v_0.AuxInt)
x := v_1
- if !(float64ExactBits(c, math.MaxFloat64)) {
- break
- }
v.reset(OpRISCV64SNEZ)
v0 := b.NewValue0(v.Pos, OpRISCV64ANDI, typ.Int64)
- v0.AuxInt = int64ToAuxInt(1 << 7)
+ v0.AuxInt = int64ToAuxInt(0b00_1000_0000)
v1 := b.NewValue0(v.Pos, OpRISCV64FCLASSD, typ.Int64)
v1.AddArg(x)
v0.AddArg(v1)
@@ -4155,22 +4125,17 @@
v_0 := v.Args[0]
b := v.Block
typ := &b.Func.Config.Types
- // match: (FNED x (FMOVDconst [c]))
- // cond: float64ExactBits(c, math.Inf(-1))
- // result: (SEQZ (ANDI <typ.Int64> [1] (FCLASSD x)))
+ // match: (FNED x (FMOVDconst [math.Inf(-1)]))
+ // result: (SEQZ (ANDI <typ.Int64> [0b00_0000_0001] (FCLASSD x)))
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
x := v_0
- if v_1.Op != OpRISCV64FMOVDconst {
- continue
- }
- c := auxIntToFloat64(v_1.AuxInt)
- if !(float64ExactBits(c, math.Inf(-1))) {
+ if v_1.Op != OpRISCV64FMOVDconst || auxIntToFloat64(v_1.AuxInt) != math.Inf(-1) {
continue
}
v.reset(OpRISCV64SEQZ)
v0 := b.NewValue0(v.Pos, OpRISCV64ANDI, typ.Int64)
- v0.AuxInt = int64ToAuxInt(1)
+ v0.AuxInt = int64ToAuxInt(0b00_0000_0001)
v1 := b.NewValue0(v.Pos, OpRISCV64FCLASSD, typ.Int64)
v1.AddArg(x)
v0.AddArg(v1)
@@ -4179,22 +4144,17 @@
}
break
}
- // match: (FNED x (FMOVDconst [c]))
- // cond: float64ExactBits(c, math.Inf(1))
- // result: (SEQZ (ANDI <typ.Int64> [1<<7] (FCLASSD x)))
+ // match: (FNED x (FMOVDconst [math.Inf(1)]))
+ // result: (SEQZ (ANDI <typ.Int64> [0b00_1000_0000] (FCLASSD x)))
for {
for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
x := v_0
- if v_1.Op != OpRISCV64FMOVDconst {
- continue
- }
- c := auxIntToFloat64(v_1.AuxInt)
- if !(float64ExactBits(c, math.Inf(1))) {
+ if v_1.Op != OpRISCV64FMOVDconst || auxIntToFloat64(v_1.AuxInt) != math.Inf(1) {
continue
}
v.reset(OpRISCV64SEQZ)
v0 := b.NewValue0(v.Pos, OpRISCV64ANDI, typ.Int64)
- v0.AuxInt = int64ToAuxInt(1 << 7)
+ v0.AuxInt = int64ToAuxInt(0b00_1000_0000)
v1 := b.NewValue0(v.Pos, OpRISCV64FCLASSD, typ.Int64)
v1.AddArg(x)
v0.AddArg(v1)

Change information

Files:
  • M src/cmd/compile/internal/ssa/_gen/RISCV64.rules
  • M src/cmd/compile/internal/ssa/rewrite.go
  • M src/cmd/compile/internal/ssa/rewriteRISCV64.go
Change size: M
Delta: 3 files changed, 40 insertions(+), 84 deletions(-)
Open in Gerrit

Related details

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

Michael Munday (Gerrit)

unread,
Nov 3, 2025, 6:18:13 PM (2 days ago) Nov 3
to goph...@pubsubhelper.golang.org, Keith Randall, Meng Zhuo, Joel Sing, golang-co...@googlegroups.com
Attention needed from Joel Sing, Keith Randall and Meng Zhuo

Michael Munday voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Joel Sing
  • Keith Randall
  • Meng Zhuo
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: I92a6338dc71e6a71e04306f67d7d86016c6e9c47
Gerrit-Change-Number: 717580
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Munday <mike...@gmail.com>
Gerrit-Reviewer: Joel Sing <jo...@sing.id.au>
Gerrit-Reviewer: Keith Randall <k...@golang.org>
Gerrit-Reviewer: Meng Zhuo <mengzh...@gmail.com>
Gerrit-Reviewer: Michael Munday <mike...@gmail.com>
Gerrit-Attention: Keith Randall <k...@golang.org>
Gerrit-Attention: Joel Sing <jo...@sing.id.au>
Gerrit-Attention: Meng Zhuo <mengzh...@gmail.com>
Gerrit-Comment-Date: Mon, 03 Nov 2025 23:18:04 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Michael Munday (Gerrit)

unread,
Nov 3, 2025, 6:43:12 PM (2 days ago) Nov 3
to goph...@pubsubhelper.golang.org, Go LUCI, Keith Randall, Meng Zhuo, Joel Sing, golang-co...@googlegroups.com
Attention needed from Joel Sing, Keith Randall and Meng Zhuo

Michael Munday voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Joel Sing
  • Keith Randall
  • Meng Zhuo
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: I92a6338dc71e6a71e04306f67d7d86016c6e9c47
Gerrit-Change-Number: 717580
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Munday <mike...@gmail.com>
Gerrit-Reviewer: Joel Sing <jo...@sing.id.au>
Gerrit-Reviewer: Keith Randall <k...@golang.org>
Gerrit-Reviewer: Meng Zhuo <mengzh...@gmail.com>
Gerrit-Reviewer: Michael Munday <mike...@gmail.com>
Gerrit-Attention: Keith Randall <k...@golang.org>
Gerrit-Attention: Joel Sing <jo...@sing.id.au>
Gerrit-Attention: Meng Zhuo <mengzh...@gmail.com>
Gerrit-Comment-Date: Mon, 03 Nov 2025 23:43:03 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Keith Randall (Gerrit)

unread,
Nov 3, 2025, 7:59:25 PM (2 days ago) Nov 3
to Michael Munday, goph...@pubsubhelper.golang.org, Keith Randall, Go LUCI, Meng Zhuo, Joel Sing, golang-co...@googlegroups.com
Attention needed from Joel Sing, Meng Zhuo and Michael Munday

Keith Randall voted

Auto-Submit+1
Code-Review+2
Open in Gerrit

Related details

Attention is currently required from:
  • Joel Sing
  • Meng Zhuo
  • Michael Munday
Submit Requirements:
  • requirement 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: I92a6338dc71e6a71e04306f67d7d86016c6e9c47
Gerrit-Change-Number: 717580
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Munday <mike...@gmail.com>
Gerrit-Reviewer: Joel Sing <jo...@sing.id.au>
Gerrit-Reviewer: Keith Randall <k...@golang.org>
Gerrit-Reviewer: Meng Zhuo <mengzh...@gmail.com>
Gerrit-Reviewer: Michael Munday <mike...@gmail.com>
Gerrit-Attention: Joel Sing <jo...@sing.id.au>
Gerrit-Attention: Meng Zhuo <mengzh...@gmail.com>
Gerrit-Attention: Michael Munday <mike...@gmail.com>
Gerrit-Comment-Date: Tue, 04 Nov 2025 00:59:20 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Keith Randall (Gerrit)

unread,
Nov 3, 2025, 7:59:37 PM (2 days ago) Nov 3
to Michael Munday, goph...@pubsubhelper.golang.org, Keith Randall, Go LUCI, Meng Zhuo, Joel Sing, golang-co...@googlegroups.com
Attention needed from Joel Sing, Meng Zhuo and Michael Munday

Keith Randall voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Joel Sing
  • Meng Zhuo
  • Michael Munday
Submit Requirements:
  • requirement 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: I92a6338dc71e6a71e04306f67d7d86016c6e9c47
Gerrit-Change-Number: 717580
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Munday <mike...@gmail.com>
Gerrit-Reviewer: Joel Sing <jo...@sing.id.au>
Gerrit-Reviewer: Keith Randall <k...@golang.org>
Gerrit-Reviewer: Keith Randall <k...@google.com>
Gerrit-Reviewer: Meng Zhuo <mengzh...@gmail.com>
Gerrit-Reviewer: Michael Munday <mike...@gmail.com>
Gerrit-Attention: Joel Sing <jo...@sing.id.au>
Gerrit-Attention: Meng Zhuo <mengzh...@gmail.com>
Gerrit-Attention: Michael Munday <mike...@gmail.com>
Gerrit-Comment-Date: Tue, 04 Nov 2025 00:59:32 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Michael Pratt (Gerrit)

unread,
Nov 4, 2025, 3:47:42 PM (2 days ago) Nov 4
to Michael Munday, goph...@pubsubhelper.golang.org, Michael Pratt, Keith Randall, Keith Randall, Go LUCI, Meng Zhuo, Joel Sing, golang-co...@googlegroups.com
Attention needed from Joel Sing, Meng Zhuo and Michael Munday

Michael Pratt voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Joel Sing
  • Meng Zhuo
  • Michael Munday
Submit Requirements:
    • requirement satisfiedCode-Review
    • requirement satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    • requirement satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I92a6338dc71e6a71e04306f67d7d86016c6e9c47
    Gerrit-Change-Number: 717580
    Gerrit-PatchSet: 1
    Gerrit-Owner: Michael Munday <mike...@gmail.com>
    Gerrit-Reviewer: Joel Sing <jo...@sing.id.au>
    Gerrit-Reviewer: Keith Randall <k...@golang.org>
    Gerrit-Reviewer: Keith Randall <k...@google.com>
    Gerrit-Reviewer: Meng Zhuo <mengzh...@gmail.com>
    Gerrit-Reviewer: Michael Munday <mike...@gmail.com>
    Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
    Gerrit-Attention: Joel Sing <jo...@sing.id.au>
    Gerrit-Attention: Meng Zhuo <mengzh...@gmail.com>
    Gerrit-Attention: Michael Munday <mike...@gmail.com>
    Gerrit-Comment-Date: Tue, 04 Nov 2025 20:47:38 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Gopher Robot (Gerrit)

    unread,
    Nov 4, 2025, 3:47:49 PM (2 days ago) Nov 4
    to Michael Munday, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Michael Pratt, Keith Randall, Keith Randall, Go LUCI, Meng Zhuo, Joel Sing, golang-co...@googlegroups.com

    Gopher Robot submitted the change

    Change information

    Commit message:
    cmd/compile/internal/ssa: simplify riscv64 FCLASSD rewrite rules

    We don't need to check that the bit patterns of the constants
    match, it is sufficient to just check the constant is equal to the
    given value.

    While we're here also change the FCLASSD rules to use a bit pattern
    for the mask. I think this improves readability, particularly as
    more uses of FCLASSD get added (e.g. CL 717560).

    These changes should not affect codegen.
    Change-Id: I92a6338dc71e6a71e04306f67d7d86016c6e9c47
    Reviewed-by: Michael Pratt <mpr...@google.com>
    Auto-Submit: Keith Randall <k...@golang.org>
    Reviewed-by: Keith Randall <k...@google.com>
    Reviewed-by: Keith Randall <k...@golang.org>
    Files:
    • M src/cmd/compile/internal/ssa/_gen/RISCV64.rules
    • M src/cmd/compile/internal/ssa/rewrite.go
    • M src/cmd/compile/internal/ssa/rewriteRISCV64.go
    Change size: M
    Delta: 3 files changed, 40 insertions(+), 84 deletions(-)
    Branch: refs/heads/master
    Submit Requirements:
    • requirement satisfiedCode-Review: +2 by Keith Randall, +1 by Keith Randall, +1 by Michael Pratt
    • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I92a6338dc71e6a71e04306f67d7d86016c6e9c47
    Gerrit-Change-Number: 717580
    Gerrit-PatchSet: 2
    Gerrit-Owner: Michael Munday <mike...@gmail.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages