internal/simdgen: add Expand

This CL generates CL 693375.

Change-Id: Id7e71a68e9997cbec767cd3addbf152710f4c1f8
Reviewed-on: https://go-review.googlesource.com/c/arch/+/693336
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
diff --git a/internal/simdgen/ops/Moves/categories.yaml b/internal/simdgen/ops/Moves/categories.yaml
index d56e4c9..6f30ccb 100644
--- a/internal/simdgen/ops/Moves/categories.yaml
+++ b/internal/simdgen/ops/Moves/categories.yaml
@@ -60,3 +60,9 @@
   documentation: !string |-
     // NAME blends two vectors based on mask values, choosing either
     // the first or the second based on whether the third is false or true
+- go: Expand
+  commutative: false
+  extension: "AVX.*"
+  documentation: !string |-
+    // NAME performs an expansion on a vector x whose elements are packed to lower parts.
+    // The expansion is to distribute elements as indexed by mask, from lower mask elements to upper in order.
diff --git a/internal/simdgen/ops/Moves/go.yaml b/internal/simdgen/ops/Moves/go.yaml
index b014a7a..50e2869 100644
--- a/internal/simdgen/ops/Moves/go.yaml
+++ b/internal/simdgen/ops/Moves/go.yaml
@@ -250,3 +250,11 @@
   out:
   - *v
 
+- go: Expand
+  asm: "VPEXPAND[BWDQ]|VEXPANDP[SD]"
+  in:
+    # The mask in Expand is a control mask rather than a write mask, so it's not optional.
+  - class: mask
+  - *any
+  out:
+  - *any
diff --git a/internal/simdgen/xed.go b/internal/simdgen/xed.go
index 6a3feb3..f773fcd 100644
--- a/internal/simdgen/xed.go
+++ b/internal/simdgen/xed.go
@@ -89,7 +89,7 @@
 }
 
 var (
-	maskRequiredRe = regexp.MustCompile(`VPCOMPRESS[BWDQ]|VCOMPRESSP[SD]`)
+	maskRequiredRe = regexp.MustCompile(`VPCOMPRESS[BWDQ]|VCOMPRESSP[SD]|VPEXPAND[BWDQ]|VEXPANDP[SD]`)
 	maskOptionalRe = regexp.MustCompile(`VPCMP(EQ|GT|U)?[BWDQ]|VCMPP[SD]`)
 )