]> Cypherpunks repositories - gostls13.git/commitdiff
test/codegen: add Mul* test for loong64
authorXiaolin Zhao <zhaoxiaolin@loongson.cn>
Thu, 21 Aug 2025 02:36:34 +0000 (10:36 +0800)
committerabner chenc <chenguoqi@loongson.cn>
Mon, 25 Aug 2025 01:14:22 +0000 (18:14 -0700)
Change-Id: Ica285212e4884a96fe9738b53cdc789b223bf2e3
Reviewed-on: https://go-review.googlesource.com/c/go/+/697895
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
test/codegen/mathbits.go

index c7ba357d09b97a6f640abd6310e6ff82472b25b3..ba5387d2c32121cbb9eb03ac9903f507ee83ae43 100644 (file)
@@ -938,6 +938,7 @@ func Sub64MPanicOnOverflowGT(a, b [2]uint64) [2]uint64 {
 func Mul(x, y uint) (hi, lo uint) {
        // amd64:"MULQ"
        // arm64:"UMULH","MUL"
+       // loong64:"MULV","MULHVU"
        // ppc64x:"MULHDU","MULLD"
        // s390x:"MLGR"
        // mips64: "MULVU"
@@ -948,6 +949,7 @@ func Mul(x, y uint) (hi, lo uint) {
 func Mul64(x, y uint64) (hi, lo uint64) {
        // amd64:"MULQ"
        // arm64:"UMULH","MUL"
+       // loong64:"MULV","MULHVU"
        // ppc64x:"MULHDU","MULLD"
        // s390x:"MLGR"
        // mips64: "MULVU"
@@ -957,6 +959,7 @@ func Mul64(x, y uint64) (hi, lo uint64) {
 
 func Mul64HiOnly(x, y uint64) uint64 {
        // arm64:"UMULH",-"MUL"
+       // loong64:"MULHVU",-"MULV"
        // riscv64:"MULHU",-"MUL\t"
        hi, _ := bits.Mul64(x, y)
        return hi
@@ -964,6 +967,7 @@ func Mul64HiOnly(x, y uint64) uint64 {
 
 func Mul64LoOnly(x, y uint64) uint64 {
        // arm64:"MUL",-"UMULH"
+       // loong64:"MULV",-"MULHVU"
        // riscv64:"MUL\t",-"MULHU"
        _, lo := bits.Mul64(x, y)
        return lo
@@ -972,6 +976,7 @@ func Mul64LoOnly(x, y uint64) uint64 {
 func Mul64Const() (uint64, uint64) {
        // 7133701809754865664 == 99<<56
        // arm64:"MOVD\t[$]7133701809754865664, R1", "MOVD\t[$]88, R0"
+       // loong64:"MOVV\t[$]88, R4","MOVV\t[$]7133701809754865664, R5",-"MUL"
        return bits.Mul64(99+88<<8, 1<<56)
 }