To view parent comment, click here.
To read all comments associated with this story, please click here.
viton,
"It is safe to assume that code in question is already optimized."
It's optimized for x86, not necessarily for ARM.
"So it should be enough to just move ARM instructions (according to target CPU issue possibilities) up to nearest branch entry point. Modern OoO ARMs will do the rest for you."
If the instruction sets were 1:1 then the translation would be trivial. But the trouble is that x86 flags & registers are very unique to that architecture. Also ARM has conditional instructions, the optimal code path could be very dissimilar to x86's which needs alot more jumps. Even different processors in the x86 family can have different optimal code paths.
Maybe a direct translation is good enough for some applications, but it would be like compiling a binary with no optimization for the target processor.
It hardly does matter for quick and dirty Jit translator.
Translation overhead is worse than small inefficiencies in code.
That is not exposed to C or any language above asm.
Check some executables. Usually only basic flags are used.
Do not confuse modern OoO ARMs with old in-order ones.
Conditional execution is actually bad for OoO engine, as it is adding unwanted dependency between instructions. I heard some rumors that cortex-A9 replaces CE with branches internally.
You don't get it. Nobody cares about such a small inefficiencies.
And It has already been done. There is an app that does static binary translation of Windows games for Android. (Winulator)





Member since:
2005-08-09
It is safe to assume that code in question is already optimized.
So it should be enough to just move ARM instructions (according to target CPU issue possibilities) up to nearest branch entry point.
Modern OoO ARMs will do the rest for you.