Thorium
Still Fresh
- Joined
- Nov 17, 2010
- Messages
- 81
Intel advices against using it. Maybe i just dont know the advanced concepts for it. But classicly you would use it inside a loop to change the actual loop, or i am wrong with that?It's not hard to think of situations where self-modifying code would be a huge win performance-wise, especially on a cache coherent platform like x86. But you do probably see less and less of it these days because it's pretty taboo.
If thats it than you screw around with the loop optimizer. Current gen Intel CPU's recognise loops and try to optimize them by translating the instructions into mirco ops and do some optimizations with them, like reordering them for maximum parallel execution. In Intels Optimization Reference Manual they actualy advise to not use unrolling on loops because the automatic optimizer will do it better. I did some tests with my Core i7 system and in some cases unrolling realy does not improve performance, but i had many cases it still did improve. I didnt hat a case in that reordering of instructions to break dependencys had any impact on performance. The Core i7 does a realy great job there.
Back to the problem: I am pretty sure the optimizer cant handle self modifieing code. I didnt do any tests for that but i guess it will detect it and just disable the optimization. Which could result in a big performance lose.
Well, looks like i should go with dynamic recompilation. I dont have a optimization in mind thats only possible on SR. My main concern about DR was the time optimizations need and the overhead they add to the performance. But it seems thats not as big of a issue as i thought, after i read what all you experienced people wrote.Like I said, it's not really a problem for dynamic recompilation. But if your ideas work for static recompilation, I would like to know more about them.
And i thought it would save me some work. As the decoding of the x86 instructions looks complicated and actualy very tedious to implement because you have so many opcodes for one and the same instruction just for different registers and addressings.
On the other hand ARM encoding looks very well structured and fairly easy.
With SR i wouldnt need to care about if the decoder is fast it would be just a ASM text parser, very easy to implement.
I am still on the protyping so i play more around than do serious work. Looks like i switch to DR for the final implementation.
Sounds like your 2 games that are running are fallout 1 and 2? That would be so awesome. I must say: I enjoy all you recompiled games a lot. Seems we have a similar taste for games.For instance Fallout. Here it's used in playing ingame videos (video decoding to be precise).
Eliminating self-modifying code is possible, I did it in Albion, but in Fallout it's much more complicated. Eliminating it might not be feasible.
Will your 2 new games come for the Wiz too? I dont think i will get my Pandora this year and dont have money for a upgrade.
Thanks for the advise. Can you tell me what exactly is the problem with multithreading. Isnt the Linux on the Pandora multithreading capable? I thought it's a full fledged Linux.I didn't give it a lot of thought initially in my project and later it turned out to be more complicated than I thought and adding support for it in the current project would be a lot of work.
Last edited by a moderator: