diff --git a/src/cmd/asm/internal/asm/testdata/loong64enc1.s b/src/cmd/asm/internal/asm/testdata/loong64enc1.s
index 56eb244f6f4d4acd386eec369ca9a4d680e058b4..320046609ab0950188b04773d9c11610f37c032a 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 951eeb757ebc0fb40e02acfd95d45dad338ab3c6..f57d16758fc1aa0c3dc319bb77abd934544d0eaa 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 48d8a78828ed58d148ebd5a39ccce530cc8025bb..c1dcb5bab4ff82dd3bc47faa615e4ec8bec14fb1 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 c5829adc7d1280de5228dee8a803e0bfbd07e07a..7b46f3cb6d310fe8aa5e9338b4a2d85e37ccb37d 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: