Hi,
I have been dealing with optimizing a part of main interpreter loop lately and I have come to the conclusion that the switch operator is not handled too well with eVc and ARM code.
On the PC the same piece of code gives me a great speed boost but on the PPC it's slower.
I am thinking of changing this code to something like this, I don't know if this is feasible in C.
Or is there any other way of doing this in a fast way on ARM.
I have been dealing with optimizing a part of main interpreter loop lately and I have come to the conclusion that the switch operator is not handled too well with eVc and ARM code.
On the PC the same piece of code gives me a great speed boost but on the PPC it's slower.
- Code:
while (!endproc)
{
switch (bc->code)
{
case 1: // pushint
{
Push(bc->i);
bc = bc->next;
continue;
}
case 2: // pushstr
{
}
...
}
}
I am thinking of changing this code to something like this, I don't know if this is feasible in C.
- Code:
while (!endproc)
{
if (!Addr[1])
{
Addr[1] = &C;_1;
Addr[2] = &C;_2;
...
}
goto Addr[bc->code];
C_1: // pushint
Push(bc->i);
bc = bc->next;
continue;
C_2: // pushstr
...
}
Or is there any other way of doing this in a fast way on ARM.