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

@ -25,19 +25,19 @@ func rshConst64Ux64(v uint64) uint64 {
}
func rshConst64Ux64Overflow32(v uint32) uint64 {
// loong64:"MOVV\t\\$0,",-"SRL\t"
// loong64:"MOVV\tR0,",-"SRL\t"
// riscv64:"MOV\t\\$0,",-"SRL"
return uint64(v) >> 32
}
func rshConst64Ux64Overflow16(v uint16) uint64 {
// loong64:"MOVV\t\\$0,",-"SRLV"
// loong64:"MOVV\tR0,",-"SRLV"
// riscv64:"MOV\t\\$0,",-"SRL"
return uint64(v) >> 16
}
func rshConst64Ux64Overflow8(v uint8) uint64 {
// loong64:"MOVV\t\\$0,",-"SRLV"
// loong64:"MOVV\tR0,",-"SRLV"
// riscv64:"MOV\t\\$0,",-"SRL"
return uint64(v) >> 8
}