• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › Development Discussion v
« Previous 1 ... 42 43 44 45 46 ... 116 Next »

Probably a stupid question: AOT compilation?
View New Posts | View Today's Posts

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
Probably a stupid question: AOT compilation?
03-29-2014, 03:41 AM
#1
yourgamesbeover
Unregistered
 
I'm in school right now for comp sci, and I find the whole dolphin project fascinating (and would love to work on it once I get a better understanding). I was doing some research into compilation techniques and it got me thinking: Dolphin uses a standard JIT recompiler, like most emulators. Would it be possible to create a AOT compiler instead? basically have Dolphin "do its thang" on the entire game at once, converting all its code into native x86 code and storing that on disk so that it doesn't have to be done on-the-fly? I know the JIT compiler caches some code during runtime, couldn't that cache be expanded to hold the entire game and then be saved? In my research, I also saw some of the performance boosts that JIT can bring as compared to AOT, so would Dolphin even benefit?

Sorry it this question is stupid, or if I'm missing some big concept somewhere. I'm just really curious about Dolphin and how it works, and why it is in the sate it currently is.

thanks!
keep up the awesome work, devs!
Reply
03-29-2014, 04:06 AM
#2
AnyOldName3 Offline
First Random post over 9000
*******
Posts: 3,519
Threads: 1
Joined: Feb 2012
There's a possibility of code being self-modifying and parts of memory being used to hold two or more things. Static recompilation tends to screw this up or take longer than it would for a person to disassemble the software and rewrite it in C.
OS: Windows 10 64 bit Professional
CPU: AMD Ryzen 5900X
RAM: 16GB
GPU: Radeon Vega 56
Find
Reply
03-29-2014, 04:14 AM (This post was last modified: 03-29-2014, 04:14 AM by delroth.)
#3
delroth Offline
Making the world a better place through reverse engineered DSP firmwares
**********
Developers (Some Administrators and Super Moderators)
Posts: 1,354
Threads: 63
Joined: Aug 2011
That's not even "a possibility". For example, EA games are packed and decompressed at runtime. Rogue Squadron games page code in/out of memory. Some games load executable code from disc at runtime. Etc. AOT is useful for toy emulators that only emulate a few homebrew demos, but as soon as you want to emulate real software, making assumptions usually goes very bad.
Pierre "delroth" Bourdon - @delroth_ - Blog

<@neobrain> that looks sophisticated enough to not be a totally dumb thing to do
Website Find
Reply
05-11-2014, 08:36 AM
#4
galop1n Offline
Member
***
Posts: 70
Threads: 1
Joined: May 2014
Delroth answered the question already but for growing knowledge, AOT would be possible for PS3 and X360 for example as Microsoft have restrict the system to forbid dynamic code for security reasons.
Find
Reply
05-12-2014, 05:58 AM
#5
NaturalViolence Offline
It's not that I hate people, I just hate stupid people
*******
Posts: 9,013
Threads: 24
Joined: Oct 2009
I recall one of the devs stating that compilation in dolphin uses only a few percent of the CPU emulators cycles and that AoT compilation would therefore provide barely any speedup even if it were possible. Any truth to this delroth?
"Normally if given a choice between doing something and nothing, I’d choose to do nothing. But I would do something if it helps someone else do nothing. I’d work all night if it meant nothing got done."  
-Ron Swanson

"I shall be a good politician, even if it kills me. Or if it kills anyone else for that matter. "
-Mark Antony
Website Find
Reply
05-12-2014, 06:10 AM
#6
delroth Offline
Making the world a better place through reverse engineered DSP firmwares
**********
Developers (Some Administrators and Super Moderators)
Posts: 1,354
Threads: 63
Joined: Aug 2011
AOT compilation allows you to do a ton more optimizations that are way too expensive to do at runtime. AOT also implies that you have a complete view of the program you're going to run (otherwise you wouldn't be able to do AOT), and that's also a big bonus when doing recompilation.
Pierre "delroth" Bourdon - @delroth_ - Blog

<@neobrain> that looks sophisticated enough to not be a totally dumb thing to do
Website Find
Reply
05-12-2014, 11:29 AM (This post was last modified: 05-12-2014, 11:34 AM by Kodiack.)
#7
Kodiack Offline
Member
***
Posts: 139
Threads: 5
Joined: Jan 2011
This doesn't really add much at all to the discussion at hand (not that there's much left to be discussed), but for people that aren't familiar with different types of code interpretation/compilation, Ars Technica just put up a relevant article that may be worth the read. JIT compilation and AOT compilation are unsurprisingly both discussed. The article also explains why JIT compilation isn't necessarily worse off than AOT compilation, namely when it comes to utilising more modern instruction set extensions.
Website Find
Reply
05-15-2014, 10:19 PM
#8
lamedude Offline
Senior Member
****
Posts: 360
Threads: 7
Joined: Jan 2011
Some success on the NES. You could probably finish ReactOS before you got it working anything exponentially more complicated.
Website Find
Reply
05-16-2014, 03:18 AM
#9
delroth Offline
Making the world a better place through reverse engineered DSP firmwares
**********
Developers (Some Administrators and Super Moderators)
Posts: 1,354
Threads: 63
Joined: Aug 2011
That's not a success. As expected, if you read the conclusion:

Quote:After completing this project, I believe that static recompilation does not have a practical application for video game emulation. It is thwarted by the inability to completely disassemble a game without executing it as well as the fact that multiple systems are executing in parallel, possibly causing interrupts in the game code.
Pierre "delroth" Bourdon - @delroth_ - Blog

<@neobrain> that looks sophisticated enough to not be a totally dumb thing to do
Website Find
Reply
05-19-2014, 09:58 PM
#10
lamedude Offline
Senior Member
****
Posts: 360
Threads: 7
Joined: Jan 2011
Got Zelda to boot and SMB running. I guess progress would've been a better word, but I wanted the rhyme.
Website Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode