]> Cypherpunks repositories - gostls13.git/commitdiff
test/codegen: add sqrt* abs and copysign test for loong64
authorXiaolin Zhao <zhaoxiaolin@loongson.cn>
Thu, 21 Aug 2025 03:36:54 +0000 (11:36 +0800)
committerabner chenc <chenguoqi@loongson.cn>
Mon, 25 Aug 2025 01:14:13 +0000 (18:14 -0700)
Change-Id: I645396fc4b00242f36a06f01550906805c0c1f73
Reviewed-on: https://go-review.googlesource.com/c/go/+/697955
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: Carlos Amedee <carlos@golang.org>
test/codegen/math.go

index 5b3e7272542387b7d168ebc5dccad55af7d53dd5..eadf9d7d0554dbf8ba0b9b1ca4bda2f0440c23aa 100644 (file)
@@ -53,6 +53,7 @@ func sqrt(x float64) float64 {
        // 386/sse2:"SQRTSD" 386/softfloat:-"SQRTD"
        // arm64:"FSQRTD"
        // arm/7:"SQRTD"
+       // loong64:"SQRTD"
        // mips/hardfloat:"SQRTD" mips/softfloat:-"SQRTD"
        // mips64/hardfloat:"SQRTD" mips64/softfloat:-"SQRTD"
        // wasm:"F64Sqrt"
@@ -66,6 +67,7 @@ func sqrt32(x float32) float32 {
        // 386/sse2:"SQRTSS" 386/softfloat:-"SQRTS"
        // arm64:"FSQRTS"
        // arm/7:"SQRTF"
+       // loong64:"SQRTF"
        // mips/hardfloat:"SQRTF" mips/softfloat:-"SQRTF"
        // mips64/hardfloat:"SQRTF" mips64/softfloat:-"SQRTF"
        // wasm:"F32Sqrt"
@@ -78,6 +80,7 @@ func sqrt32(x float32) float32 {
 func abs(x, y float64) {
        // amd64:"BTRQ\t[$]63"
        // arm64:"FABSD\t"
+       // loong64:"ABSD\t"
        // s390x:"LPDFR\t",-"MOVD\t"     (no integer load/store)
        // ppc64x:"FABS\t"
        // riscv64:"FABSD\t"
@@ -102,6 +105,7 @@ func abs32(x float32) float32 {
 // Check that it's using integer registers
 func copysign(a, b, c float64) {
        // amd64:"BTRQ\t[$]63","ANDQ","ORQ"
+       // loong64:"FCOPYSGD"
        // s390x:"CPSDR",-"MOVD"         (no integer load/store)
        // ppc64x:"FCPSGN"
        // riscv64:"FSGNJD"
@@ -109,6 +113,7 @@ func copysign(a, b, c float64) {
        sink64[0] = math.Copysign(a, b)
 
        // amd64:"BTSQ\t[$]63"
+       // loong64:"FCOPYSGD"
        // s390x:"LNDFR\t",-"MOVD\t"     (no integer load/store)
        // ppc64x:"FCPSGN"
        // riscv64:"FSGNJD"
@@ -121,6 +126,7 @@ func copysign(a, b, c float64) {
        sink64[2] = math.Float64frombits(math.Float64bits(a) | 1<<63)
 
        // amd64:"ANDQ","ORQ"
+       // loong64:"FCOPYSGD"
        // s390x:"CPSDR\t",-"MOVD\t"     (no integer load/store)
        // ppc64x:"FCPSGN"
        // riscv64:"FSGNJD"