]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal: add MVCIN instruction to s390x assembler
authorRuixin(Peter) Bao <ruixin.bao@ibm.com>
Tue, 7 Apr 2020 13:20:08 +0000 (09:20 -0400)
committerMichael Munday <mike.munday@ibm.com>
Tue, 7 Apr 2020 15:03:09 +0000 (15:03 +0000)
On s390x, we already have MVCIN opcode in asmz.go,
but we did not use it. This CL uses that opcode and adds MVCIN
instruction.

MVCIN instruction can be used to move data from one storage location
to another while reversing the order of bytes within the field. This
could be useful when transforming data from little-endian to big-endian.

Change-Id: Ifa1a911c0d3442f4a62f91f74ed25b196d01636b
Reviewed-on: https://go-review.googlesource.com/c/go/+/227478
Reviewed-by: Michael Munday <mike.munday@ibm.com>
Run-TryBot: Michael Munday <mike.munday@ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/asm/internal/asm/testdata/s390x.s
src/cmd/internal/obj/s390x/a.out.go
src/cmd/internal/obj/s390x/anames.go
src/cmd/internal/obj/s390x/asmz.go

index 85adb476b7dfc8574fee1791714692c5a6c84e28..1ae614ae172feb01a7b5affb65d9a2ca82cf563f 100644 (file)
@@ -259,6 +259,7 @@ TEXT main·foo(SB),DUPOK|NOSPLIT,$16-0 // TEXT main.foo(SB), DUPOK|NOSPLIT, $16-
        NC      $8, (R15), n-8(SP)       // d407f010f000
        OC      $8, (R15), n-8(SP)       // d607f010f000
        MVC     $8, (R15), n-8(SP)       // d207f010f000
+       MVCIN   $8, (R15), n-8(SP)       // e807f010f000
        CLC     $8, (R15), n-8(SP)       // d507f000f010
        XC      $256, -8(R15), -8(R15)   // b90400afc2a8fffffff8d7ffa000a000
        MVC     $256, 8192(R1), 8192(R2) // b90400a2c2a800002000b90400b1c2b800002000d2ffa000b000
index 3e83072aad0a55fc3fc76bf63abf9c4894df2d44..2605014e6d4d42a8f4b231184ee3d674860f5c6d 100644 (file)
@@ -441,6 +441,7 @@ const (
 
        // storage-and-storage
        AMVC
+       AMVCIN
        ACLC
        AXC
        AOC
index d8556d86458677818de8c841f8be3b5150a202ec..8b2a76b2c9aab937e3c0e62c218d7d28424a0759 100644 (file)
@@ -179,6 +179,7 @@ var Anames = []string{
        "CMPUBLT",
        "CMPUBNE",
        "MVC",
+       "MVCIN",
        "CLC",
        "XC",
        "OC",
index ff7cc73fe495887f07c45744f568752b63b727de..dca9d990e0ea91b808ea34f2eb22c3dcc181faa2 100644 (file)
@@ -925,6 +925,7 @@ func buildop(ctxt *obj.Link) {
                case ALA:
                        opset(ALAY, r)
                case AMVC:
+                       opset(AMVCIN, r)
                        opset(ACLC, r)
                        opset(AXC, r)
                        opset(AOC, r)
@@ -3807,6 +3808,8 @@ func (c *ctxtz) asmout(p *obj.Prog, asm *[]byte) {
                        c.ctxt.Diag("unexpected opcode %v", p.As)
                case AMVC:
                        opcode = op_MVC
+               case AMVCIN:
+                       opcode = op_MVCIN
                case ACLC:
                        opcode = op_CLC
                        // swap operand order for CLC so that it matches CMP