[go] cmd/internal/obj/loong64: add {,X}VSHUF.{H/W/V} instructions support

7 views
Skip to first unread message

abner chenc (Gerrit)

unread,
Oct 31, 2025, 6:22:06 AM (11 days ago) Oct 31
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

abner chenc has uploaded the change for review

Commit message

cmd/internal/obj/loong64: add {,X}VSHUF.{H/W/V} instructions support

Go asm syntax:
VSHUF{H/W/V} V1, V2, V3
XVSHUF{H/W/V} X1, X2, X3

Equivalent platform assembler syntax:
vshuf.{h/w/d} v3, v1, v2
xvshuf.{h/w/d} x3, x1, x2
Change-Id: I8983467495f587cf46083fd81cb024400c7dc2a7

Change diff

diff --git a/src/cmd/asm/internal/asm/testdata/loong64enc1.s b/src/cmd/asm/internal/asm/testdata/loong64enc1.s
index b440a64..f8105d6 100644
--- a/src/cmd/asm/internal/asm/testdata/loong64enc1.s
+++ b/src/cmd/asm/internal/asm/testdata/loong64enc1.s
@@ -1023,6 +1023,14 @@
XVSHUF4IV $8, X1, X2 // 22209c77
XVSHUF4IV $15, X1, X2 // 223c9c77

+ // [X]VSHUF.{H/W/V} instructions
+ VSHUFH V1, V2, V3 // 43847a71
+ VSHUFW V1, V2, V3 // 43047b71
+ VSHUFV V1, V2, V3 // 43847b71
+ XVSHUFH X1, X2, X3 // 43847a75
+ XVSHUFW X1, X2, X3 // 43047b75
+ XVSHUFV X1, X2, X3 // 43847b75
+
// VPERMIW, XVPERMI{W,V,Q} instructions
VPERMIW $0x1B, V1, V2 // VPERMIW $27, V1, V2 // 226ce473
XVPERMIW $0x2B, X1, X2 // XVPERMIW $43, X1, X2 // 22ace477
diff --git a/src/cmd/internal/obj/loong64/a.out.go b/src/cmd/internal/obj/loong64/a.out.go
index 48e60b6..d19809b 100644
--- a/src/cmd/internal/obj/loong64/a.out.go
+++ b/src/cmd/internal/obj/loong64/a.out.go
@@ -1115,6 +1115,13 @@
AXVSHUF4IW
AXVSHUF4IV

+ AVSHUFH
+ AVSHUFW
+ AVSHUFV
+ AXVSHUFH
+ AXVSHUFW
+ AXVSHUFV
+
AVPERMIW
AXVPERMIW
AXVPERMIV
diff --git a/src/cmd/internal/obj/loong64/anames.go b/src/cmd/internal/obj/loong64/anames.go
index 9580674..5a32c2c 100644
--- a/src/cmd/internal/obj/loong64/anames.go
+++ b/src/cmd/internal/obj/loong64/anames.go
@@ -586,6 +586,12 @@
"XVSHUF4IH",
"XVSHUF4IW",
"XVSHUF4IV",
+ "VSHUFH",
+ "VSHUFW",
+ "VSHUFV",
+ "XVSHUFH",
+ "XVSHUFW",
+ "XVSHUFV",
"VPERMIW",
"XVPERMIW",
"XVPERMIV",
diff --git a/src/cmd/internal/obj/loong64/asm.go b/src/cmd/internal/obj/loong64/asm.go
index 8bf8a1d..00f90c0 100644
--- a/src/cmd/internal/obj/loong64/asm.go
+++ b/src/cmd/internal/obj/loong64/asm.go
@@ -1698,6 +1698,9 @@
opset(AVMULD, r0)
opset(AVDIVF, r0)
opset(AVDIVD, r0)
+ opset(AVSHUFH, r0)
+ opset(AVSHUFW, r0)
+ opset(AVSHUFV, r0)

case AXVSEQB:
opset(AXVSEQH, r0)
@@ -1771,6 +1774,9 @@
opset(AXVMULD, r0)
opset(AXVDIVF, r0)
opset(AXVDIVD, r0)
+ opset(AXVSHUFH, r0)
+ opset(AXVSHUFW, r0)
+ opset(AXVSHUFV, r0)

