This project is dedicated to the memory of William Morris (aka Frags), who was the main contributor to the bounty but was unable to see the final result.

Monday, November 7, 2011

While you are waiting (FAQ)

I know you can hardly wait to fire up the JIT-crafted UAE; still I need to ask for more patience. Things are improving, yet it is not as mature as this admired audience would deserve, so there is no pre-relase just yet.

Some of you is more excited than the others and asked interesting questions that worth answering. Questions are repeated all over again quite often, so let me save some time and pondering: here are the answers for the...

Frequently Asked Questions

Last updated on 11 January 2014.


Q: How can I help?
A: You can always show your support by sending a small donation to this project on AmigaBounty. You can also spread the word to users of other platforms; maybe they would like to hear about it too.
In case you feel the urge, you can fiddle with the sources. See the Q/A below related to getting the current sources.

Q: Will this JIT translation work on AmigaOS3.x PPC/MorphOS/Macintosh/Linux/game consoles? The bounty is about AmigaOS4!
A: Absolutely, I have no intention to limit the implementation to AmigaOS4.
However, I cannot promise that I will release any other specific builds from E-UAE other than the one for AmigaOS4. (Simply because I have no experience, neither too much time/intention to dig deep into development for different platforms.)
The sources are released under GPL license; you can do your own build or merge it into your favorite UAE derivation.

Q: Will you fix the bug XYZ in E-UAE? Will you improve the chipset emulation?
A: No. I never promised anything else than PowerPC JIT translation and I still intend to stick to this. I have fixed some minor things in the original E-UAE implementation that was related to AmigaOS4, but don’t expect any subtle changes.

I am not going to take over the maintenance of the E-UAE source code base. Somebody else has to stand up and accept this task.

Q: Will this JIT thing improve the speed of the emulation of my favorite (OCS) game?
A: Possible, but I must point out that similarly to the x86 implementation the JIT translation will only work on processors that have instruction (CPU) cache built in and turned on (68020 and up). So, if your game cannot cope with these processors and the turned on processor cache, then I am sorry, but it won’t help much.


Q: I tried to run Kickstart 1.3 and it crashed with the JIT enabled!

Why? I tried to run <some ancient Amiga 500 game> and it crashed with the JIT enabled! Why?
A: Before Kickstart 2.05 the OS was not aware of the processor (CPU) cache, essentially these Kickstart versions wouldn't work with 68020 processors at all.
The processor cache is disabled when the processor resets and starts executing the ROM, but since the OS is not aware of the cache flags it turns on the cache when it fiddles with the processor control registers.
Why was it working with the interpretive emulator when 68020 processor was selected: the processor cache is not emulated in the interpretive emulator, so basically it doesn't matter at all if it was on or off.


Q: Why is the JIT depending on the processor (CPU) cache?
A: Because it is very hard to detect the self-modifying code, code overwriting and similar situations without the help from the OS or the running program itself. When the cache is flushed then the previously compiled code can be recompiled.
The JIT implementation is depending on the processor (CPU) cache emulation to overcome of the issue of the self-modifying and the generated/copied code. The JIT compiled code behaves quite similar to the actual 68020 execution, so if an OS version or a game does not work on 68020 (caches enabled) then it won't work with JIT either. (I had my sweet time with this issue while I was developing Petunia, back in the days. Still not resolved
completely there, but it is good enough for now.)

Q: Will this JIT thing improve the speed of the emulation of my favorite (OS-friendly) 68k application?
A: Most likely yes. No promises, though.


Q: When will it be ready?
A: When it’s done… ;) If everything went very well then it will be finished around when the bounty deadline comes: 02/21/2012. (Maybe I should start a countdown, but it would be too embarrassing when I miss the deadline. ;) Well, the deadline is missed, so, let's say: when it's done.


Q: Is the implementation derived from Petunia?
A: No, it is a completely different code. Neither any C or assembly source code from nor any dependency on the JIT implementation in AmigaOS4 is used.
(Actually, this is not entirely true: I was way too lazy to create an instruction description table file again and the parsing tool for it, so these two pieces were borrowed from Petunia. My original plan was using the present file and parsing, but it was so tuned to the interpretive emulation and my JIT implementation is significantly different than the x86 version, so I just skipped this.
But apart from that two files the emulation itself is completely different.)

Q: Will it be faster than Petunia?
A: I have no idea. It is more likely that some apps will run faster with Petunia, others will run faster with the E-UAE JIT. There are too many factors that might have effect the results. We will see when it will be finished.


Q: Where can I get the sources?
A: Check out the SourceForge project: https://sourceforge.net/projects/euaeppcjit 

Q: Where can I get the executable?
A: There is no final release yet, the project is in Beta stage.

Q: I want to try the emulation RIGHT NOW! How can I get it?
A: Go ahead and download the beta from the SourceForge project page:
https://sourceforge.net/projects/euaeppcjit/files
Please note: it is still Beta. You can give it a try, but be prepared that it might not work as you might expect it.

Q: But... but... I don't know how to set up the JIT compiling. What would you suggest?
A: There are some crucial settings for the JIT in the E-UAE configuration file. Without these settings the JIT compiling won't work properly. I suggest to add the following block into your E-UAE configuration file:

cpu_speed=max
cpu_type=68020
cpu_compatible=false
cpu_cycle_exact=false
blitter_cycle_exact=false
comp_optimize=no
cachesize=8192
comp_constjump=yes
comp_trustbyte=indirect
comp_trustword=indirect
comp_trustlong=indirect

ppc.use_tbc=false

These are the necessary settings for now, might (or most likely will) change in the future. 


Q: How can I be sure that the JIT is working while I am running the program?
A: There is a LED for it! Yes, if you turn on the LED on-screen-display (OSD) then you will see a LED that says "JIT". If this LED is green (read: not completely black) then the JIT is on. The more bright green means more executed JIT code.
If the LED is red then the JIT compiling is not working at the moment.
To turn the LEDs on put this into your configuration file:

show_leds=true

If you are interested in the details of how the JIT LED works have a look on this post: http://euaejit.blogspot.com/2013/02/watch-for-led.html
The LED behavior is slightly changed in Beta01, so have a look on this page too:
http://euaejit.blogspot.com/2014/01/ppcjitbeta01-happy-new-year-2014.html

(Bonus questions, asked almost every time… :)
Q: Do you like to live in New Zealand?
A: Very much so. :)


Q: Have you met the hobbits yet?
A: No, not yet, but I am looking forward to meet them. But we already visited the Hobbiton, that was fun!


Q: Have you met any sheep yet?
A: Yes, a lot.


I will add more questions and answers to this post as soon as I got more.
It seems pretty boring for now. Maybe I should post some naked ladi^H^H^H^H facts to this page.

Comments? :)

26 comments:

  1. I don't like facts ;-) :-D

    Thanks for the news, Almos.

    ReplyDelete
  2. sure. which naked ladi^H^H^H^H facts can you offer? ;)

    ReplyDelete
  3. "I know you can hardly wait to fire up the JIT-crafted UAE;"

    Nope.

    ReplyDelete
  4. Keep going! Looking forward to this a lot! One thing though, do you know about P-UAE? It is an effort to try to backport some of winuae's features to e-uae, might be better off working from P-UAE? It's still in development too.

    ReplyDelete
  5. Let's get back to the facts later on... ;)

    @spotUP: The bounty was about E-UAE and I have spent quite a long time to understand the structure of E-UAE, compile it properly, build up the development environment. Right now I have no intention to switch to any other UAE implementation. Maybe I will check how to add these changes into P-UAE, when it is done.

    ReplyDelete
  6. It is alive, igor ?:)

    Bring us beta version for xmas :)

    ReplyDelete
  7. will you make an status update arond xmess this year ???


    take a wild guess !! are you half way finish with it or ?? how many %

    ReplyDelete
  8. I am sorry guys, no promises until things are getting together.

    You can get it when it's done. :)

    ReplyDelete
  9. hi rachy, long time no see.

    looking forward to JIT E-UAE, as you know i am a big 68k fan still after all these years.

    Toaks.

    PS:i donated a lump of cash , more to come when we see a running version :)

    ReplyDelete
  10. Hey Toaks, it's been a while. Thanks for dropping by and thanks for the donation.

    ReplyDelete
  11. Happy New Year to you all Amiga fans!

    ReplyDelete
  12. Did igor still alive ?:)

    ReplyDelete
  13. He is alive indeed. Getting closer and closer. (And even closer.)

    ReplyDelete
  14. i am very much locking forward to the next update.i am not expeting an alpha beta thing but a little word on how things is going forward would be nice in thease could time.( i live in denmark)

    ReplyDelete
  15. Probably it is time to do another update, too many of you guys are asking me directly how the things are going.
    I wanted to release a beta version together with the next update, but at the moment the OS is not able to run on the JIT, so it is practically useless without my special test apps. Maybe I can do something about it soon, I need some luck to spot the problem, though. :P

    ReplyDelete
  16. @Rachi
    By the OS you mean full wb3 ? Or just even kickstart ?

    But anyway, at least we can play with ADF/DMS and whdloads games to see benefits. Can fill a gap while we waiting for next release.

    ReplyDelete
  17. uhh soo you did intet to put out an aplha thing. well i think wee can wait with the update then,anyway iff it can help then good luck from me.

    ReplyDelete
  18. I mean the kickstart is not able to start up at the moment. I haven't tried 1.3, only 3.1, but since 1.3 is not able to support the processor cache, it wouldn't help much anyway.
    Without booting into any kickstart version it is not possible to load any program from floppy, so this is absolutely required.

    ReplyDelete
  19. Please keep up the good work. I am dying to see this in action. :)

    ReplyDelete
  20. Stop drinking beer and show us smtg ;)

    ReplyDelete
    Replies
    1. Converting coffee and alcohol into code, the usual coder's life. ;)

      Delete
    2. Indeed it is. Waiting for the progress reports on this one.. :)

      Delete
    3. Yes, give us some good news :-)

      Delete
  21. This is a very interesting project, keep it up !

    ReplyDelete