test/codegen: accept ppc64x as alias for ppc64le and ppc64 arches
This helps simplify the noise when adding ppc codegen tests. ppc64x
is used in other places to indicate something which runs on either
endian.
This helps cleanup existing codegen tests which are mostly
identical between endian variants.
condmove tests are converted as an example.
Change-Id: I2b2d98a9a1859015f62db38d62d9d5d7593435b4
Reviewed-on: https://go-review.googlesource.com/c/go/+/462895
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Paul Murphy <murp@ibm.com>
diff --git a/test/codegen/condmove.go b/test/codegen/condmove.go
index 7b0f32e..6c08116 100644
--- a/test/codegen/condmove.go
+++ b/test/codegen/condmove.go
@@ -13,8 +13,7 @@
}
// amd64:"CMOVQLT"
// arm64:"CSEL\tLT"
- // ppc64:"ISEL\t[$]0"
- // ppc64le:"ISEL\t[$]0"
+ // ppc64x:"ISEL\t[$]0"
// wasm:"Select"
return x
}
@@ -25,8 +24,7 @@
}
// amd64:"CMOVQNE"
// arm64:"CSEL\tNE"
- // ppc64:"ISEL\t[$]2"
- // ppc64le:"ISEL\t[$]2"
+ // ppc64x:"ISEL\t[$]2"
// wasm:"Select"
return x
}
@@ -37,8 +35,7 @@
}
// amd64:"CMOVQ(HI|CS)"
// arm64:"CSNEG\tLS"
- // ppc64:"ISEL\t[$]1"
- // ppc64le:"ISEL\t[$]1"
+ // ppc64x:"ISEL\t[$]1"
// wasm:"Select"
return x
}
@@ -49,8 +46,7 @@
}
// amd64:"CMOVL(HI|CS)"
// arm64:"CSNEG\t(LS|HS)"
- // ppc64:"ISEL\t[$]1"
- // ppc64le:"ISEL\t[$]1"
+ // ppc64x:"ISEL\t[$]1"
// wasm:"Select"
return x
}
@@ -61,8 +57,7 @@
}
// amd64:"CMOVW(HI|CS)"
// arm64:"CSNEG\t(LS|HS)"
- // ppc64:"ISEL\t[$]0"
- // ppc64le:"ISEL\t[$]0"
+ // ppc64x:"ISEL\t[$]0"
// wasm:"Select"
return x
}
@@ -76,8 +71,7 @@
}
// amd64:"CMOVQNE","CMOVQPC"
// arm64:"CSEL\tEQ"
- // ppc64:"ISEL\t[$]2"
- // ppc64le:"ISEL\t[$]2"
+ // ppc64x:"ISEL\t[$]2"
// wasm:"Select"
return a
}
@@ -89,8 +83,7 @@
}
// amd64:"CMOVQNE","CMOVQPS"
// arm64:"CSEL\tNE"
- // ppc64:"ISEL\t[$]2"
- // ppc64le:"ISEL\t[$]2"
+ // ppc64x:"ISEL\t[$]2"
// wasm:"Select"
return a
}
@@ -117,8 +110,7 @@
}
// amd64:"CMOVQHI"
// arm64:"CSEL\tMI"
- // ppc64:"ISEL\t[$]0"
- // ppc64le:"ISEL\t[$]0"
+ // ppc64x:"ISEL\t[$]0"
// wasm:"Select"
r = r - ldexp(y, rexp-yexp)
}
@@ -133,8 +125,7 @@
}
// amd64:"CMOVQNE"
// arm64:"CSEL\tNE"
- // ppc64:"ISEL\t[$]2"
- // ppc64le:"ISEL\t[$]2"
+ // ppc64x:"ISEL\t[$]2"
// wasm:"Select"
return y
}
@@ -146,13 +137,12 @@
}
// amd64:"CMOVQEQ"
// arm64:"CSEL\tEQ"
- // ppc64:"ISEL\t[$]2"
- // ppc64le:"ISEL\t[$]2"
+ // ppc64x:"ISEL\t[$]2"
// wasm:"Select"
return a
}
-// Floating point CMOVs are not supported by amd64/arm64/ppc64/ppc64le
+// Floating point CMOVs are not supported by amd64/arm64/ppc64x
func cmovfloatmove(x, y int) float64 {
a := 1.0
if x <= y {
@@ -160,8 +150,7 @@
}
// amd64:-"CMOV"
// arm64:-"CSEL"
- // ppc64:-"ISEL"
- // ppc64le:-"ISEL"
+ // ppc64x:-"ISEL"
// wasm:-"Select"
return a
}
@@ -450,8 +439,7 @@
if a == b {
x = a
}
- // ppc64:"ISEL\t[$]2, R[0-9]+, R0, R[0-9]+"
- // ppc64le:"ISEL\t[$]2, R[0-9]+, R0, R[0-9]+"
+ // ppc64x:"ISEL\t[$]2, R[0-9]+, R0, R[0-9]+"
return x
}
@@ -460,7 +448,6 @@
if a == b {
x = 0
}
- // ppc64:"ISEL\t[$]2, R0, R[0-9]+, R[0-9]+"
- // ppc64le:"ISEL\t[$]2, R0, R[0-9]+, R[0-9]+"
+ // ppc64x:"ISEL\t[$]2, R0, R[0-9]+, R[0-9]+"
return x
}
diff --git a/test/run.go b/test/run.go
index 999aa4a..9a18f13 100644
--- a/test/run.go
+++ b/test/run.go
@@ -1664,6 +1664,7 @@
"mips64": {"GOMIPS64", "hardfloat", "softfloat"},
"ppc64": {"GOPPC64", "power8", "power9"},
"ppc64le": {"GOPPC64", "power8", "power9"},
+ "ppc64x": {}, // A pseudo-arch representing both ppc64 and ppc64le
"s390x": {},
"wasm": {},
"riscv64": {},
@@ -1756,15 +1757,22 @@
// Create the build environments corresponding the above specifiers
envs := make([]buildEnv, 0, 4)
- if subarch != "" {
- envs = append(envs, buildEnv(os+"/"+arch+"/"+subarch))
- } else {
- subarchs := archVariants[arch]
- if len(subarchs) == 0 {
- envs = append(envs, buildEnv(os+"/"+arch+"/"))
+ arches := []string{arch}
+ // ppc64x is a pseudo-arch, generate tests for both endian variants.
+ if arch == "ppc64x" {
+ arches = []string{"ppc64", "ppc64le"}
+ }
+ for _, arch := range arches {
+ if subarch != "" {
+ envs = append(envs, buildEnv(os+"/"+arch+"/"+subarch))
} else {
- for _, sa := range archVariants[arch][1:] {
- envs = append(envs, buildEnv(os+"/"+arch+"/"+sa))
+ subarchs := archVariants[arch]
+ if len(subarchs) == 0 {
+ envs = append(envs, buildEnv(os+"/"+arch+"/"))
+ } else {
+ for _, sa := range archVariants[arch][1:] {
+ envs = append(envs, buildEnv(os+"/"+arch+"/"+sa))
+ }
}
}
}