[2021-12-19] “Microprocessors”

It has been more than thirty years since “Microprocessors: A Programmer's View” by Robert Dewar and Matthew Smosna was published and I still have not come across another book on the topic that has a similar breadth and depth. I first read this book in 1995 and enjoyed it immensely then. I read it once again recently and still found it quite insightful despite its age.

The topic of this book is the abstract model of the computer architecture presented to a low-level systems programmer by the Instruction Set Architecture (ISA) of a CPU on a system. It contrasts the models presented by CISC and RISC CPUs by presenting in-depth case-studies of representative CPUs from each of the families. In particular, it explains the rationale behind each of the approaches and the trade-offs made by the respective designers of the CPUs.

Due to it being the dominant computer architecture at the time and because of its complexity, the book devotes three chapters to the Intel 386. (The Intel 486 had been introduced just before the publication of the book and was architecturally very similar to the i386 anyway.) Since the 32-bit IA-32 architecture led to the now-dominant, but very similar, 64-bit x86-64 architecture, the in-depth coverage of the i386 in this book is still quite useful. (The other CISC CPU covered by this book, with two chapters devoted to it, is the Motorola 68030, which has since been supplanted by other architectures.)

Since RISC CPUs started getting commercialized in the 80s and were seen as the future of high-performance computing at the time, more than half of the book is devoted to RISC CPUs. The coverage begins by explaining the rationale behind the approach and a historical perspective leading up to it. The case-studies include the MIPS architecture, the Sun SPARC architecture, the now-defunct Intel i860 architecture, the IBM POWER architecture (referred to as “RIOS” in this book, as it was too new at the time and there was no official designation yet), and the INMOS Transputer. Sadly, the book does not cover the Acorn ARM architecture for some reason, even though it had been in production at the time (and is now the most prevalent microprocessor in the world). Ditto for the HP PA-RISC, although that was not a very successful ISA. The book was published a few years before the high-performance 64-bit DEC Alpha CPU was introduced, which embodied an interesting approach (see this paper by Richard L. Sites, for example).

One cannot help but admire the relative simplicity and elegance of the RISC approach to CPU-design as presented in this book. In some sense, all modern CPUs are now RISC CPUs (even ostensibly-CISC architectures like x86-64 use RISC-like micro-operations internally). Newer ISAs like RISC-V are RISC. That said, I am not a fan of delay slots, the lack of an instruction for division in some CPUs, having to use a sequence of single-cycle multiply-step instructions for multiplication, etc. As someone had once noted, RISC is a set of reduced instructions (and not a reduced set of instructions, as can be seen in some RISC CPUs), but sometimes these reduced instructions can be a little too reductionist.

The book has unfortunately not been updated since it was first published in 1990. Shortly after its publication, Matthew Smosna died at a young age. The surviving author Robert Dewar wanted to update it when I asked him about it in 2004, but sadly he too passed away a decade later. This is a real tragedy for us programmers, since a lot has changed in microprocessors over the years, though the fundamentals remain the same. There is thankfully a (much underlined) copy of this book available on The Internet Archive, but this book is otherwise hard to obtain, as this book has long been out of print.

If you are a systems programmer, particularly someone working on writing compilers, operating systems, device-drivers, low-level graphics, etc., this is a very useful book to have. Even if you are just a generally curious programmer, this book can be quite insightful in providing low-level details and a historical perspective on some of the domninant computer architectures today. Of course, you should supplement this book with articles like What's New In CPUs Since The 80s? by Dan Luu or Modern Microprocessors: A 90-Minute Guide by JRC Patterson. (In my opinion, the usually-recommended text-books on computer architecture like Computer Organization And Design and Computer Architecture are not a viable alternative to this book, as they do not cover the topic in sufficient depth.)

I wish someone would write a similar book for modern CPUs and covered additional topics like vector instructions (aka SIMD), GPUs, memory-models, etc. across these CPUs.

Other Posts from 2021