From: Wayne Zuo Date: Sat, 9 Jul 2022 03:28:50 +0000 (+0800) Subject: cmd/internal/obj/loong64: add MASKEQZ and MASKNEZ instructions support X-Git-Tag: go1.20rc1~1437 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=1dcef7b3bdcea4a829ea22c821e6a9484c325d61;p=gostls13.git 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 Run-TryBot: Wayne Zuo Reviewed-by: David Chase Reviewed-by: Ian Lance Taylor Reviewed-by: xiaodong liu --- diff --git a/src/cmd/asm/internal/asm/testdata/loong64enc1.s b/src/cmd/asm/internal/asm/testdata/loong64enc1.s index 56eb244f6f..320046609a 100644 --- a/src/cmd/asm/internal/asm/testdata/loong64enc1.s +++ b/src/cmd/asm/internal/asm/testdata/loong64enc1.s @@ -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 diff --git a/src/cmd/internal/obj/loong64/a.out.go b/src/cmd/internal/obj/loong64/a.out.go index 951eeb757e..f57d16758f 100644 --- a/src/cmd/internal/obj/loong64/a.out.go +++ b/src/cmd/internal/obj/loong64/a.out.go @@ -351,6 +351,9 @@ const ( AXOR + AMASKEQZ + AMASKNEZ + // 64-bit AMOVV AMOVVL diff --git a/src/cmd/internal/obj/loong64/anames.go b/src/cmd/internal/obj/loong64/anames.go index 48d8a78828..c1dcb5bab4 100644 --- a/src/cmd/internal/obj/loong64/anames.go +++ b/src/cmd/internal/obj/loong64/anames.go @@ -99,6 +99,8 @@ var Anames = []string{ "TNE", "WORD", "XOR", + "MASKEQZ", + "MASKNEZ", "MOVV", "MOVVL", "MOVVR", diff --git a/src/cmd/internal/obj/loong64/asm.go b/src/cmd/internal/obj/loong64/asm.go index c5829adc7d..7b46f3cb6d 100644 --- a/src/cmd/internal/obj/loong64/asm.go +++ b/src/cmd/internal/obj/loong64/asm.go @@ -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: