Commit 4c15fdb3 authored by Carlos Eduardo Seo's avatar Carlos Eduardo Seo Committed by Brad Fitzpatrick

cmd/internal/obj/ppc64: add vector multiply instructions

This change adds vector multiply instructions to the assembler for
ppc64x.

Change-Id: I5143a2dc3736951344d43999066d38ab8be4a721
Reviewed-on: https://go-review.googlesource.com/107795Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 1473789b
......@@ -814,6 +814,23 @@ label1:
VADDEUQM V4, V3, V2, V1
VADDECUQ V4, V3, V2, V1
// Vector multiply, VX-form
// <MNEMONIC> VRA,VRB,VRT produces
// <mnemonic> VRT,VRA,VRB
VMULESB V2, V3, V1
VMULOSB V2, V3, V1
VMULEUB V2, V3, V1
VMULOUB V2, V3, V1
VMULESH V2, V3, V1
VMULOSH V2, V3, V1
VMULEUH V2, V3, V1
VMULOUH V2, V3, V1
VMULESW V2, V3, V1
VMULOSW V2, V3, V1
VMULEUW V2, V3, V1
VMULOUW V2, V3, V1
VMULUWM V2, V3, V1
// Vector polynomial multiply-sum, VX-form
// <MNEMONIC> VRA,VRB,VRT produces
// <mnemonic> VRT,VRA,VRB
......
......@@ -817,6 +817,19 @@ const (
AVSUBE
AVSUBEUQM
AVSUBECUQ
AVMULESB
AVMULOSB
AVMULEUB
AVMULOUB
AVMULESH
AVMULOSH
AVMULEUH
AVMULOUH
AVMULESW
AVMULOSW
AVMULEUW
AVMULOUW
AVMULUWM
AVPMSUM
AVPMSUMB
AVPMSUMH
......
......@@ -409,6 +409,19 @@ var Anames = []string{
"VSUBE",
"VSUBEUQM",
"VSUBECUQ",
"VMULESB",
"VMULOSB",
"VMULEUB",
"VMULOUB",
"VMULESH",
"VMULOSH",
"VMULEUH",
"VMULOUH",
"VMULESW",
"VMULOSW",
"VMULEUW",
"VMULOUW",
"VMULUWM",
"VPMSUM",
"VPMSUMB",
"VPMSUMH",
......
......@@ -423,6 +423,7 @@ var optab = []Optab{
{AVSUBE, C_VREG, C_VREG, C_VREG, C_VREG, 83, 4, 0}, /* vector subtract extended, va-form */
/* Vector multiply */
{AVMULESB, C_VREG, C_VREG, C_NONE, C_VREG, 82, 4, 9}, /* vector multiply, vx-form */
{AVPMSUM, C_VREG, C_VREG, C_NONE, C_VREG, 82, 4, 0}, /* vector polynomial multiply & sum, vx-form */
{AVMSUMUDM, C_VREG, C_VREG, C_VREG, C_VREG, 83, 4, 0}, /* vector multiply-sum, va-form */
......@@ -1344,6 +1345,19 @@ func buildop(ctxt *obj.Link) {
opset(AVSUBEUQM, r0)
opset(AVSUBECUQ, r0)
case AVMULESB: /* vmulesb, vmulosb, vmuleub, vmuloub, vmulosh, vmulouh, vmulesw, vmulosw, vmuleuw, vmulouw, vmuluwm */
opset(AVMULOSB, r0)
opset(AVMULEUB, r0)
opset(AVMULOUB, r0)
opset(AVMULESH, r0)
opset(AVMULOSH, r0)
opset(AVMULEUH, r0)
opset(AVMULOUH, r0)
opset(AVMULESW, r0)
opset(AVMULOSW, r0)
opset(AVMULEUW, r0)
opset(AVMULOUW, r0)
opset(AVMULUWM, r0)
case AVPMSUM: /* vpmsumb, vpmsumh, vpmsumw, vpmsumd */
opset(AVPMSUMB, r0)
opset(AVPMSUMH, r0)
......@@ -4182,6 +4196,33 @@ func (c *ctxt9) oprrr(a obj.As) uint32 {
case AVADDECUQ:
return OPVX(4, 61, 0, 0) /* vaddecuq - v2.07 */
case AVMULESB:
return OPVX(4, 776, 0, 0) /* vmulesb - v2.03 */
case AVMULOSB:
return OPVX(4, 264, 0, 0) /* vmulosb - v2.03 */
case AVMULEUB:
return OPVX(4, 520, 0, 0) /* vmuleub - v2.03 */
case AVMULOUB:
return OPVX(4, 8, 0, 0) /* vmuloub - v2.03 */
case AVMULESH:
return OPVX(4, 840, 0, 0) /* vmulesh - v2.03 */
case AVMULOSH:
return OPVX(4, 328, 0, 0) /* vmulosh - v2.03 */
case AVMULEUH:
return OPVX(4, 584, 0, 0) /* vmuleuh - v2.03 */
case AVMULOUH:
return OPVX(4, 72, 0, 0) /* vmulouh - v2.03 */
case AVMULESW:
return OPVX(4, 904, 0, 0) /* vmulesw - v2.07 */
case AVMULOSW:
return OPVX(4, 392, 0, 0) /* vmulosw - v2.07 */
case AVMULEUW:
return OPVX(4, 648, 0, 0) /* vmuleuw - v2.07 */
case AVMULOUW:
return OPVX(4, 136, 0, 0) /* vmulouw - v2.07 */
case AVMULUWM:
return OPVX(4, 137, 0, 0) /* vmuluwm - v2.07 */
case AVPMSUMB:
return OPVX(4, 1032, 0, 0) /* vpmsumb - v2.07 */
case AVPMSUMH:
......
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