]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal/obj/loong64: add MASKEQZ and MASKNEZ instructions support
authorWayne Zuo <wdvxdr@golangcn.org>
Sat, 9 Jul 2022 03:28:50 +0000 (11:28 +0800)
committerKeith Randall <khr@golang.org>
Tue, 23 Aug 2022 23:17:55 +0000 (23:17 +0000)
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>
src/cmd/asm/internal/asm/testdata/loong64enc1.s
src/cmd/internal/obj/loong64/a.out.go
src/cmd/internal/obj/loong64/anames.go
src/cmd/internal/obj/loong64/asm.go

index 56eb244f6f4d4acd386eec369ca9a4d680e058b4..320046609ab0950188b04773d9c11610f37c032a 100644 (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
index 951eeb757ebc0fb40e02acfd95d45dad338ab3c6..f57d16758fc1aa0c3dc319bb77abd934544d0eaa 100644 (file)
@@ -351,6 +351,9 @@ const (
 
        AXOR
 
+       AMASKEQZ
+       AMASKNEZ
+
        // 64-bit
        AMOVV
        AMOVVL
index 48d8a78828ed58d148ebd5a39ccce530cc8025bb..c1dcb5bab4ff82dd3bc47faa615e4ec8bec14fb1 100644 (file)
@@ -99,6 +99,8 @@ var Anames = []string{
        "TNE",
        "WORD",
        "XOR",
+       "MASKEQZ",
+       "MASKNEZ",
        "MOVV",
        "MOVVL",
        "MOVVR",
index c5829adc7d1280de5228dee8a803e0bfbd07e07a..7b46f3cb6d310fe8aa5e9338b4a2d85e37ccb37d 100644 (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: