cmd/asm: add support for loong64 CRC32 instructions

This patch is a copy of CL 478595.
Co-authored-by: WANG Xuerui <git@xen0n.name>

Change-Id: Ifb6e8183c83a5dfe5dec84e173a74d5de62692a0
Reviewed-on: https://go-review.googlesource.com/c/go/+/623875
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Xiaolin Zhao 2024-10-31 15:11:05 +08:00 committed by abner chenc
parent 3f694f73d0
commit 7240c6cb97
4 changed files with 52 additions and 1 deletions

View file

@ -1234,6 +1234,14 @@ func buildop(ctxt *obj.Link) {
case AMASKEQZ:
opset(AMASKNEZ, r0)
opset(ACRCWBW, r0)
opset(ACRCWHW, r0)
opset(ACRCWWW, r0)
opset(ACRCWVW, r0)
opset(ACRCCWBW, r0)
opset(ACRCCWHW, r0)
opset(ACRCCWWW, r0)
opset(ACRCCWVW, r0)
case ANOOP:
opset(obj.AUNDEF, r0)
@ -1949,7 +1957,22 @@ func (c *ctxt0) oprrr(a obj.As) uint32 {
return 0x45 << 15 // mod.d
case AREMVU:
return 0x47 << 15 // mod.du
case ACRCWBW:
return 0x48 << 15 // crc.w.b.w
case ACRCWHW:
return 0x49 << 15 // crc.w.h.w
case ACRCWWW:
return 0x4a << 15 // crc.w.w.w
case ACRCWVW:
return 0x4b << 15 // crc.w.d.w
case ACRCCWBW:
return 0x4c << 15 // crcc.w.b.w
case ACRCCWHW:
return 0x4d << 15 // crcc.w.h.w
case ACRCCWWW:
return 0x4e << 15 // crcc.w.w.w
case ACRCCWVW:
return 0x4f << 15 // crcc.w.d.w
case AJMP:
return 0x13 << 26 // jirl r0, rj, 0
case AJAL: