I haven't explored it too deeply myself, but from what I understand, a jump table is only generated if there are a large number of branches (over 50). If it's just a handful of branches, it simply subtracts values from the input corresponding to the differences between the case labels, and jumping to the next subtraction if there's a mismatch, or to the else block if it goes negative. I'm not sure what it does for strings though.
Gareth aka. Kit
On Mon 13/08/18 16:20 , Marco Borsari via fpc-devel sent:
Hello,
I would need a clarification about the way the case statement is translated into assembler by FPC. When the list of alternatives is continous, does the compiler generate a jump table? And if yes, there is some conditions for which a fall-through is performed anyway? Thank you, Marco Borsari
