aboutsummaryrefslogtreecommitdiff
path: root/test/codegen
diff options
context:
space:
mode:
authorMichael Munday <mndygolang+git@gmail.com>2025-06-27 21:05:38 +0100
committerMichael Munday <mndygolang+git@gmail.com>2025-07-30 12:29:15 -0700
commitcedf63616a00c8a6a69f6bbe4bc93b6865cec842 (patch)
treee94c1a8afe63304f07725460363f7957325566b3 /test/codegen
parent82a1921c3b6b493c4ff358f063c2ffffabba9fd5 (diff)
downloadgo-cedf63616a00c8a6a69f6bbe4bc93b6865cec842.tar.xz
cmd/compile: add floating point min/max intrinsics on s390x
Add the VECTOR FP (MINIMUM|MAXIMUM) instructions to the assembler and use them in the compiler to implement min and max. Note: I've allowed floating point registers to be used with the single element instructions (those with the W instead of V prefix) to allow easier integration into the compiler. Change-Id: I5f80a510bd248cf483cce95f1979bf63fbae7de6 Reviewed-on: https://go-review.googlesource.com/c/go/+/684715 Reviewed-by: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Mark Freeman <mark@golang.org> Reviewed-by: Keith Randall <khr@google.com>
Diffstat (limited to 'test/codegen')
-rw-r--r--test/codegen/floats.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/codegen/floats.go b/test/codegen/floats.go
index d04202d394..0cee497279 100644
--- a/test/codegen/floats.go
+++ b/test/codegen/floats.go
@@ -172,6 +172,7 @@ func Float64Min(a, b float64) float64 {
// riscv64:"FMIN"
// ppc64/power9:"XSMINJDP"
// ppc64/power10:"XSMINJDP"
+ // s390x: "WFMINDB"
return min(a, b)
}
@@ -182,6 +183,7 @@ func Float64Max(a, b float64) float64 {
// riscv64:"FMAX"
// ppc64/power9:"XSMAXJDP"
// ppc64/power10:"XSMAXJDP"
+ // s390x: "WFMAXDB"
return max(a, b)
}
@@ -192,6 +194,7 @@ func Float32Min(a, b float32) float32 {
// riscv64:"FMINS"
// ppc64/power9:"XSMINJDP"
// ppc64/power10:"XSMINJDP"
+ // s390x: "WFMINSB"
return min(a, b)
}
@@ -202,6 +205,7 @@ func Float32Max(a, b float32) float32 {
// riscv64:"FMAXS"
// ppc64/power9:"XSMAXJDP"
// ppc64/power10:"XSMAXJDP"
+ // s390x: "WFMAXSB"
return max(a, b)
}