1
0
mirror of https://github.com/golang/go synced 2024-11-26 18:06:55 -07:00

cmd/internal/obj/loong64: add MASKEQZ and MASKNEZ instructions support

Change-Id: Ied16c3be47c863a94d46bd568191057ded4b7d0a
Reviewed-on: https://go-review.googlesource.com/c/go/+/416734
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Wayne Zuo <wdvxdr@golangcn.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: xiaodong liu <teaofmoli@gmail.com>
This commit is contained in:
Wayne Zuo 2022-07-09 11:28:50 +08:00 committed by Keith Randall
parent aa4299735b
commit 1dcef7b3bd
4 changed files with 16 additions and 0 deletions

View File

@ -180,6 +180,9 @@ lable2:
SRLV $32, R4, R5 // 85804500
SRLV $32, R4 // 84804500
MASKEQZ R4, R5, R6 // a6101300
MASKNEZ R4, R5, R6 // a6901300
MOVFD F4, F5 // 85241901
MOVDF F4, F5 // 85181901
MOVWF F4, F5 // 85101d01

View File

@ -351,6 +351,9 @@ const (
AXOR
AMASKEQZ
AMASKNEZ
// 64-bit
AMOVV
AMOVVL

View File

@ -99,6 +99,8 @@ var Anames = []string{
"TNE",
"WORD",
"XOR",
"MASKEQZ",
"MASKNEZ",
"MOVV",
"MOVVL",
"MOVVR",

View File

@ -68,6 +68,7 @@ var optab = []Optab{
{AAND, C_REG, C_NONE, C_REG, 2, 4, 0, 0, 0},
{ANEGW, C_REG, C_NONE, C_REG, 2, 4, 0, 0, 0},
{ANEGV, C_REG, C_NONE, C_REG, 2, 4, 0, sys.Loong64, 0},
{AMASKEQZ, C_REG, C_REG, C_REG, 2, 4, 0, 0, 0},
{ASLL, C_REG, C_NONE, C_REG, 9, 4, 0, 0, 0},
{ASLL, C_REG, C_REG, C_REG, 9, 4, 0, 0, 0},
@ -1041,6 +1042,9 @@ func buildop(ctxt *obj.Link) {
case ATEQ:
opset(ATNE, r0)
case AMASKEQZ:
opset(AMASKNEZ, r0)
}
}
}
@ -1627,6 +1631,10 @@ func (c *ctxt0) oprrr(a obj.As) uint32 {
return 0x24 << 15 // SLT
case ASGTU:
return 0x25 << 15 // SLTU
case AMASKEQZ:
return 0x26 << 15
case AMASKNEZ:
return 0x27 << 15
case AAND:
return 0x29 << 15
case AOR: