Welcome, Guest. Please login or register.

Author Topic: PowerPC emulation on x86 possible?  (Read 19120 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12114
    • Show all replies
    • http://www.troubled-mind.com
Re: PowerPC emulation on x86 possible?
« on: November 07, 2003, 10:35:25 AM »
I see no reason why a PPC-JIT could not be make for an x86, and I would not be surprised if the Modern x86 gave exceptional performance.


As a Side note I ran WinUAE on my new 3ghz machine and was able to Emulate an A500 to perfection. Even the sound was faultless... I used a 60Hz Video sync (It's a shame the PC can't generate a 50Hz one:-( ), bur all my old games ran perfectly. It did a similarly great job emulation an A1200 (basicly the same, but with the addition of an EC020+AGA and 2Meg Chip ram). There was an some issues with the display going black at time (which I think is a bug in UAE).

Then I decided to switch the JIT on (Fastest Possible setting and Direct)... wow!!! Speed checkers were reporting about 2500MIPS (this only happens when you have the 60Hz sync on, otherwise the timers run too fast). The Sysinfo comment was "Phone Me", I tried it didn't work :-(

Now where did I put my Imagine disks!!! :-)

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12114
    • Show all replies
    • http://www.troubled-mind.com
Re: PowerPC emulation on x86 possible?
« Reply #1 on: November 07, 2003, 11:00:32 AM »
Quote

Djole_ wrote:
Sysspeed just shows 2500 mips coz the JIT skips the fake instructions from Sysspeed so it thinks it's that fast..... same as on mos .... but the actuall speed is much lower.

Now don't get me wrong i never used UAE and never will but i just happen to know this....


Amiga emulation .... bah ... get a real Amiga....


Maybe SysInfo does, but I wrote my own speed tester that simply times how long it takes to execute 10000 loops of testing every 68K instruction in as many different addressing modes I could think of.  
I would be happy to send it to you.

The timer is a simple int5 (VBL) councter that counts up one every VBL, and treats every 60 as a second. As the VBL was tied to my GFXcards 60Hz, it should be very accurate.


Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12114
    • Show all replies
    • http://www.troubled-mind.com
Re: PowerPC emulation on x86 possible?
« Reply #2 on: November 07, 2003, 11:10:06 AM »
Quote

This is where I disagree, depending on what you mean by "exceptional". x86 is faster than PowerPC, but only by a small margin. Remember when x86 and m68k were in the same league? Don't you remember how slowly PC-Task ran? The reason you can emulate 68k Amigas so fast is that the 68k range is so utterly behind x86.

I reckon you might get PowerPC 601 speeds on a fast x86. Of course this is blind conjecture, just like all the other estimates posted here.


I think there is a language barrier there. You seem to think by exceptional I mean better than. I don't.

By exceptional, I mean that a PPC JIT should be able to perform very, very well (Since I don't know any figures, I won't embaress myelf trying to make any up), probably giving a similar price performace ratio (ie an $800 x86 CPU+Mobo running a PPC JIT, may well perform the same as an $800 PPX + Mobo).

The modern x86 and PPC are not really as different as people here want them to be... With a JIT, things get really nice.

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12114
    • Show all replies
    • http://www.troubled-mind.com
Re: PowerPC emulation on x86 possible?
« Reply #3 on: November 07, 2003, 11:59:45 AM »
Quote

They don't have to be significantly different for emulation to cause an overhead. No matter how similar the design philosophy between two processors, it doesn't change the fact that every instruction has to be translated into several native instructions. The fact is that code targetted for PowerPC processors expects to get PowerPC level performance. I don't think you'll get that, even with JIT, right now, with a full PowerPC emulation (and by full, I mean with the MMU etc.)


Well, I don't see there needs to be much over head with simple emulation of the instructions.
But I do agree the MMU (and Altivec etc...) is a totally different matter.

My mind set is that most programs don't know or care about the MMU, so if you are (for example) running an AROS PPC program on an AROS x86 system using a JIT then the CPU native OS, would take care of the MMU.*

*This argument applies ot Linux, BeOS etc...


-Edit- I'd love to try PPC emualtion out. But I know next nothing about the PPC (Tried to learn the ASM once but it was too boring, like x86), surely there must be someone here with the experience to make a test program.

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12114
    • Show all replies
    • http://www.troubled-mind.com
Re: PowerPC emulation on x86 possible?
« Reply #4 on: November 07, 2003, 12:36:57 PM »
Quote

itix wrote:
Quote

Maybe SysInfo does, but I wrote my own speed tester that simply times how long it takes to execute 10000 loops of testing every 68K instruction in as many different addressing modes I could think of.


Can I have this? I'd like to check it out on MorphOS.


Sure, just send an email to my openamiga AT ahsodit DOT com address and I'll send it to you.

-EDIT- I'm intregued to know how well it works on MOS! I don't think I used any harware specific stuff, but I do instal an interrupt handler in the VBL interupt... I assume this is emulated, and is at 50/60Hz or the results the program will gives are going to be wrong.

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12114
    • Show all replies
    • http://www.troubled-mind.com
Re: PowerPC emulation on x86 possible?
« Reply #5 on: November 07, 2003, 02:26:09 PM »
Quote

xeron wrote:
Quote

bloodline wrote:
-EDIT- I'm intregued to know how well it works on MOS! I don't think I used any harware specific stuff, but I do instal an interrupt handler in the VBL interupt... I assume this is emulated, and is at 50/60Hz or the results the program will gives are going to be wrong.


This is actually a pretty bad way to do it, since on Picasso96 VBL emulation is optional (and most people don't use 60Hz on SVGA monitors), on real Amigas the actual frequency depends on the TV format (PAL, NTSC, DBLPal, DBLNtsc, Multiscan etc.), and isn't likely to be particularily accurate on emulated systems.

A much better way would be to use timer.device, since on classic hardware it uses the CIA timers, and under OS4 (and presumably MOS) it uses the PowerPCs onboard timer.

At the end of the day there is no really accurate way to do it on both Amigas and UAE, since there are no particularily accurate timers in UAE (and I count the VBL into that).


The Timer device just gave weird results in UAE. So I decided to use the VBL since I knew for sure that It would be at 60Hz (as this can be set on the latest version of WinUAE). It doesn't really matter how accurate it is, all one needs to know is that it's a lot.

@lempkee
Why not tell someone who cares, or even, and this might be a bit difficult for you, Don't read the threads that make you sick...
Hey why not do something positive and learn about the issues being disccused so that you can add something constructive?

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12114
    • Show all replies
    • http://www.troubled-mind.com
Re: PowerPC emulation on x86 possible?
« Reply #6 on: November 07, 2003, 02:36:02 PM »
Quote

minator wrote:
Quote
Note that modern X86 processors (e.g. K6/K7/K8 and Pentium Pro/II/III/VI) translates X86 ISA into smaller RISC like instructions via HW decoder/translator before pumping it into the Post-RISC pipelines architecture.


I seem to remember writing a long article explaining why thet's really only a myth.  It looks that way at the high level but at the lower levels the original ISA adds a great deal of complexity that pretty much cannot be removed without either breaking compatibility or destroying performance.

I'd bet even Transmeta CPUs have hardware dedicated to the x86 ISA.

PPC Vs x86

Quote
Well, I don't see there needs to be much over head with simple emulation of the instructions.
But I do agree the MMU (and Altivec etc...) is a totally different matter.


But it's also involves emulation of the 32 registers using just 8 and somehow mapping the PPC FPU onto the x86 FPU which is a completely different design.  This is going to be amazingly complex and probably horribly slow due to constant cache thrashing - before even starting on Altivec or the FPU.

That said IIRC Motorola has a PPC emulator for the PC.


I have already given my Critique of the outdated, but  beautiful work of FUD that is the infamous CISC Vs RISC article. I won't rehash it here.

As for the Register limits of the x86, I agree that will have a penalty, of course it will, but the x86 CPU's pump thorugh a lot more instructions that even the fastest PPCs do, and the x86's have rather nice large Caches. All in all I would say that a PPC JIT emulator on the x86  would be pretty neat.

Note: acording to Transmeta, from when I Emailed them 2 years ago, the only "feature" that assisted in x86 emulation was that the Cruso was Little-Endien.

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12114
    • Show all replies
    • http://www.troubled-mind.com
Re: PowerPC emulation on x86 possible?
« Reply #7 on: November 07, 2003, 02:58:20 PM »
Quote

Uhh.. no, I think the PPC970 and Power 5 hold their own pretty well against the equivalent x86 chips. Even when you talk about the G3 and G4, the x86 doesn't "pump through" instructions quickly enough to emulate the PowerPC at real-world speeds. You won't get an x86 emulating a PowerPC keeping up with a Pegasos or AmigaOne. Not with high-end desktop x86 chips, anyway.



Yeah, I would bet the top of the range PPC970 would hold it's own against the equivilent speed AthlonXP (for example).

But I still think my price performance ratio holds.

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12114
    • Show all replies
    • http://www.troubled-mind.com
Re: PowerPC emulation on x86 possible?
« Reply #8 on: November 07, 2003, 03:15:10 PM »
Quote

lempkee wrote:
why start the plan on killing amigaos before its out? , this is yet another example on how bad everything is if its not on an x86 ..

i am pretty sure there is a possibility of dooing it and i am pretty sure people will get very pissed off at it , so if you want to piss off anyone in the amiga market or morphos or mac etc, sure then do it, make everything x86 and lets move over to windows forever.....yay!



I really don't understand your problem. the PPC is just a CPU... It holds no emotional attachment. It's not like the Amiga Custom Chips, where I can understand the love that people have for them.

The PPC is just like the x86... when it comes to choice of CPU you only have one thing to consider (Providing compatibility is not an issue). Price Vs Performance.

I use the x86 because it's cheaper for me to do so. (not to mention the range of drivers and applications available to me that I need to get a job done).

I also do not see the need to limit AmigaOS to One CPU as you seem to. I would rather people have the choice to choose what Hardware they run it on.

Ok, so I'm Pro Choice... does that make me a bad person?


@Lempkee
Why is everthing x86 instantly windows? You are so biggoted

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12114
    • Show all replies
    • http://www.troubled-mind.com
Re: PowerPC emulation on x86 possible?
« Reply #9 on: November 07, 2003, 04:11:49 PM »
Quote

xeron wrote:
Quote

bloodline wrote:
But I still think my price performance ratio holds.


Well, speaking as someone who has written a few emulation cores, I think you're off in fantasy land as I said earlier.


I'm probably still in my little room, damn this wall is boring ;-)

I'm still interested in the technical aspects of this though. I don't doubt your technical prowess when it comes to emulation cores (what CPU's, if I may ask?). Since I have only read the theory behind them I have no experience in making them.

But from what I have read, a Dynamic compilation could provide really good performance.

I'm facinated but the Block approach to dynamic compilation.


-Edit- My answer to you, is that I don't know, but from theory I don't see why is would be a big problem. Since you have the experience to prove me wrong, I would urge you to write a PPC emulator and prove me wrong.  I'm far more interested in the technical aspects than being right or wrong.

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12114
    • Show all replies
    • http://www.troubled-mind.com
Re: PowerPC emulation on x86 possible?
« Reply #10 on: November 07, 2003, 04:34:37 PM »
@xeron

well I think you should give it a go, I really want to see how it performs :-)


Side note, if you fancy earning a bit of cash, and playing around with a 68K JIT on the x86... then there is the AROS Emulation bounty open :-)


-Edit- I am willing to conceed that my Price performance ratio only holds until there is a low priced PPC970 board available... Pegasos2 for example.

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12114
    • Show all replies
    • http://www.troubled-mind.com
Re: PowerPC emulation on x86 possible?
« Reply #11 on: November 07, 2003, 04:47:43 PM »
Quote

xeron wrote:
Quote

bloodline wrote:
-Edit- I am willing to conceed that my Price performance ratio only holds until there is a low priced PPC970 board available... Pegasos2 for example.


But I was talking about G3s and G4s.


I was ina bit of a sticky situation a few weeks ago. I had to get a Laptop for music.

I had to decide which Laptop to get. I only had just over £1000 to spend.

It was a toss up between  the PowerBook G4 876Mhz with 256meg RAM (40Gig HD + 12" screen) or a Pentium P4 3Ghz with 512Meg RAM (40Gig HD + 15.1" Screen + DVD-R/RW).

Not sure what to get, I decided to try out Reason and Logic (the music software I will be using, many thanks to a friend of mine for providing the Mac versions of the software to try) on both machines.

On the basis of that simple test, I was able to decide which one to get.

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12114
    • Show all replies
    • http://www.troubled-mind.com
Re: PowerPC emulation on x86 possible?
« Reply #12 on: November 09, 2003, 12:13:25 PM »
Quote

How can you claim to be only interested in the technical aspects then claim my article was "Outdated & FUD" - of which it was neither.

That RISC chips are more efficient than x86 is not exactly new news...


That comment says it all. You use the word efficient like it means something by itself.

I ask you is is more efficient for me to buy a 3Ghz P4 or a 876Mhz G4, for the same price? Efficiency is all relative.

I really don't want to have to go into the pointlessness or your article again, since I've already explained how you totally missed all the good points of the PPC and focused on just trying to make the PP look better (the PPC970 is a great chip why lie to make it look better?).

Yes, your article was horribly outdated. The PPC is no more RISC than the X86. Sure the architectures both started at different ends of the spectrum, but now they are so similar it's a pointless argument. Both chips are aimed at the same market (the desktop, thus both have evolved in a similar way)

If you talk to any CPU designer and use the words RISC and CISC he will probably laugh at you.

If you want to see real RISC chips then look at the Alpha, MIPS and ARM


As for your link?... Give up, look at a real site like:

http://www.arstechnica.com/

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12114
    • Show all replies
    • http://www.troubled-mind.com
Re: PowerPC emulation on x86 possible?
« Reply #13 on: November 10, 2003, 11:03:37 AM »
Quote

One of the aspects of RISC concepts are the fix length instructions. Ever since AMD's K6 processor, it translates variable length CISC X86 instructions into fix length instructions “RISC86” (using AMD's words).


