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

@ -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: