]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/asm: add s390x VMSLG instruction
authorbill_ofarrell <billo@ca.ibm.com>
Thu, 26 Apr 2018 20:30:30 +0000 (16:30 -0400)
committerMichael Munday <mike.munday@ibm.com>
Sat, 28 Apr 2018 22:15:25 +0000 (22:15 +0000)
This instruction was introduced on the z14 to accelerate "limbified"
multiplications for certain cryptographic algorithms. This change allows
it to be used in Go assembly.

Change-Id: Ic93dae7fec1756f662874c08a5abc435bce9dd9e
Reviewed-on: https://go-review.googlesource.com/109695
Run-TryBot: Michael Munday <mike.munday@ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@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
src/cmd/internal/obj/s390x/vector.go

index 68bc29ea10e1535c36845eb2bd0c135d02a4b922..fce855ee3008eb6f7235d670ab67be9f801dddf7 100644 (file)
@@ -367,6 +367,7 @@ TEXT main·foo(SB),DUPOK|NOSPLIT,$16-0 // TEXT main.foo(SB), DUPOK|NOSPLIT, $16-
        VSTEF   $3, V2, (R9)            // e7209000300b
        VSTEH   $7, V31, (R2)           // e7f020007809
        VSTEB   $15, V29, 4094(R12)     // e7d0cffef808
+       VMSLG   V21, V22, V23, V24      // e78563007fb8
 
        RET
        RET     foo(SB)
index d9f50a4f665f2005924e12d42b90f5d6738e7018..ec959c40909fe5c0e8347aec872634300e9831dd 100644 (file)
@@ -941,6 +941,7 @@ const (
        AVUPLB
        AVUPLHW
        AVUPLF
+       AVMSLG
 
        // binary
        ABYTE
index c4731f77b30d6f87d1db18849fee222fcf74a107..2c621a5cbe87ff918101bbeabe7d012be9d53abd 100644 (file)
@@ -677,6 +677,7 @@ var Anames = []string{
        "VUPLB",
        "VUPLHW",
        "VUPLF",
+       "VMSLG",
        "BYTE",
        "WORD",
        "DWORD",
index 3062c9af798ea7cf3420c19f3d2053fa58368681..761cdc563791220ace0bbb042a2309e64a7cde04 100644 (file)
@@ -1376,6 +1376,7 @@ func buildop(ctxt *obj.Link) {
                        opset(AVSTRCZFS, r)
                        opset(AVSBCBIQ, r)
                        opset(AVSBIQ, r)
+                       opset(AVMSLG, r)
                case AVSEL:
                        opset(AVFMADB, r)
                        opset(AWFMADB, r)
@@ -2529,6 +2530,7 @@ const (
        op_VUPLH  uint32 = 0xE7D5 //    VRR-a   VECTOR UNPACK LOGICAL HIGH
        op_VUPLL  uint32 = 0xE7D4 //    VRR-a   VECTOR UNPACK LOGICAL LOW
        op_VUPL   uint32 = 0xE7D6 //    VRR-a   VECTOR UNPACK LOW
+       op_VMSL   uint32 = 0xE7B8 //    VRR-d   VECTOR MULTIPLY SUM LOGICAL
 )
 
 func oclass(a *obj.Addr) int {
index d36dfb17cdfad535f7336a27d2eb849e786b6684..3f1d900367d3b6d6e6c1c28badd9ed77c1156c8e 100644 (file)
@@ -45,6 +45,8 @@ func vop(as obj.As) (opcode, es, cs uint32) {
                return op_VAC, 0, 0
        case AVACQ:
                return op_VAC, 4, 0
+       case AVMSLG:
+               return op_VMSL, 3, 0
        case AVACCC:
                return op_VACCC, 0, 0
        case AVACCCQ: