English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   request.UAE Wishlist (https://eab.abime.net/forumdisplay.php?f=56)
-   -   QEMU TCG as JIT replacement? (https://eab.abime.net/showthread.php?t=48016)

rlake 16 July 2014 07:51

Oh, interesting... Ex-Transitive guy here!

A quick take on GCCJIT and QEMU TCG is that they're very basic for the purpose of replacing the UAE JIT and GCC is just heavyweight. If the motivation was to simply compile and run under x86_64 then sticking to the same i386 subset could be far more manageable as there are only a few common problems here such as default size of data pushed to stack, removed instructions (maybe not even applicable); far from a rewrite to port the ABI. I've taken a look at the UAE sources and it's fairly parseable to me but alas I'm likely encumbered. :(

bernd roesch 30 January 2018 16:05

replace the JIT is not easy. The main problem is that the JIT must check every branch command if a new amiga chipset event need execute.

this cost lots time.

because the problem with X86 is that the CPU flag register need stay correct . and when do the X86 asm commands that check if a new chipset event occur, this register is trash when it is not save.
so the JIT code contain a commands pushf popf. this save and restore teh flags. The problem with this 2 commands is that they need more time than only 1 clock cycle. I think popf/pushf each use 10 X86 clock cycles

https://en.wikipedia.org/wiki/FLAGS_register

so short loops in 68k get very slow for example

loop clr.l (a1)
subq #1, d0
bne.s loop

every time the bne is execute the JIt add code to check if a chipset event happen. (sound, dma, keyboard, mouse CIA)

now we have 2018 with AVX and virtualisation extenstions in CPU, but i did not know if there is a way that the JIT can add some X86 commands to check for chipset events, and the flag Register of X86 is not trash

If AVX or SSE have own flag register and a value compare do not change normal X86 flag register then can avoid that pushf and popf need use and so speed up much


All times are GMT +2. The time now is 16:25.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.04275 seconds with 11 queries