From cedf63616a00c8a6a69f6bbe4bc93b6865cec842 Mon Sep 17 00:00:00 2001 From: Michael Munday Date: Fri, 27 Jun 2025 21:05:38 +0100 Subject: 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 LUCI-TryBot-Result: Go LUCI Reviewed-by: Mark Freeman Reviewed-by: Keith Randall --- test/codegen/floats.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/codegen') 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) } -- cgit v1.3