Although the N64's CPU is capable of up to 90 million instructions per second, Mupen64plus is only emulating 1/5th of that. In any real world r4300i code some cycles would be lost due to internal stalls because of branches, load-use interlocks, and a few multi-cycle instructions. But if it had enough cache to map out the entire RAM space (or direct access to zero wait-state memory that was sufficiently large) then it would probably typically execute a large percentage of this, probably over 60 million instructions per second.
Unfortunately it doesn't have such cache or fast RAM and access to the main RAM which is loaded into cache has a ton of overhead for anything less than significantly large bursts (much larger than a cache line). The CPU's access to the RDRAM is further slowed down by being routed through the RCP, which I suppose gives it priority (rightfully so) but also adds fixed latency. Since the CPU has direct mapped cache there will be a lot of misses just by shifting access between different regions. Data cache will often be negated just by loading from two pointers in the same routine, even the stack pointer runs this risk. Highly aligned data structures would make the situation even worse.
The situation is so bad that Mupen64plus doesn't even bother emulating more than 1/5th the maximum possible number of instructions, or 18 million a second. I'm not really convinced that this is enough for all games, but any hypothetical that aren't can probably cope with it and will simply suffer from additional in-game slowdown. Which is usually a lot better than the emulator slowing down beyond frameskipping. which takes the audio and input responsiveness with it.
Fact is, 18 million is all that Mupen64plus is going to emulate, so we can take that number as a hard limit.
Cortex-A8, on the other hand, has been cited by ARM as executing an average of 0.9 instructions per cycle across several industry standard applications. This is not a maximum like our N64 number, just an average. I don't know the cache configuration they used, but I doubt it was something particularly extravagant. Scaled to clock speed this gives us 540 million instructions per second at 600MHz, or 30 times higher than what Mupen64plus's N64 can do.
Now, how much a recompiler's output falls under the "average" curve is another story - my guess is not that favorably, because they tend to generate a lot of instruction bloat and extra branches which hurts icache and BTB performance.
I've said this about 1000 times, but it's really silly when people say "you need N times the power of what you're emulating to emulate it", where N is some fixed number. For one thing, none of these people are even making remotely educated quantifications as to how powerful something is and instead just compare the clock speed of the main CPU on both, when CPU can be a very small portion of the overall system capability and when the CPUs are generally not comparable on clock basis. And it's silly because emulation overhead has a lot to do with how different the platform is and not just how much "weaker" it is. And then it depends on how accurate the emulation needs to be and what your exact goals are.
dflemstr said:
He means that Wiz doesn't have some features that a N64 emulator needs. Without hardware-supported floating point operations, for instance, games will run extremely slowly on the Wiz. So, the Wiz will probably be able to run N64 games as well as a PSP in some cases, but it will most probably be even slower on the Wiz compared to on a PSP if a game uses a lot of floating point operations.
What I said was that IF N64 games perform a lot of floating point calculations then Wiz wouldn't cut it. What Ari64 has shown is that (at least for the popular games he tested) they don't. In fact, his Cortex-A8 code is using soft floats to begin with. I do find this a little surprising because StrmnNrmn gained noticeable performance improvements by adding register caching to floats, but this might have been very context limited. Ari64 cited 2-3.5% of CPU time, so 0.36 to 0.63 million per second, which is relatively manageable, and would perform better with custom recompiled code than with the libc calls that Mupen64plus is using.
Yes, the Wiz wouldn't compare highly well to the Pandora for running N64. But with floats out of the equation it looks at least worth trying. Converting down the ARMv6 instructions to ARMv5 equivalent chains would probably not hurt performance tremendously because unless I missed something the recompiler isn't relying on them for high performance in common code like for memory accesses or branches. Even though the 3D is only OpenGL ES 1.1 it is still as good as what several of the earlier N64 emulators were capable of doing, which was more than enough for emulating plenty of games satisfactorily. The Wiz's 3D vector coprocessor could also possibly be used to accelerate N64 T&L.
Mupen64plus is capable of giving results in at least something at 50% CPU usage for a 600MHz Cortex-A8. Wiz is probably usually less than half as fast per cycle, but can usually overclock to 800-850MHz. You might not get anything close to fullspeed across the board but all I ever said was PSP-level, which is certainly not that either.
Given that people have ported N64 emulators to GP2X where it was beyond ridiculous to expect a speed anyone would be happy with I would be surprised to see someone not eventually try to port this to Wiz. Even if that does mean a bit more work in the 3D department.
Poem58 said:
Also side note, I remembered reading an article around the time N64 came out where they were comparing the 64's CPU to I think a Pentium 4 ( I wish I could remember in what magazine). They said something crazy like the equivalent of 9 Pentium 4's (might have been 3's?) in power. Anyone remember reading this? How amazingly off were they, cause it didn't seem to be "so powerful" I wouldn't even think you could realistically compare those two CPU's, after all the N64 was RISC not x86.
N64 was released in 1996, before the Pentium 2 was even out ;p Much less Pentium 3 or 4.. A common Pentium 1 of the day was probably much more powerful than the N64's CPU. But couldn't touch the vector capabilities of the RSP.