Welcome, Guest. Please login or register.

Author Topic: Question about JIT  (Read 2582 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16882
  • Country: gb
  • Thanked: 6 times
    • Show all replies
Re: Question about JIT
« on: September 04, 2003, 08:13:10 PM »
@Atheist,

I can see what youre getting at but there wouldn't be a lot of point. The only real bottleneck in many JIT systems is the transcription time, which you would eliminate this way. However, as any winuae user could point out, the transcription overhead really isnt noticable at all. Even this grumpy old K6-2 outperforms a genuine 68060 by a factor of 4x or so. I can imagine a well written PPC JIT for 680x0 emulation could be a lot better still (eg, you could keep the 680x0 registers in PPC registers and still have room to manouvre).

Quote

xeron wrote:
In theory this is perfectly possible. It would just be a compiler for the "68000" language.


Agreed, but I can see some real nasty problems with any form of self modifying code, or code that makes assumptions about address spaces etc.


As for that CoyoteFlux thing, it was called PPC680x0 and worked at source code level only, IIRC.
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16882
  • Country: gb
  • Thanked: 6 times
    • Show all replies
Re: Question about JIT
« Reply #1 on: September 05, 2003, 09:37:27 PM »
Quote

ncafferkey wrote:
I agree that there usually won't be much advantage over JIT in speed, but I'm not so sure about memory. Isn't it the case that UAE and Amithlon require many megabytes of JIT cache to perform well?


Well, WinUAE has from 1-8Mb cache for the JIT, so you could argue it's not that much. It works very much like an instruction cache on a CPU, the most recently/frequently used code is cached there. I have experimented with the size to see what difference it makes. Overall bigger is better but to be honest, I haven't noticed much difference between them. I just set it to 8Mb to reduce the transcription overhead (I guess it covers the kernel and whatever application I am running), but even with a 1Mb cache it seems to run pretty well. No doubt compact amiga code helps there ;-) The code part of any program is usually fairly small...
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16882
  • Country: gb
  • Thanked: 6 times
    • Show all replies
Re: Question about JIT
« Reply #2 on: September 05, 2003, 09:42:28 PM »
Quote

Atheist wrote:
For instance Power Packer, the source might not be available, so the JIT converts every instruction to PPC then runs it. I thought the JIT could be used to run the program, command by command, but instead of running, it saves the resulting commands into a file. Effectively converting it into a PPC program.


Not quite. A JIT usually works on blocks of code. A block is transcripted the first time it is used and the transcripted block is then stored for later re-use. It can be purged if not used again and replaced with something else. This way the amount of memory needed is reduced, we simply cache upto a predefined amount of transcripted code.
int p; // A