Surely you could have compiler types for 128, 256, 512, etc, and then choose the correct codepath with simple if statement at runtime?