Modern achitectures are now investigating instruction compression. So that traditional "RISC" (ie fix length instruction) CPU's can enjoy the code density of "CISC" (variable instruction length) CPU's.

This makes those "RISC" chips work exactly the same way as the modern x86.... with Variable length instruction in memory decoded into fixed length instruction in the core.

Spooky how cool technology is when you bother to keep up to date.

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12114
    • Show all replies
    • http://www.troubled-mind.com
Re: PowerPC emulation on x86 possible?
« Reply #14 on: November 10, 2003, 01:46:16 PM »
@minator

I assure you that running a PPC at the same Clock speed as a Modern x86, will result in a very similar performance.

The chips are simply not that different!!

With out of order execution, then use Register Renaming, which allows for many more registers than architeurally avaiable. I would like to note that many "RISC" designs use Register windowing to limit the numer of Registers that the Programmer can see at any one time...

What you fail to understand is that All CPU designers use the same tricks to achieve speedups...

Oh, and if you want to say that the Alpha stoped being "RISC" at some point, then I would note that the PPC is far less "RISC", than just about any other RISC chip on the planet.

-Edit- "Altivec will out gun a P4" - you really have no clue what you are talking about... ok we get technical... look up instructions per cycle for the Altivec and then look at the instructions per cycle for SEE2 (etc...), then look at how many cycles per second the G4 (~1Ghz, since the) and the P4 (~3Ghz) run at...  please don't be stupid.