cmd/compile: use zero register instead of specialized *zero instructions on loong64

Refer to CL 633075, loong64 has a zero(R0) register that can be used to do this.

Change-Id: I846c6bdfcfd6dbfa18338afc13e34e350580ead4
Reviewed-on: https://go-review.googlesource.com/c/go/+/693876
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
This commit is contained in:
limeidan 2025-08-19 19:16:31 +08:00 committed by Gopher Robot
parent e0870a0a12
commit 1843f1e9c0
11 changed files with 80 additions and 797 deletions

View file

@ -373,6 +373,6 @@ func shift(x uint32, y uint16, z uint8) uint64 {
// loong64:-`MOVBU`,-`SRLV\t[$]8`
c := uint64(z) >> 8
// arm64:`MOVD\tZR`,-`ADD\tR[0-9]+>>16`,-`ADD\tR[0-9]+>>8`,
// loong64:`MOVV\t[$]0`,-`ADDVU`
// loong64:`MOVV\tR0`,-`ADDVU`
return a + b + c
}