(06-24-2010, 04:44 AM)NaturalViolence Wrote: [ -> ]We misunderstood. Especially since you posted this here.
Hehe yeah seems like it
But anyway, what I guess my question boils down to is.
Is it easier to emulate a similar architecture or does any tiny difference make it as difficult as anything else? I guess there's a lot of difference when it comes to pipelining and branch prediction maybe? and to lesser extent when it comes to OPcodes and registers.
It would be easier yes, does that answer your question?
And you have to understand that most of the time they are NOT the exact same architecture. for example: the wii ppc and G4 are WAY different
You could use GCC to compile everything on your powerpc if you have lots of patience.
The broadway PPC in a wii has both static and dynamic branch prediction for memory cache. If correctly predicted branches are encountered, the cpu can execute them in zero cycles. Some standard PPC's only have static BP so you would have to do research on how to emulate it for your specific processor.
Wii graphics pipelining from source is created by pixel rasterization which is also emulated on dolphin & defined in rasterizer.h and done by graphics card instead of cpu. As for cpu pipelining a standard PPC chip has no capability to convert integers to floats by hardware, everything is done by software-side algorithm. In wii broadway PPC, a register set (GQRx) is used for hardware level conversion of int->float calculation. That could be another problem.
As for opcodes,
yes it would be much easier to directly use PPC instructions than the current next-accurate method (intepreter) which converts all PPC opcodes to x86 on raw cpu processing power (which is very, very slow even on the best cpus). The wii's IBM750cl ppc uses a very similar, if not almost identical opcode set as your g4 (IBM 7400) ppc chip. Maybe a moderator can clarify how many custom instructions the wii's PPC has compared to older chips. But you would be right in assuming that using a PPC to natively run the code would be a major speedup compared to x86 intepreter.
I'll maybe make commits later after fluently understanding how everything works in dolphin. If you want any ideas you can also read the full source
here.
Quote:And you have to understand that most of the time they are NOT the exact same architecture. for example: the wii ppc and G4 are WAY different
Yes but a lot more similar than ppc and x86.