Skip to content

Commit b3b4424

Browse files
abner-chencsophie-zhao
authored andcommitted
cmd/compile: fix If lowering on loong64
Update #40724 Co-authored-by: Xiaolin Zhao <[email protected]> Change-Id: I44477e32db765e0299d8361bd2b8d2c95564ed28 Reviewed-on: https://go-review.googlesource.com/c/go/+/521788 Reviewed-by: Meidan Li <[email protected]> Reviewed-by: David Chase <[email protected]> Auto-Submit: David Chase <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: David Chase <[email protected]> Reviewed-by: Cherry Mui <[email protected]>
1 parent e58c9ba commit b3b4424

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

src/cmd/compile/internal/ssa/_gen/LOONG64.rules

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@
416416
(GetCallerSP ...) => (LoweredGetCallerSP ...)
417417
(GetCallerPC ...) => (LoweredGetCallerPC ...)
418418

419-
(If cond yes no) => (NE cond yes no)
419+
(If cond yes no) => (NE (MOVBUreg <typ.UInt64> cond) yes no)
420420

421421
// Write barrier.
422422
(WB ...) => (LoweredWB ...)
@@ -450,6 +450,7 @@
450450
(EQ (SGTconst [0] x) yes no) => (GEZ x yes no)
451451
(NE (SGT x (MOVVconst [0])) yes no) => (GTZ x yes no)
452452
(EQ (SGT x (MOVVconst [0])) yes no) => (LEZ x yes no)
453+
(MOVBUreg x:((SGT|SGTU) _ _)) => x
453454

454455
// fold offset into address
455456
(ADDVconst [off1] (MOVVaddr [off2] {sym} ptr)) && is32Bit(off1+int64(off2)) => (MOVVaddr [int32(off1)+int32(off2)] {sym} ptr)

src/cmd/compile/internal/ssa/rewriteLOONG64.go

Lines changed: 25 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)