Skip to content

Commit d71d8ae

Browse files
kmvijaygopherbot
authored andcommitted
cmd/internal/obj/s390x: add MVCLE instruction
MVCLE (Move Long Extended) instruction is used to move large data storage-to-storage. This change will add MVCLE into the Go asm for s390x architecture. Upcoming PR of runtime/memmove_s390x.s will use this instruction for performance improvement. Change-Id: I3bbb6668c736a36849917887398c74cebb1c3a99 Reviewed-on: https://go-review.googlesource.com/c/go/+/677455 Reviewed-by: Srinivas Pokala <[email protected]> Reviewed-by: Keith Randall <[email protected]> Auto-Submit: Michael Knyszek <[email protected]> Reviewed-by: Keith Randall <[email protected]> Reviewed-by: Michael Munday <[email protected]> Reviewed-by: Vishwanatha HD <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Michael Knyszek <[email protected]>
1 parent b6cf1d9 commit d71d8ae

File tree

4 files changed

+30
-1
lines changed

4 files changed

+30
-1
lines changed

src/cmd/asm/internal/asm/testdata/s390x.s

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,15 @@ TEXT main·foo(SB),DUPOK|NOSPLIT,$16-0 // TEXT main.foo(SB), DUPOK|NOSPLIT, $16-
263263
NC $8, (R15), n-8(SP) // d407f010f000
264264
OC $8, (R15), n-8(SP) // d607f010f000
265265
MVC $8, (R15), n-8(SP) // d207f010f000
266+
MVC $256, 8192(R1), 8192(R2) // b90400a2c2a800002000b90400b1c2b800002000d2ffa000b000
266267
MVCIN $8, (R15), n-8(SP) // e807f010f000
267268
CLC $8, (R15), n-8(SP) // d507f000f010
268269
XC $256, -8(R15), -8(R15) // b90400afc2a8fffffff8d7ffa000a000
269-
MVC $256, 8192(R1), 8192(R2) // b90400a2c2a800002000b90400b1c2b800002000d2ffa000b000
270+
MVCLE 0, R4, R6 // a8640000
271+
MVCLE 4095, R4, R6 // a8640fff
272+
MVCLE $4095, R4, R6 // a8640fff
273+
MVCLE (R3), R4, R6 // a8643000
274+
MVCLE 10(R3), R4, R6 // a864300a
270275

271276
CMP R1, R2 // b9200012
272277
CMP R3, $32767 // a73f7fff

src/cmd/internal/obj/s390x/a.out.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,7 @@ const (
444444
// storage-and-storage
445445
AMVC
446446
AMVCIN
447+
AMVCLE
447448
ACLC
448449
AXC
449450
AOC

src/cmd/internal/obj/s390x/anames.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cmd/internal/obj/s390x/asmz.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,10 @@ var optab = []Optab{
449449

450450
// VRR-f
451451
{i: 122, as: AVLVGP, a1: C_REG, a2: C_REG, a6: C_VREG},
452+
453+
// MVC storage and storage
454+
{i: 127, as: AMVCLE, a1: C_LOREG, a2: C_REG, a6: C_REG},
455+
{i: 127, as: AMVCLE, a1: C_SCON, a2: C_REG, a6: C_REG},
452456
}
453457

454458
var oprange [ALAST & obj.AMask][]Optab
@@ -4453,6 +4457,24 @@ func (c *ctxtz) asmout(p *obj.Prog, asm *[]byte) {
44534457
}
44544458
}
44554459
zRRF(opcode, uint32(p.Reg), 0, uint32(p.From.Reg), uint32(p.To.Reg), asm)
4460+
4461+
case 127:
4462+
// NOTE: Mapping MVCLE operands is as follows:
4463+
// Instruction Format: MVCLE R1,R3,D2(B2)
4464+
// R1 - prog.To (for Destination)
4465+
// R3 - prog.Reg (for Source)
4466+
// B2 - prog.From (for Padding Byte)
4467+
d2 := c.regoff(&p.From)
4468+
if p.To.Reg&1 != 0 {
4469+
c.ctxt.Diag("output argument must be even register in %v", p)
4470+
}
4471+
if p.Reg&1 != 0 {
4472+
c.ctxt.Diag("input argument must be an even register in %v", p)
4473+
}
4474+
if (p.From.Reg == p.To.Reg) || (p.From.Reg == p.Reg) {
4475+
c.ctxt.Diag("padding byte register cannot be same as input or output register %v", p)
4476+
}
4477+
zRS(op_MVCLE, uint32(p.To.Reg), uint32(p.Reg), uint32(p.From.Reg), uint32(d2), asm)
44564478
}
44574479
}
44584480

0 commit comments

Comments
 (0)