But did you use the address of every single return or did you assume they all had the same delta?
I can't find the quote you're talking about but I'll be surprised if it extends to assuming memory locations. If any pointer has to support touching any variable, even ones you never took the address of, that ruins so many basic and sensible optimizations.
Unless I'm misunderstanding, a normal computed goto would have an array of all the destinations. And hopefully it would compile to a delta multiply. But if you need to force it... maybe a compile time check that all the labels are delta bytes apart would let you do that math? I don't know, it's not part of the actual standard, it might be janky.
Did a plain old switch statement compile into something you didn't like?
I can't find the quote you're talking about but I'll be surprised if it extends to assuming memory locations. If any pointer has to support touching any variable, even ones you never took the address of, that ruins so many basic and sensible optimizations.
Unless I'm misunderstanding, a normal computed goto would have an array of all the destinations. And hopefully it would compile to a delta multiply. But if you need to force it... maybe a compile time check that all the labels are delta bytes apart would let you do that math? I don't know, it's not part of the actual standard, it might be janky.
Did a plain old switch statement compile into something you didn't like?