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 --- src/cmd/asm/internal/asm/testdata/s390x.s | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/cmd/asm/internal') diff --git a/src/cmd/asm/internal/asm/testdata/s390x.s b/src/cmd/asm/internal/asm/testdata/s390x.s index a19292b263..93c3ec9ea7 100644 --- a/src/cmd/asm/internal/asm/testdata/s390x.s +++ b/src/cmd/asm/internal/asm/testdata/s390x.s @@ -540,6 +540,18 @@ TEXT main·foo(SB),DUPOK|NOSPLIT,$16-0 // TEXT main.foo(SB), DUPOK|NOSPLIT, $16- VSTRCZBS V18, V20, V22, V24 // e78240306f8a VSTRCZHS V18, V20, V22, V24 // e78241306f8a VSTRCZFS V18, V20, V22, V24 // e78242306f8a + VFMAXSB $1, V2, V3, V4 // e742301020ef + WFMAXSB $2, V5, V6, V7 // e775602820ef + WFMAXSB $2, F5, F6, F7 // e775602820ef + VFMAXDB $3, V8, V9, V10 // e7a8903030ef + WFMAXDB $4, V11, V12, V13 // e7dbc04830ef + WFMAXDB $4, F11, F12, F13 // e7dbc04830ef + VFMINSB $7, V14, V15, V16 // e70ef07028ee + WFMINSB $8, V17, V18, V19 // e73120882eee + WFMINSB $8, F1, F2, F3 // e731208820ee + VFMINDB $9, V20, V21, V22 // e76450903eee + WFMINDB $10, V23, V24, V25 // e79780a83eee + WFMINDB $10, F7, F8, F9 // e79780a830ee RET RET foo(SB) -- cgit v1.3-5-g9baa