aboutsummaryrefslogtreecommitdiff
path: root/test/codegen
diff options
context:
space:
mode:
authorXiaolin Zhao <zhaoxiaolin@loongson.cn>2025-08-21 11:36:54 +0800
committerabner chenc <chenguoqi@loongson.cn>2025-08-24 18:14:13 -0700
commit83420974b7b70fdd39b2b95fde37278af26513b7 (patch)
treeff732a347932a14ea65ab1f481839da2abeca4a6 /test/codegen
parentf2db0dca0b0399c08319d22cbcbfa83be2bb781a (diff)
downloadgo-83420974b7b70fdd39b2b95fde37278af26513b7.tar.xz
test/codegen: add sqrt* abs and copysign test for loong64
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>
Diffstat (limited to 'test/codegen')
-rw-r--r--test/codegen/math.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/codegen/math.go b/test/codegen/math.go
index 5b3e727254..eadf9d7d05 100644
--- a/test/codegen/math.go
+++ b/test/codegen/math.go
@@ -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"