Commit 8f79ca1d authored by Lynn Boger's avatar Lynn Boger

cmd/internal/obj/ppc64: add support for vmrgow,vmrgew

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: default avatarCarlos Eduardo Seo <cseo@linux.vnet.ibm.com>
parent d56a86e0
...@@ -900,6 +900,13 @@ label1: ...@@ -900,6 +900,13 @@ label1:
// <mnemonic> VRT,VRA,VRB,SHB // <mnemonic> VRT,VRA,VRB,SHB
VSLDOI $4, V2, V1, V0 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 // Vector count, VX-form
// <MNEMONIC> VRB,VRT produces // <MNEMONIC> VRB,VRT produces
// <mnemonic> VRT,VRB // <mnemonic> VRT,VRB
......
...@@ -929,6 +929,8 @@ const ( ...@@ -929,6 +929,8 @@ const (
AVSHASIGMA AVSHASIGMA
AVSHASIGMAW AVSHASIGMAW
AVSHASIGMAD AVSHASIGMAD
AVMRGEW
AVMRGOW
/* VSX */ /* VSX */
ALXV ALXV
......
...@@ -519,6 +519,8 @@ var Anames = []string{ ...@@ -519,6 +519,8 @@ var Anames = []string{
"VSHASIGMA", "VSHASIGMA",
"VSHASIGMAW", "VSHASIGMAW",
"VSHASIGMAD", "VSHASIGMAD",
"VMRGEW",
"VMRGOW",
"LXV", "LXV",
"LXVD2X", "LXVD2X",
"LXVDSX", "LXVDSX",
......
...@@ -449,6 +449,9 @@ var optab = []Optab{ ...@@ -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 */ {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 */ {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 */ /* Vector permute */
{AVPERM, C_VREG, C_VREG, C_VREG, C_VREG, 83, 4, 0}, /* vector permute, va-form */ {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) { ...@@ -1354,6 +1357,9 @@ func buildop(ctxt *obj.Link) {
opset(AVANDC, r0) opset(AVANDC, r0)
opset(AVNAND, r0) opset(AVNAND, r0)
case AVMRGOW: /* vmrgew, vmrgow */
opset(AVMRGEW, r0)
case AVOR: /* vor, vorc, vxor, vnor, veqv */ case AVOR: /* vor, vorc, vxor, vnor, veqv */
opset(AVOR, r0) opset(AVOR, r0)
opset(AVORC, r0) opset(AVORC, r0)
...@@ -4406,6 +4412,11 @@ func (c *ctxt9) oprrr(a obj.As) uint32 { ...@@ -4406,6 +4412,11 @@ func (c *ctxt9) oprrr(a obj.As) uint32 {
case AVRLD: case AVRLD:
return OPVX(4, 196, 0, 0) /* vrld - v2.07 */ 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: case AVSLB:
return OPVX(4, 260, 0, 0) /* vslh - v2.03 */ return OPVX(4, 260, 0, 0) /* vslh - v2.03 */
case AVSLH: case AVSLH:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment