Nice. We're getting into minutia now, but I feel a small SwizzleComponent
enum with cases x
, y
, z
, etc. is nicer than a large Swizzle
enum whose cases are the combinations of all orderings (e.g. .xxyy
).
SwizzleComponent
has a much smaller surface area and is more composable. I think it's harder to pattern match on "concatenated" .xxyy
cases.
A related idea is to use OptionSet
? That would enable grouping of related swizzles. Need to think more about it.
I think we should continue further discussion of swizzles on the SIMD proposal thread. Folks there may have more ideas.