case AVANDB:
opset(AVORB, r0)
@@ -3775,6 +3781,18 @@
return 0xea22 << 15 // xvbitrev.w
case AXVBITREVV:
return 0xea23 << 15 // xvbitrev.d
+ case AVSHUFH:
+ return 0x0E2F5 << 15 // vshuf.h
+ case AVSHUFW:
+ return 0x0E2F6 << 15 // vshuf.w
+ case AVSHUFV:
+ return 0x0E2F7 << 15 // vshuf.d
+ case AXVSHUFH:
+ return 0x0EAF5 << 15 // xvshuf.h
+ case AXVSHUFW:
+ return 0x0EAF6 << 15 // xvshuf.w
+ case AXVSHUFV:
+ return 0x0EAF7 << 15 // xvshuf.d
}

if a < 0 {

Change information

Files:
  • M src/cmd/asm/internal/asm/testdata/loong64enc1.s
  • M src/cmd/internal/obj/loong64/a.out.go
  • M src/cmd/internal/obj/loong64/anames.go
  • M src/cmd/internal/obj/loong64/asm.go
Change size: S
Delta: 4 files changed, 39 insertions(+), 0 deletions(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I8983467495f587cf46083fd81cb024400c7dc2a7
Gerrit-Change-Number: 716804
Gerrit-PatchSet: 1
Gerrit-Owner: abner chenc <chen...@loongson.cn>
unsatisfied_requirement
satisfied_requirement
open
diffy

abner chenc (Gerrit)

unread,
Nov 3, 2025, 9:58:48 PM (7 days ago) Nov 3
to goph...@pubsubhelper.golang.org, sophie zhao, Meidan Li, Cherry Mui, Gopher Robot, golang-co...@googlegroups.com
Attention needed from Cherry Mui, Meidan Li and sophie zhao

abner chenc voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Cherry Mui
  • Meidan Li
  • sophie zhao
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I8983467495f587cf46083fd81cb024400c7dc2a7
Gerrit-Change-Number: 716804
Gerrit-PatchSet: 2
Gerrit-Owner: abner chenc <chen...@loongson.cn>
Gerrit-Reviewer: Cherry Mui <cher...@google.com>
Gerrit-Reviewer: Meidan Li <lime...@loongson.cn>
Gerrit-Reviewer: abner chenc <chen...@loongson.cn>
Gerrit-Reviewer: sophie zhao <zhaox...@loongson.cn>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-Attention: Cherry Mui <cher...@google.com>
Gerrit-Attention: sophie zhao <zhaox...@loongson.cn>
Gerrit-Attention: Meidan Li <lime...@loongson.cn>
Gerrit-Comment-Date: Tue, 04 Nov 2025 02:58:41 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Meidan Li (Gerrit)

unread,
Nov 3, 2025, 10:26:38 PM (7 days ago) Nov 3
to abner chenc, goph...@pubsubhelper.golang.org, Go LUCI, sophie zhao, Cherry Mui, Gopher Robot, golang-co...@googlegroups.com
Attention needed from Cherry Mui, abner chenc and sophie zhao

Meidan Li voted Code-Review+2

Code-Review+2
Open in Gerrit

Related details

Attention is currently required from:
  • Cherry Mui
  • abner chenc
  • sophie zhao
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I8983467495f587cf46083fd81cb024400c7dc2a7
Gerrit-Change-Number: 716804
Gerrit-PatchSet: 2
Gerrit-Owner: abner chenc <chen...@loongson.cn>
Gerrit-Reviewer: Cherry Mui <cher...@google.com>
Gerrit-Reviewer: Meidan Li <lime...@loongson.cn>
Gerrit-Reviewer: abner chenc <chen...@loongson.cn>
Gerrit-Reviewer: sophie zhao <zhaox...@loongson.cn>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-Attention: abner chenc <chen...@loongson.cn>
Gerrit-Attention: Cherry Mui <cher...@google.com>
Gerrit-Attention: sophie zhao <zhaox...@loongson.cn>
Gerrit-Comment-Date: Tue, 04 Nov 2025 03:26:30 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

sophie zhao (Gerrit)

unread,
Nov 4, 2025, 1:28:18 AM (7 days ago) Nov 4
to abner chenc, goph...@pubsubhelper.golang.org, Meidan Li, Go LUCI, Cherry Mui, Gopher Robot, golang-co...@googlegroups.com
Attention needed from Cherry Mui and abner chenc

sophie zhao added 2 comments

Commit Message
Line 14, Patchset 2 (Latest): vshuf.{h/w/d} v3, v1, v2
sophie zhao . unresolved

The register order is wrong.

Line 15, Patchset 2 (Latest): xvshuf.{h/w/d} x3, x1, x2
sophie zhao . unresolved

ditto

Open in Gerrit

Related details

Attention is currently required from:
  • Cherry Mui
  • abner chenc
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I8983467495f587cf46083fd81cb024400c7dc2a7
Gerrit-Change-Number: 716804
Gerrit-PatchSet: 2
Gerrit-Owner: abner chenc <chen...@loongson.cn>
Gerrit-Reviewer: Cherry Mui <cher...@google.com>
Gerrit-Reviewer: Meidan Li <lime...@loongson.cn>
Gerrit-Reviewer: abner chenc <chen...@loongson.cn>
Gerrit-Reviewer: sophie zhao <zhaox...@loongson.cn>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-Attention: abner chenc <chen...@loongson.cn>
Gerrit-Attention: Cherry Mui <cher...@google.com>
Gerrit-Comment-Date: Tue, 04 Nov 2025 06:28:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

abner chenc (Gerrit)

unread,
Nov 4, 2025, 3:23:48 AM (7 days ago) Nov 4
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
Attention needed from Cherry Mui and abner chenc

abner chenc uploaded new patchset

abner chenc uploaded patch set #3 to this change.
Following approvals got outdated and were removed:
  • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit

Related details

Attention is currently required from:
  • Cherry Mui
  • abner chenc
Submit Requirements:
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: newpatchset
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I8983467495f587cf46083fd81cb024400c7dc2a7
    Gerrit-Change-Number: 716804
    Gerrit-PatchSet: 3
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    abner chenc (Gerrit)

    unread,
    Nov 4, 2025, 3:24:19 AM (7 days ago) Nov 4
    to goph...@pubsubhelper.golang.org, Meidan Li, Go LUCI, sophie zhao, Cherry Mui, Gopher Robot, golang-co...@googlegroups.com
    Attention needed from Cherry Mui and sophie zhao

    abner chenc voted and added 2 comments

    Votes added by abner chenc

    Commit-Queue+1

    2 comments

    Commit Message
    Line 14, Patchset 2: vshuf.{h/w/d} v3, v1, v2
    sophie zhao . resolved

    The register order is wrong.

    abner chenc

    Acknowledged

    Line 15, Patchset 2: xvshuf.{h/w/d} x3, x1, x2
    sophie zhao . resolved

    ditto

    abner chenc

    Acknowledged

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cherry Mui
    • sophie zhao
    Submit Requirements:
    • requirement satisfiedCode-Review
    • requirement satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I8983467495f587cf46083fd81cb024400c7dc2a7
    Gerrit-Change-Number: 716804
    Gerrit-PatchSet: 3
    Gerrit-Owner: abner chenc <chen...@loongson.cn>
    Gerrit-Reviewer: Cherry Mui <cher...@google.com>
    Gerrit-Reviewer: Meidan Li <lime...@loongson.cn>
    Gerrit-Reviewer: abner chenc <chen...@loongson.cn>
    Gerrit-Reviewer: sophie zhao <zhaox...@loongson.cn>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-Attention: Cherry Mui <cher...@google.com>
    Gerrit-Attention: sophie zhao <zhaox...@loongson.cn>
    Gerrit-Comment-Date: Tue, 04 Nov 2025 08:24:12 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: sophie zhao <zhaox...@loongson.cn>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    sophie zhao (Gerrit)

    unread,
    Nov 4, 2025, 4:16:31 AM (7 days ago) Nov 4
    to abner chenc, goph...@pubsubhelper.golang.org, Go LUCI, Meidan Li, Cherry Mui, Gopher Robot, golang-co...@googlegroups.com
    Attention needed from Cherry Mui and abner chenc

    sophie zhao voted Code-Review+1

    Code-Review+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Cherry Mui
    • abner chenc
    Submit Requirements:
      • requirement satisfiedCode-Review
      • requirement satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I8983467495f587cf46083fd81cb024400c7dc2a7
      Gerrit-Change-Number: 716804
      Gerrit-PatchSet: 3
      Gerrit-Owner: abner chenc <chen...@loongson.cn>
      Gerrit-Reviewer: Cherry Mui <cher...@google.com>
      Gerrit-Reviewer: Meidan Li <lime...@loongson.cn>
      Gerrit-Reviewer: abner chenc <chen...@loongson.cn>
      Gerrit-Reviewer: sophie zhao <zhaox...@loongson.cn>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-Attention: abner chenc <chen...@loongson.cn>
      Gerrit-Attention: Cherry Mui <cher...@google.com>
      Gerrit-Comment-Date: Tue, 04 Nov 2025 09:16:23 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Michael Knyszek (Gerrit)

      unread,
      Nov 4, 2025, 4:01:32 PM (7 days ago) Nov 4
      to abner chenc, goph...@pubsubhelper.golang.org, sophie zhao, Go LUCI, Meidan Li, Cherry Mui, Gopher Robot, golang-co...@googlegroups.com
      Attention needed from Cherry Mui and abner chenc

      Michael Knyszek voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Cherry Mui
      • abner chenc
      Submit Requirements:
      • requirement satisfiedCode-Review
      • requirement satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I8983467495f587cf46083fd81cb024400c7dc2a7
      Gerrit-Change-Number: 716804
      Gerrit-PatchSet: 3
      Gerrit-Owner: abner chenc <chen...@loongson.cn>
      Gerrit-Reviewer: Cherry Mui <cher...@google.com>
      Gerrit-Reviewer: Meidan Li <lime...@loongson.cn>
      Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
      Gerrit-Reviewer: abner chenc <chen...@loongson.cn>
      Gerrit-Reviewer: sophie zhao <zhaox...@loongson.cn>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-Attention: abner chenc <chen...@loongson.cn>
      Gerrit-Attention: Cherry Mui <cher...@google.com>
      Gerrit-Comment-Date: Tue, 04 Nov 2025 21:01:29 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Michael Pratt (Gerrit)

      unread,
      Nov 4, 2025, 4:58:22 PM (7 days ago) Nov 4
      to abner chenc, goph...@pubsubhelper.golang.org, Michael Pratt, sophie zhao, Go LUCI, Meidan Li, Cherry Mui, Gopher Robot, golang-co...@googlegroups.com
      Attention needed from Cherry Mui and abner chenc

      Michael Pratt voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Cherry Mui
      • abner chenc
      Submit Requirements:
        • requirement satisfiedCode-Review
        • requirement satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        • requirement satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: I8983467495f587cf46083fd81cb024400c7dc2a7
        Gerrit-Change-Number: 716804
        Gerrit-PatchSet: 3
        Gerrit-Owner: abner chenc <chen...@loongson.cn>
        Gerrit-Reviewer: Cherry Mui <cher...@google.com>
        Gerrit-Reviewer: Meidan Li <lime...@loongson.cn>
        Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
        Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
        Gerrit-Reviewer: abner chenc <chen...@loongson.cn>
        Gerrit-Reviewer: sophie zhao <zhaox...@loongson.cn>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-Attention: abner chenc <chen...@loongson.cn>
        Gerrit-Attention: Cherry Mui <cher...@google.com>
        Gerrit-Comment-Date: Tue, 04 Nov 2025 21:58:19 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        abner chenc (Gerrit)

        unread,
        Nov 5, 2025, 7:43:29 PM (6 days ago) Nov 5
        to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Michael Pratt, Michael Knyszek, sophie zhao, Go LUCI, Meidan Li, Cherry Mui, Gopher Robot, golang-co...@googlegroups.com

        abner chenc submitted the change with unreviewed changes

        Unreviewed changes

        2 is the latest approved patch-set.
        The change was submitted with unreviewed changes in the following files:

        ```
        The name of the file: src/cmd/internal/obj/loong64/anames.go
        Insertions: 2, Deletions: 0.

        @@ -586,9 +586,11 @@

        "XVSHUF4IH",
        "XVSHUF4IW",
        "XVSHUF4IV",
        +	"VSHUFB",
        "VSHUFH",
        "VSHUFW",
        "VSHUFV",
        + "XVSHUFB",
        "XVSHUFH",
        "XVSHUFW",
        "XVSHUFV",
        ```
        ```
        The name of the file: src/cmd/internal/obj/loong64/a.out.go
        Insertions: 2, Deletions: 0.

        @@ -1115,9 +1115,11 @@
        AXVSHUF4IW
        AXVSHUF4IV

        + AVSHUFB
        AVSHUFH
        AVSHUFW
        AVSHUFV
        + AXVSHUFB
        AXVSHUFH
        AXVSHUFW
        AXVSHUFV
        ```
        ```
        The name of the file: src/cmd/asm/internal/asm/testdata/loong64enc1.s
        Insertions: 3, Deletions: 1.

        @@ -1023,13 +1023,15 @@

        XVSHUF4IV $8, X1, X2 // 22209c77
        XVSHUF4IV $15, X1, X2 // 223c9c77

        -	// [X]VSHUF.{H/W/V} instructions
        + // [X]VSHUF.{B/H/W/V} instructions

        VSHUFH V1, V2, V3 // 43847a71
         	VSHUFW		V1, V2, V3	// 43047b71
         	VSHUFV		V1, V2, V3	// 43847b71
         	XVSHUFH		X1, X2, X3	// 43847a75
         	XVSHUFW		X1, X2, X3	// 43047b75
         	XVSHUFV		X1, X2, X3	// 43847b75
        +	VSHUFB		V1, V2, V3, V4	// 6488500d
        + XVSHUFB X1, X2, X3, X4 // 6488600d


        // VPERMIW, XVPERMI{W,V,Q} instructions
        VPERMIW $0x1B, V1, V2 // VPERMIW $27, V1, V2 // 226ce473
        ```
        ```
        The name of the file: src/cmd/internal/obj/loong64/asm.go
        Insertions: 8, Deletions: 0.

        @@ -155,6 +155,8 @@

        {AFMADDF, C_FREG, C_FREG, C_NONE, C_FREG, C_NONE, 37, 4, 0, 0},
        {AFMADDF, C_FREG, C_FREG, C_FREG, C_FREG, C_NONE, 37, 4, 0, 0},
        + {AVSHUFB, C_VREG, C_VREG, C_VREG, C_VREG, C_NONE, 37, 4, 0, 0},
        + {AXVSHUFB, C_XREG, C_XREG, C_XREG, C_XREG, C_NONE, 37, 4, 0, 0},

        {AFSEL, C_FCCREG, C_FREG, C_FREG, C_FREG, C_NONE, 33, 4, 0, 0},
        {AFSEL, C_FCCREG, C_FREG, C_NONE, C_FREG, C_NONE, 33, 4, 0, 0},
        @@ -1561,6 +1563,8 @@
        AMOVWU,
        AVMOVQ,
        AXVMOVQ,
        + AVSHUFB,
        + AXVSHUFB,
        ANEGW,
        ANEGV,
        AWORD,
        @@ -3105,6 +3109,10 @@
        return 0x8d << 20 // fnmsub.s
        case AFNMSUBD:
        return 0x8e << 20 // fnmsub.d
        + case AVSHUFB:
        + return 0x0D5 << 20 // vshuf.b
        + case AXVSHUFB:
        + return 0x0D6 << 20 // xvshuf.b
        }

        c.ctxt.Diag("bad rrrr opcode %v", a)
        ```

        Change information

        Commit message:
        cmd/internal/obj/loong64: add {,X}VSHUF.{B/H/W/V} instructions support

        Go asm syntax:
        VSHUFB V1, V2, V3, V4
        XVSHUFB X1, X2, X3, X4

        VSHUF{H/W/V} V1, V2, V3
        XVSHUF{H/W/V} X1, X2, X3

        Equivalent platform assembler syntax:
                 vshuf.b            v4, v3, v2, v1
        xvshuf.b x4, x3, x2, x1
        vshuf.{h/w/d} v3, v2, v1
        xvshuf.{h/w/d} x3, x2, x1
        Change-Id: I8983467495f587cf46083fd81cb024400c7dc2a7
        Reviewed-by: Meidan Li <lime...@loongson.cn>
        Reviewed-by: Michael Knyszek <mkny...@google.com>
        Reviewed-by: Michael Pratt <mpr...@google.com>
        Reviewed-by: sophie zhao <zhaox...@loongson.cn>
        Files:
        • M src/cmd/asm/internal/asm/testdata/loong64enc1.s
        • M src/cmd/internal/obj/loong64/a.out.go
        • M src/cmd/internal/obj/loong64/anames.go
        • M src/cmd/internal/obj/loong64/asm.go
        Change size: M
        Delta: 4 files changed, 53 insertions(+), 0 deletions(-)
        Branch: refs/heads/master
        Submit Requirements:
        • requirement satisfiedCode-Review: +1 by sophie zhao, +1 by Michael Pratt, +1 by Michael Knyszek, +2 by Meidan Li
        • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
        Open in Gerrit
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: merged
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: I8983467495f587cf46083fd81cb024400c7dc2a7
        Gerrit-Change-Number: 716804
        Gerrit-PatchSet: 4
        open
        diffy
        satisfied_requirement
        Reply all
        Reply to author
        Forward
        0 new messages