3 ms·
I was part of the MAE engineering team from 1992-94. The original plan was to machine-translate the Mac ROM from 68K machine code to SPARC/PA-RISC/POWER machin
by kbob 5y ago
I was part of the MAE engineering team from 1992-94.
The original plan was to machine-translate the Mac ROM from 68K machine code to SPARC/PA-RISC/POWER machine code. It would have brought MAE much closer to RISC-like speeds. Unfortunately, there's a lot of dirty assembler in the Mac ROMs, and the decoding project faltered. So about 3/4 of the way through the project, we scrapped the binary translation and ran the whole ROM in the 68K emulator. It started working quickly, but it was slower by a factor of several.
We had a binary translation app, basically a compiler that took 68K machine code as the source language, written by a 3rd party company whose name I forgot. They were east coast, possibly Research Triangle, and might have had defense contracting ties.
I personally identified about 20 Duff's Devices in QuickDraw inner loops and recoded them as not-Duff's-Devices so the binary translator could grok them. (Sorry, can't remember exactly how I de-optimized them. My/our assumption was that the RISC processors were so much faster than the 68030 of the Mac IIci we were porting that optimization wasn't a big deal.)
We (largely me) developed a huge list of hints for the translator, hundreds of instances of "The code at address X looks like it does this, but it really does that." or "Address Y is an entry point. Start translating here." or the converse, "Address Z is data. Don't mess with it."
It was an insane engineering effort, and I'm still disappointed it never shipped. It was happening at the same time other parts of Apple were developing the first generation PowerPC Macs. They were going through equally insane gymnastics getting 68K and PowerPC to coexist in the same address space, with calls in both directions.
Unfortunately, it's been nearly 30 years, and I just can't remember very many details any more.
- kbob 5y agoN.B., I didn't learn the term, "Duff's Device" until several years later.