Most of this patch is by Jacques Lucke, from the simulation branch. This commit adds generic expression evaluation for bit spans, helping to generalize the optimizations that avoid processing a single bit at a time. Operations like "for each 1 index", "or", and "and" are already implemented in this pull request. Bits in full integers are processed 64 at a time, then remaining bits are processed all at once. The operations allow implementing a `copy_from` method for bit spans. Currently this optimized evaluation is only implemented for simpler bounded bit spans. Bounded bit spans have constraints on their bit ranges that make them more efficient to process. Large spans must start at the beginning of the first int, and small spans must start and end within the first int. Knowing these constraints at compile time reduces the number of edge cases in the operations, but mainly allows skipping alignment between multiple spans with different offsets. Pull Request: blender/blender#107408