From 4ae6ab2bdfe3ebe8340d0d49fd2bb73f1a3e19ff Mon Sep 17 00:00:00 2001 From: Vishwanatha HD Date: Mon, 10 Feb 2025 10:50:59 +0000 Subject: cmd/asm: add LCDBR instruction on s390x This CL is to add LCDBR assembly instruction mnemonics, mainly used in math package. The LCDBR instruction has the same effect as the FNEG pseudo-instructions, just that it sets the flag. Change-Id: I3f00f1ed19148d074c3b6c5f64af0772289f2802 Reviewed-on: https://go-review.googlesource.com/c/go/+/648036 Reviewed-by: Srinivas Pokala Reviewed-by: Cherry Mui Reviewed-by: Michael Munday Reviewed-by: Michael Pratt Run-TryBot: Michael Munday LUCI-TryBot-Result: Go LUCI TryBot-Result: Gopher Robot --- src/cmd/asm/internal/asm/testdata/s390x.s | 5 +++-- src/cmd/internal/obj/s390x/a.out.go | 1 + src/cmd/internal/obj/s390x/anames.go | 1 + src/cmd/internal/obj/s390x/asmz.go | 3 +++ 4 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src/cmd') diff --git a/src/cmd/asm/internal/asm/testdata/s390x.s b/src/cmd/asm/internal/asm/testdata/s390x.s index db2ee199cf..95a8c50dab 100644 --- a/src/cmd/asm/internal/asm/testdata/s390x.s +++ b/src/cmd/asm/internal/asm/testdata/s390x.s @@ -401,6 +401,7 @@ TEXT main·foo(SB),DUPOK|NOSPLIT,$16-0 // TEXT main.foo(SB), DUPOK|NOSPLIT, $16- FMADDS F1, F2, F3 // b30e3012 FMSUB F4, F5, F5 // b31f5045 FMSUBS F6, F6, F7 // b30f7066 + LCDBR F0, F2 // b3130020 LPDFR F1, F2 // b3700021 LNDFR F3, F4 // b3710043 CPSDR F5, F6, F7 // b3725076 @@ -420,8 +421,8 @@ TEXT main·foo(SB),DUPOK|NOSPLIT,$16-0 // TEXT main.foo(SB), DUPOK|NOSPLIT, $16- KLMD R2, R8 // b93f0028 KIMD R0, R4 // b93e0004 KDSA R0, R8 // b93a0008 - KMA R2, R6, R4 // b9296024 - KMCTR R2, R6, R4 // b92d6024 + KMA R2, R6, R4 // b9296024 + KMCTR R2, R6, R4 // b92d6024 // vector add and sub instructions VAB V3, V4, V4 // e743400000f3 diff --git a/src/cmd/internal/obj/s390x/a.out.go b/src/cmd/internal/obj/s390x/a.out.go index 08ade51924..3eed4624b1 100644 --- a/src/cmd/internal/obj/s390x/a.out.go +++ b/src/cmd/internal/obj/s390x/a.out.go @@ -329,6 +329,7 @@ const ( AFNABS AFNEG AFNEGS + ALCDBR ALEDBR ALDEBR ALPDFR diff --git a/src/cmd/internal/obj/s390x/anames.go b/src/cmd/internal/obj/s390x/anames.go index fa23984332..ae86d2092b 100644 --- a/src/cmd/internal/obj/s390x/anames.go +++ b/src/cmd/internal/obj/s390x/anames.go @@ -96,6 +96,7 @@ var Anames = []string{ "FNABS", "FNEG", "FNEGS", + "LCDBR", "LEDBR", "LDEBR", "LPDFR", diff --git a/src/cmd/internal/obj/s390x/asmz.go b/src/cmd/internal/obj/s390x/asmz.go index 98dbc7c834..6511549eeb 100644 --- a/src/cmd/internal/obj/s390x/asmz.go +++ b/src/cmd/internal/obj/s390x/asmz.go @@ -969,6 +969,7 @@ func buildop(ctxt *obj.Link) { opset(ALNDFR, r) opset(AFNEG, r) opset(AFNEGS, r) + opset(ALCDBR, r) opset(ALEDBR, r) opset(ALDEBR, r) opset(AFSQRT, r) @@ -3373,6 +3374,8 @@ func (c *ctxtz) asmout(p *obj.Prog, asm *[]byte) { opcode = op_LCDFR case AFNEGS: opcode = op_LCEBR + case ALCDBR: + opcode = op_LCDBR case ALEDBR: opcode = op_LEDBR case ALDEBR: -- cgit v1.3