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:
// <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
......
......@@ -929,6 +929,8 @@ const (
AVSHASIGMA
AVSHASIGMAW
AVSHASIGMAD
AVMRGEW
AVMRGOW
/* VSX */
ALXV
......
......@@ -519,6 +519,8 @@ var Anames = []string{
"VSHASIGMA",
"VSHASIGMAW",
"VSHASIGMAD",
"VMRGEW",
"VMRGOW",
"LXV",
"LXVD2X",
"LXVDSX",
......
......@@ -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:
......
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