Welcome, Guest. Please login or register.

Author Topic: 68k -> ??? JIT  (Read 2747 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
68k -> ??? JIT
« on: October 23, 2014, 02:08:03 PM »
Hi all, since I have a spare hour, my mind has been wandering back to A.org discussions of old and I thought I might start a new one.

I have been reading up about the new WebKit FTL JIT, and it's facinating. It's no secret that the 68k->x86 JIT in UAE is a scary beast that no one wants to touch, which is a shame since it's somewhat stuck in the past, and unable to benefit from modern CPU features that the x86-64 offer and obviously it's not portable to alternative architectures like the ARM (and the new ARM64).

It would be nice if the remaining devs who visit this site could throw a few thoughts into this thread about their understanding of JIT compilers and how we could optimise portable 68k emulation.

:-)

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: 68k -> ??? JIT
« Reply #1 on: October 23, 2014, 02:24:49 PM »
Quote from: Rob;775483
Have you looked into Rachy's 68k-PPC JIT for E-UAE.
I haven't and probably should... My thoughts are around something more "generic", hinting towards LLVM options ;-)

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: 68k -> ??? JIT
« Reply #2 on: October 23, 2014, 05:10:40 PM »
Quote from: Heiroglyph;775492
Aranym has x64 working and Arm in progress. They use the UAE JIT and were the originators of the MMU that UAE is using I believe.

Good spot! I've just had a look and it seems they do have a JIT in development for the x86-64. I can see suggestions of an ARM port, but I'll have to look deeper to see.

Quote

I know it's not what you were getting at, but it's something.


Actually, while I was hoping for something more generic, given that it is VERY unlikely we will see any new CPU architectures other than the X86-64 and the ARM for a very long time, this news is better than I had hoped.

I guess when Toni gets bored with PPC support, we will see these Aranym JITs back ported to UAE :-)

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: 68k -> ??? JIT
« Reply #3 on: October 23, 2014, 06:01:44 PM »
Quote from: Heiroglyph;775504
Yup, look here: http://wiki.aranym.org/platform_specific_information


Vamos would be a great platform to develop other than it's mostly written in Python. I keep thinking of rewriting it in C and adding a JIT (probably UAE), but it's a pretty big codebase for someone that doesn't know Python. I can stumble through reading it like any programming language, but it's awkward and I'm really not interested in Python as a language.


I was interested in Vamos too, but I got so bogged down in Python, gave up... I can't figure out how the Python->C bridge works so he is able to use the 68k interpreter he uses.

If you rewrite it in a sensible language like C, I'll be right back with you.

Quote

I would be interested in whether they are taking advantage of the extra registers and whether it's faster. The overhead of x64 sizes might make it a break even for emulating a 32bit CPU.


Hmmm, doesn't x86-64 allow you to treat registers as halves, upper and lower, so any logic/arithmetic operations would be 32bit in the respective halves (with overflows etc)? Or am I confusing it with ordinary x86?

If I'm right, you could pack two 68k registers (perhaps just the 68k address registers) in a single x86-64 register and that would definitely confer a speed advantage.

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: 68k -> ??? JIT
« Reply #4 on: November 03, 2014, 09:13:07 AM »
Having spent a few days reading, an idea that occurred to me was a 68k-> asm.js compiler and then take advantage of the various JavaScript JITs to speed emulation.