aboutsummaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
authorVishwanatha HD <Vishwanatha.HD@ibm.com>2025-02-10 10:50:59 +0000
committerCherry Mui <cherryyz@google.com>2025-03-24 07:05:55 -0700
commit4ae6ab2bdfe3ebe8340d0d49fd2bb73f1a3e19ff (patch)
tree50778b99c5119197fd89722e7226a350013e4de7 /src/cmd
parent3ada42ffedf61343cc8a7cd7d6293bd646ecf3a6 (diff)
downloadgo-4ae6ab2bdfe3ebe8340d0d49fd2bb73f1a3e19ff.tar.xz
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 <Pokala.Srinivas@ibm.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Michael Munday <mike.munday@lowrisc.org> Reviewed-by: Michael Pratt <mpratt@google.com> Run-TryBot: Michael Munday <mike.munday@lowrisc.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/asm/internal/asm/testdata/s390x.s5
-rw-r--r--src/cmd/internal/obj/s390x/a.out.go1
-rw-r--r--src/cmd/internal/obj/s390x/anames.go1
-rw-r--r--src/cmd/internal/obj/s390x/asmz.go3
4 files changed, 8 insertions, 2 deletions
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: