]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal/obj/ppc64: add support for vmrgow,vmrgew
authorLynn Boger <laboger@linux.vnet.ibm.com>
Wed, 28 Aug 2019 13:46:11 +0000 (09:46 -0400)
committerLynn Boger <laboger@linux.vnet.ibm.com>
Thu, 29 Aug 2019 13:27:55 +0000 (13:27 +0000)
This adds support for ppc64 instructions vmrgow and vmrgew which
are needed for an improved implementation of chacha20.

Change-Id: I967a2de54236bcc573a99f7e2b222d5a8bb29e03
Reviewed-on: https://go-review.googlesource.com/c/go/+/192117
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
src/cmd/asm/internal/asm/testdata/ppc64.s
src/cmd/internal/obj/ppc64/a.out.go
src/cmd/internal/obj/ppc64/anames.go
src/cmd/internal/obj/ppc64/asm9.go

index 8440375de6bcf9061947c080f84613fbd053d008..ce520b1ecf74b0a9dc0365934718169293dc9491 100644 (file)
@@ -900,6 +900,13 @@ label1:
 //     <mnemonic> VRT,VRA,VRB,SHB
        VSLDOI  $4, V2, V1, V0
 
+//     Vector merge odd and even word
+//     <MNEMONIC> VRA,VRB,VRT produces
+//     <mnemonic> VRT,VRA,VRB
+
+       VMRGOW  V4,V5,V6
+       VMRGEW  V4,V5,V6
+
 //     Vector count, VX-form
 //     <MNEMONIC> VRB,VRT produces
 //     <mnemonic> VRT,VRB
index c637d54a50ceb69a3da2c609f1b7e71488ae9852..c51e6e3fdb34ac5adca8c6253c68435a078f0b81 100644 (file)
@@ -929,6 +929,8 @@ const (
        AVSHASIGMA
        AVSHASIGMAW
        AVSHASIGMAD
+       AVMRGEW
+       AVMRGOW
 
        /* VSX */
        ALXV
index 5a459ee1cee5c19c22ef92464fc46353c73f0d85..cea590531139aeadfe2abc2305c90603ffacb822 100644 (file)
@@ -519,6 +519,8 @@ var Anames = []string{
        "VSHASIGMA",
        "VSHASIGMAW",
        "VSHASIGMAD",
+       "VMRGEW",
+       "VMRGOW",
        "LXV",
        "LXVD2X",
        "LXVDSX",
index a7ac0ff0c0d6b8761f0e52699fded676f2d046ab..ff0e984555892756d600208549ac3caa81ece504 100644 (file)
@@ -449,6 +449,9 @@ var optab = []Optab{
        {AVCMPGT, C_VREG, C_VREG, C_NONE, C_VREG, 82, 4, 0},   /* vector compare greater than, vc-form */
        {AVCMPNEZB, C_VREG, C_VREG, C_NONE, C_VREG, 82, 4, 0}, /* vector compare not equal, vx-form */
 
+       /* Vector merge */
+       {AVMRGOW, C_VREG, C_VREG, C_NONE, C_VREG, 82, 4, 0}, /* vector merge odd word, vx-form */
+
        /* Vector permute */
        {AVPERM, C_VREG, C_VREG, C_VREG, C_VREG, 83, 4, 0}, /* vector permute, va-form */
 
@@ -1354,6 +1357,9 @@ func buildop(ctxt *obj.Link) {
                        opset(AVANDC, r0)
                        opset(AVNAND, r0)
 
+               case AVMRGOW: /* vmrgew, vmrgow */
+                       opset(AVMRGEW, r0)
+
                case AVOR: /* vor, vorc, vxor, vnor, veqv */
                        opset(AVOR, r0)
                        opset(AVORC, r0)
@@ -4406,6 +4412,11 @@ func (c *ctxt9) oprrr(a obj.As) uint32 {
        case AVRLD:
                return OPVX(4, 196, 0, 0) /* vrld - v2.07 */
 
+       case AVMRGOW:
+               return OPVX(4, 1676, 0, 0) /* vmrgow - v2.07 */
+       case AVMRGEW:
+               return OPVX(4, 1932, 0, 0) /* vmrgew - v2.07 */
+
        case AVSLB:
                return OPVX(4, 260, 0, 0) /* vslh - v2.03 */
        case AVSLH: