1
0
mirror of https://github.com/golang/go synced 2024-11-17 04:14:52 -07:00

cmd/internal/obj/arm64: add TRN1 and TRN2 instructions support

Add test cases.

Fixes #51628

Change-Id: I433367d87e6bb5da5579c4be540079b92701c1fa
Reviewed-on: https://go-review.googlesource.com/c/go/+/392294
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Trust: Fannie Zhang <Fannie.Zhang@arm.com>
This commit is contained in:
fanzha02 2022-03-14 02:40:25 +00:00 committed by Fannie Zhang
parent 44a0da4ff1
commit 49f16625c8
4 changed files with 16 additions and 0 deletions

View File

@ -241,6 +241,10 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
FADDS F2, F3, F4 // 6428221e
FADDD F1, F2 // 4228611e
VDUP V19.S[0], V17.S4 // 7106044e
VTRN1 V3.D2, V2.D2, V20.D2 // 5428c34e
VTRN2 V3.D2, V2.D2, V21.D2 // 5568c34e
VTRN1 V5.D2, V4.D2, V22.D2 // 9628c54e
VTRN2 V5.D2, V4.D2, V23.D2 // 9768c54e
// special

View File

@ -1053,6 +1053,8 @@ const (
AVUADDW2
AVUADDW
AVUSRA
AVTRN1
AVTRN2
ALAST
AB = obj.AJMP
ABL = obj.ACALL

View File

@ -537,5 +537,7 @@ var Anames = []string{
"VUADDW2",
"VUADDW",
"VUSRA",
"VTRN1",
"VTRN2",
"LAST",
}

View File

@ -2985,6 +2985,8 @@ func buildop(ctxt *obj.Link) {
case AVZIP1:
oprangeset(AVZIP2, t)
oprangeset(AVTRN1, t)
oprangeset(AVTRN2, t)
case AVUXTL:
oprangeset(AVUXTL2, t)
@ -6179,6 +6181,12 @@ func (c *ctxt7) oprrr(p *obj.Prog, a obj.As) uint32 {
case AVUADDW, AVUADDW2:
return 0x17<<25 | 1<<21 | 1<<12
case AVTRN1:
return 7<<25 | 5<<11
case AVTRN2:
return 7<<25 | 1<<14 | 5<<11
}
c.ctxt.Diag("%v: bad rrr %d %v", p, a, a)