Linked-list freeing need not all happen in one go. There can be a queue of free-but-not-zeroed, push RC=0 stuff there instead of recurring on referents, anyone doing memory allocation work can pop a few items off that queue and decrement the counts of their referents, etc.
That loses timeliness, adds problem of queue management.
A weird trick I stumbled across years ago is to not strictly pop from the head of the stack/queue -- instead choose randomly from the last N elements of push end of the stack. This seemed to blunt the sort of growth that you get from "visiting wrong". I never did figure out the theory of why this worked.
All the methods tagged as "zero-cost" compile to movd or less. The earlier version of archsimd (1.26, for amd64) supported these as direct "AsFooNxM" methods, and there were a lot of them. I am not 100% satisfied with either approach, but don't have a better idea and we must settle on something.
Two of the "conversion" methods between int and uint vectors compiled to movd or less (but the convert from int to float32 vector does not) and are actually identical to corresponding zero-cost reshapes.
Conversion between int vectors and masks may be zero-cost; it depends on the platform (zero cost on Wasm, NEON, AVX, AVX2; change in representation on AVX512 and SVE).
There's also pattern-based optimization going on in the backend of the compiler, so if (on AVX512 or SVE) you do some operation followed by an IfElse, odds are pretty good the two "methods" will compile down to a single instruction. We did this API factoring so that we could support (many) fewer methods, and it also increases the similarity between different platforms.
Binary size only scales for the simd-touching platforms, with scaling depending on platform. Each platform gets emulation+number-of-variants. Emulation is there as an option, primarily for testing (do you trust us? I don't trust us). So wasm is 2x, amd64 is 4x, arm64 is currently 2x but should be 4x in the near future. ppc64 ought to be 2x, maybe 3x, don't know their variants story. Loong64 will be 3x. But only the SIMD-touching stuff is replicated, and N-1 copies of the replicated code are never executed by a given program execution.
SVE and RVV, because they are "scalable", may end up with a larger amount of replication.
Go uses fixed-size stack frames, so spill space is fixed size, etc. We could "just" fix this limitation, or we could generate multiple sizes for what actually exists in the wild, with a masked implementation for longer. So, SVE would end up with 0 (emulation), 128, 256, and 512-masked, plus (as arm64) would also have NEON and NEON-noclmul (Raspberry Pi). I'm not sure what sizes exist for RVV.
That loses timeliness, adds problem of queue management.
A weird trick I stumbled across years ago is to not strictly pop from the head of the stack/queue -- instead choose randomly from the last N elements of push end of the stack. This seemed to blunt the sort of growth that you get from "visiting wrong". I never did figure out the theory of why this worked.