3 ms·
Apple's gotten good at this architectural switching game for the Mac: 68K -> PPC -> x86 -> ARM The remarkable thing is that the new machines in emulation mode
by musicale 5y ago
Apple's gotten good at this architectural switching game for the Mac:
68K -> PPC -> x86 -> ARM
The remarkable thing is that the new machines in emulation mode are usually comparable to or faster than the older machines.
- q-big 5y ago> The remarkable thing is that the new machines in emulation mode are usually comparable to or faster than the older machines. The central reason is that most programmers make no use of the immense capabilities that modern processors provide. For example, using AVX2 or AVX-512, you can do do magic in accelerating some algorithms on x86. Software that makes use of these will likely be quite slow on (Apple's) ARM processors.
- chongli 5y agoGenerally, Mac software that takes advantage of those instructions does so indirectly, via system libraries like the accelerate framework. If your x86 application is using a system library then on an M1 Mac those instructions won’t be emulated at all, they’ll run natively. This is why Apple’s emulator is so fast: it doesn’t emulate any of the system libraries, it uses the native ones instead.
- astrange 5y agoNo, neither Rosetta emulator do that, they translate everything. The original 68k emulation on PPC did do that, using Mixed Mode Manager: https://developer.apple.com/library/archive/documentation/mac/pdf/PPC_System_Software/Mixed_Mode_Mgr.pdf https://developer.apple.com/library/archive/documentation/ma... but it was very hard to get right. You have to know the right calling convention for everything, and there are some problems with floating point precision and other things I forget the details of.
- perl4ever 5y agoWell, that wasn't really true with 68K on PPC. It aspired to be as fast as the fastest 68K Macs, but that was based on averaging over some system calls in PPC code and some not. Speaking as someone who used one of the early machines @ 66MHz. The speed was unimpressive enough that there was a third party product that claimed to accelerate 68K code. Probably through some JIT techniques, I don't remember. But it seems weird in any case to me to give Apple a lot of credit for this, because haven't we gotten to the point where VMs have eaten the (software) world? Everything runs on an advanced emulator, it's just the processor never even existed.
- musicale 5y agoSounds more "comparable to" rather than "as fast as the fastest." Presumably Mac OS on PowerPC got faster as more of it was ported to native code; it's always nice when OS updates make your machine faster rather than slower. But your point is interesting; as you note, Connectix's Speed Doubler apparently included a dynamic/just-in-time binary translator - I wonder what Davidian thinks about it? (Of course Rosetta 2 for M1 does on-demand static translation.) I'd guess that Davidian's emulator may have used an interpretation approach for consistent instruction timing, which may have been required for timing-sensitive device drivers to work properly, and also for running out of a static ROM with zero RAM overhead. Dynamic translation can eat a lot of RAM, especially if you have to keep the original code around (e.g. for code page memory accesses.) Connectix famously continued its emulation game and ultimately won a pyrrhic victory after being sued by Sony, resulting in PlayStation/game console emulation being declared legal (hooray!) but also killing the company and its PS1 emulator product (which may have resurfaced as Sony's own PS1 emulator for the PSP/PSVita/PSTV/PS3, though the PS Classic uses PCSX.)