aboutsummaryrefslogtreecommitdiff
path: root/test/codegen
diff options
context:
space:
mode:
authorlimeidan <limeidan@loongson.cn>2025-08-19 19:16:31 +0800
committerGopher Robot <gobot@golang.org>2025-08-21 11:23:05 -0700
commit1843f1e9c0e44835b0a683f69ab33ff9ea744f6c (patch)
treec856f1854f4919e081edfab03487968bfff4e3ab /test/codegen
parente0870a0a121c22899208d80e81310d247c54f198 (diff)
downloadgo-1843f1e9c0e44835b0a683f69ab33ff9ea744f6c.tar.xz
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>
Diffstat (limited to 'test/codegen')
-rw-r--r--test/codegen/bitfield.go2
-rw-r--r--test/codegen/multiply.go2
-rw-r--r--test/codegen/shift.go6
3 files changed, 5 insertions, 5 deletions
diff --git a/test/codegen/bitfield.go b/test/codegen/bitfield.go
index 6374d70650..51221266e1 100644
--- a/test/codegen/bitfield.go
+++ b/test/codegen/bitfield.go
@@ -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
}
diff --git a/test/codegen/multiply.go b/test/codegen/multiply.go
index dc2910dab7..8c408cbfba 100644
--- a/test/codegen/multiply.go
+++ b/test/codegen/multiply.go
@@ -12,7 +12,7 @@ package codegen
func m0(x int64) int64 {
// amd64: "XORL"
// arm64: "MOVD\tZR"
- // loong64: "MOVV\t[$]0"
+ // loong64: "MOVV\tR0"
return x * 0
}
func m2(x int64) int64 {
diff --git a/test/codegen/shift.go b/test/codegen/shift.go
index 3ab0fcfabc..1c71b0f3ef 100644
--- a/test/codegen/shift.go
+++ b/test/codegen/shift.go
@@ -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
}