<HTML>
<div>Hi everyone.</div><div><br>
</div><div>This is just a follow-up on https://bugs.freepascal.org/view.php?id=34762, since the issue has been marked as resolved now.<br>
<br>
The apparent regression doesn't seem to exist. Both the trunk (before it was updated) and the patch produce a linear list for the test in question - e.g.:<br>
<br>
.section .text.n_p$casebranchtest$_$tsparsedataequal2_$__$$_dotestiteration$longint,"x"<br>
.balign 16,0x90<br>
.globl P$CASEBRANCHTEST$_$TSPARSEDATAEQUAL2_$__$$_DOTESTITERATION$LONGINT<br>
P$CASEBRANCHTEST$_$TSPARSEDATAEQUAL2_$__$$_DOTESTITERATION$LONGINT:<br>
.Lc188:<br>
andl $1023,%edx<br>
movswl %dx,%eax<br>
subl $512,%eax<br>
movswl %dx,%edx<br>
cmpl $-509,%eax<br>
je .Lj501<br>
cmpl $-353,%eax<br>
je .Lj535<br>
cmpl $-329,%eax<br>
je .Lj502<br>
....<br>
<br>
The only difference are the label numbers. You are right though Florian - in this instance, a jump table should not be used because the domain is massive at 1,024, while only 39 of those values go to branches. If a jump table were used, it would be 4 KB in size, and 985 of the 1,024 entries would point to the else block. I'm not sure why you got such a huge time difference.<br>
<br>
I'd like to keep these tests around though because those "Domain is 1,024" tests are rather extreme cases that could be fun to find optimisations for (if any exist).<br>
<br>
Gareth aka. Kit<br>
</div></HTML>