Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/cmd/asm/internal/asm/testdata/loong64enc1.s
Original file line number Diff line number Diff line change
Expand Up @@ -1422,6 +1422,14 @@ lable2:
XVBITREVW $31, X2, X1 // 41fc1877
XVBITREVV $63, X2, X1 // 41fc1977

// [X]{VBITSELV} instructions
VBITSELV V1, V2, V3, V4 // 6488100d
XVBITSELV X1, X2, X3, X4 // 6488200d

// [X]{VBITSELB} instructions
VBITSELB $255, V2, V1 // 41fcc773
XVBITSELB $0, X2, X1 // 4100c477

// ALSL{W/WU/D}
ALSLW $4, R4, R5, R6 // 86940500
ALSLWU $4, R4, R5, R6 // 86940700
Expand Down
4 changes: 4 additions & 0 deletions src/cmd/internal/obj/loong64/anames.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions src/cmd/internal/obj/loong64/asm.go
Original file line number Diff line number Diff line change
Expand Up @@ -1507,15 +1507,19 @@ func buildop(ctxt *obj.Link) {
case AMOVF:
opset(AMOVD, r0)

case AVSHUFB:
opset(AVBITSELV, r0)

case AXVSHUFB:
opset(AXVBITSELV, r0)

case AMOVW,
AMOVV,
ARFE,
AJAL,
AJMP,
AVMOVQ,
AXVMOVQ,
AVSHUFB,
AXVSHUFB,
AWORD,
APRELD,
APRELDX,
Expand Down Expand Up @@ -1636,6 +1640,7 @@ func buildop(ctxt *obj.Link) {
opset(AVEXTRINSH, r0)
opset(AVEXTRINSW, r0)
opset(AVEXTRINSV, r0)
opset(AVBITSELB, r0)

// xvandi.b xd, xj, ui8
case AXVANDB:
Expand All @@ -1653,6 +1658,7 @@ func buildop(ctxt *obj.Link) {
opset(AXVEXTRINSH, r0)
opset(AXVEXTRINSW, r0)
opset(AXVEXTRINSV, r0)
opset(AXVBITSELB, r0)

// vadd.b vd, vj, vk
case AVADDB:
Expand Down
5 changes: 5 additions & 0 deletions src/cmd/internal/obj/loong64/inst.go
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,11 @@ const (
AXVSETALLNEW
AXVSETALLNEV

AVBITSELV
AXVBITSELV
AVBITSELB
AXVBITSELB

ALAST

// aliases
Expand Down
24 changes: 14 additions & 10 deletions src/cmd/internal/obj/loong64/instOp.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@ import (
)

var oprrrr = map[obj.As]uint32{
AFMADDF: 0x81 << 20, // fmadd.s
AFMADDD: 0x82 << 20, // fmadd.d
AFMSUBF: 0x85 << 20, // fmsub.s
AFMSUBD: 0x86 << 20, // fmsub.d
AFNMADDF: 0x89 << 20, // fnmadd.f
AFNMADDD: 0x8a << 20, // fnmadd.d
AFNMSUBF: 0x8d << 20, // fnmsub.s
AFNMSUBD: 0x8e << 20, // fnmsub.d
AVSHUFB: 0x0d5 << 20, // vshuf.b
AXVSHUFB: 0x0d6 << 20, // xvshuf.b
AFMADDF: 0x81 << 20, // fmadd.s
AFMADDD: 0x82 << 20, // fmadd.d
AFMSUBF: 0x85 << 20, // fmsub.s
AFMSUBD: 0x86 << 20, // fmsub.d
AFNMADDF: 0x89 << 20, // fnmadd.f
AFNMADDD: 0x8a << 20, // fnmadd.d
AFNMSUBF: 0x8d << 20, // fnmsub.s
AFNMSUBD: 0x8e << 20, // fnmsub.d
AVSHUFB: 0xd5 << 20, // vshuf.b
AXVSHUFB: 0xd6 << 20, // xvshuf.b
AVBITSELV: 0xd1 << 20, // vbitsel.v
AXVBITSELV: 0xd2 << 20, // xvbitsel.v
}

var oprrr = map[obj.As]uint32{
Expand Down Expand Up @@ -906,6 +908,8 @@ var opirr = map[obj.As]uint32{
AXVBITREVH: 0x1dc6<<18 | 0x1<<14, // xvbitrevi.h
AXVBITREVW: 0x1dc6<<18 | 0x1<<15, // xvbitrevi.w
AXVBITREVV: 0x1dc6<<18 | 0x1<<16, // xvbitrevi.d
AVBITSELB: 0x1cf1 << 18, // vbitseli.b
AXVBITSELB: 0x1df1 << 18, // xvbitseli.b
}

var opirrr = map[obj.As]uint32{
Expand Down
Loading