"""List of special Go suffixes."""

go_suffixes = [
    "_386",
    "_386_unsafe",
    "_aarch64",
    "_aarch64_unsafe",
    "_amd64",
    "_amd64_unsafe",
    "_arm",
    "_arm64",
    "_arm64_unsafe",
    "_arm_unsafe",
    "_impl",
    "_impl_unsafe",
    "_linux",
    "_linux_unsafe",
    "_mips",
    "_mips64",
    "_mips64_unsafe",
    "_mips64le",
    "_mips64le_unsafe",
    "_mips_unsafe",
    "_mipsle",
    "_mipsle_unsafe",
    "_opts",
    "_opts_unsafe",
    "_ppc64",
    "_ppc64_unsafe",
    "_ppc64le",
    "_ppc64le_unsafe",
    "_riscv64",
    "_riscv64_unsafe",
    "_s390x",
    "_s390x_unsafe",
    "_sparc64",
    "_sparc64_unsafe",
    "_wasm",
    "_wasm_unsafe",
]

@@ -33,19 +33,36 @@
 %22%22%0A%0A
-go_
+def explode(tagset, 
 suffixes
  = %5B
@@ -61,262 +61,444 @@
 ixes
- = %5B
+):
 %0A    %22
-_386%22,%0A    %22_386_unsafe%22,%0A    %22_aarch64%22,%0A    %22_aarch64_unsafe%22,%0A    %22_amd64%22,%0A    %22_amd64_unsafe%22,%0A    %22_arm%22,%0A    %22_arm64%22,%0A    %22_arm64_unsafe%22,%0A    %22_arm_unsafe%22,%0A    %22_impl%22,%0A    %22_impl_unsafe%22,%0A    %22_linux%22,%0A    %22_linux_unsafe%22,
+%22%22explode combines tagset and suffixes in all ways.%0A%0A    Args:%0A      tagset: Original suffixes.%0A      suffixes: Suffixes to combine before and after.%0A%0A    Returns:%0A      The set of possible combinations.%0A    %22%22%22%0A    result = %5Bt for t in tagset%5D%0A    result += %5Bs for s in suffixes%5D%0A    for t in tagset:%0A        result += %5Bt + s for s in suffixes%5D%0A        result += %5Bs + t for s in suffixes%5D%0A    return result%0A%0Aarchs = %5B
 %0A    %22_
-mips
+386
 %22,%0A 
@@ -502,20 +502,21 @@
 ,%0A    %22_
-mips
+aarch
 64%22,%0A   
@@ -522,21 +522,25 @@
   %22_
-mips64_unsafe
+amd64%22,%0A    %22_arm
 %22,%0A 
@@ -544,24 +544,21 @@
 ,%0A    %22_
-mips64le
+arm64
 %22,%0A    %22
@@ -562,27 +562,16 @@
   %22_mips
-64le_unsafe
 %22,%0A    %22
@@ -575,23 +575,18 @@
   %22_mips
-_unsafe
+64
 %22,%0A    %22
@@ -590,16 +590,18 @@
   %22_mips
+64
 le%22,%0A   
@@ -609,23 +609,16 @@
 %22_mipsle
-_unsafe
 %22,%0A    %22
@@ -618,20 +618,21 @@
 ,%0A    %22_
-opts
+ppc64
 %22,%0A    %22
@@ -636,18 +636,14 @@
   %22_
-opts_unsaf
+ppc64l
 e%22,%0A
@@ -640,35 +640,37 @@
 ppc64le%22,%0A    %22_
-ppc
+riscv
 64%22,%0A    %22_ppc64
@@ -668,20 +668,13 @@
   %22_
-ppc64_unsafe
+s390x
 %22,%0A 
@@ -670,39 +670,39 @@
 %22_s390x%22,%0A    %22_
-pp
+spar
 c64
-le
 %22,%0A    %22_ppc64le
@@ -698,60 +698,77 @@
   %22_
-ppc64le_unsafe%22,%0A    %22_riscv64%22,%0A    %22_riscv64_unsaf
+x86%22,%0A%5D%0A%0Aoses = %5B%0A    %22_linux%22,%0A%5D%0A%0Ageneric = %5B%0A    %22_impl%22,%0A    %22_rac
 e%22,%0A
@@ -765,37 +765,38 @@
  %22_race%22,%0A    %22_
-s390x
+norace
 %22,%0A    %22_s390x_u
@@ -792,14 +792,8 @@
   %22_
-s390x_
 unsa
@@ -807,72 +807,399 @@
   %22_
-sparc64%22,%0A    %22_sparc64_unsafe%22,%0A    %22_wasm%22,%0A    %22_wasm_unsafe%22,%0A%5D
+opts%22,%0A%5D%0A%0A# State explosion? Sure. This is approximately:%0A#   len(archs) * (1 + 2 * len(oses) * (1 + 2 * len(generic))%0A#%0A# This evaluates to 495 at the time of writing. So it's a lot of different%0A# combinations, but not so much that it will cause issues. We can probably add%0A# quite a few more variants before this becomes a genuine problem.%0Ago_suffixes = explode(explode(archs, oses), generic)
 %0A

Fix tags used for determining file sets.