Skip to content

Commit c62099c

Browse files
sophie-zhaoabner-chenc
authored andcommitted
cmd/intarnal/obj: add new assembly format for VANDV and VANDB on loong64
In order to make it easier to write in assembly and to be consistent with the usage of general instructions, a new assembly format is added for the instructions VANDV and VANDB. It also works for instructions XVAND{V,B}, [X]V{OR,XOR,NOR,ANDN,ORN}V and [X]V{OR,XOR,NOR}B. Change-Id: Ia75d607ac918950e58840ec627aaf0be45d837fe Reviewed-on: https://go-review.googlesource.com/c/go/+/671316 Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
1 parent a1c3e2f commit c62099c

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/cmd/asm/internal/asm/testdata/loong64enc1.s

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,12 +547,22 @@ lable2:
547547
VNORV V1, V2, V3 // 43842771
548548
VANDNV V1, V2, V3 // 43042871
549549
VORNV V1, V2, V3 // 43842871
550+
VANDV V1, V2 // 42042671
551+
VORV V1, V2 // 42842671
552+
VXORV V1, V2 // 42042771
553+
VNORV V1, V2 // 42842771
554+
VANDNV V1, V2 // 42042871
555+
VORNV V1, V2 // 42842871
550556

551557
// VANDB,VORB,VXORB,VNORB
552558
VANDB $0, V2, V3 // 4300d073
553559
VORB $64, V2, V3 // 4300d573
554560
VXORB $128, V2, V3 // 4300da73
555561
VNORB $255, V2, V3 // 43fcdf73
562+
VANDB $0, V2 // 4200d073
563+
VORB $64, V2 // 4200d573
564+
VXORB $128, V2 // 4200da73
565+
VNORB $255, V2 // 42fcdf73
556566

557567
// XVANDV,XVORV,XVXORV,XVNORV,XVANDNV,XVORNV
558568
XVANDV X1, X2, X3 // 43042675
@@ -561,12 +571,22 @@ lable2:
561571
XVNORV X1, X2, X3 // 43842775
562572
XVANDNV X1, X2, X3 // 43042875
563573
XVORNV X1, X2, X3 // 43842875
574+
XVANDV X1, X2 // 42042675
575+
XVORV X1, X2 // 42842675
576+
XVXORV X1, X2 // 42042775
577+
XVNORV X1, X2 // 42842775
578+
XVANDNV X1, X2 // 42042875
579+
XVORNV X1, X2 // 42842875
564580

565581
// XVANDB,XVORB,XVXORB,XVNORB
566582
XVANDB $0, X2, X3 // 4300d077
567583
XVORB $1, X2, X3 // 4304d477
568584
XVXORB $127, X2, X3 // 43fcd977
569585
XVNORB $255, X2, X3 // 43fcdf77
586+
XVANDB $0, X2 // 4200d077
587+
XVORB $1, X2 // 4204d477
588+
XVXORB $127, X2 // 42fcd977
589+
XVNORB $255, X2 // 42fcdf77
570590

571591
// MOVV C_DCON12_0, r
572592
MOVV $0x7a90000000000000, R4 // MOVV $8831558869273542656, R4 // 04a41e03

src/cmd/internal/obj/loong64/asm.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,13 @@ var optab = []Optab{
9292
{AVSEQB, C_S5CON, C_VREG, C_NONE, C_VREG, C_NONE, 22, 4, 0, 0},
9393
{AXVSEQB, C_S5CON, C_XREG, C_NONE, C_XREG, C_NONE, 22, 4, 0, 0},
9494
{AVANDV, C_VREG, C_VREG, C_NONE, C_VREG, C_NONE, 2, 4, 0, 0},
95+
{AVANDV, C_VREG, C_NONE, C_NONE, C_VREG, C_NONE, 2, 4, 0, 0},
9596
{AXVANDV, C_XREG, C_XREG, C_NONE, C_XREG, C_NONE, 2, 4, 0, 0},
97+
{AXVANDV, C_XREG, C_NONE, C_NONE, C_XREG, C_NONE, 2, 4, 0, 0},
9698
{AVANDB, C_U8CON, C_VREG, C_NONE, C_VREG, C_NONE, 23, 4, 0, 0},
99+
{AVANDB, C_U8CON, C_NONE, C_NONE, C_VREG, C_NONE, 23, 4, 0, 0},
97100
{AXVANDB, C_U8CON, C_XREG, C_NONE, C_XREG, C_NONE, 23, 4, 0, 0},
101+
{AXVANDB, C_U8CON, C_NONE, C_NONE, C_XREG, C_NONE, 23, 4, 0, 0},
98102

99103
{AVADDB, C_VREG, C_VREG, C_NONE, C_VREG, C_NONE, 2, 4, 0, 0},
100104
{AVADDB, C_VREG, C_NONE, C_NONE, C_VREG, C_NONE, 2, 4, 0, 0},

0 commit comments

Comments
 (0)