books

Science
Hackers
Nonfiction

Books like Hacker's Delight

Hacker's Delight

Imagine a minicomputer programmer in 1972 or a microcomputer programmer in 1982 who needed to implement more integer operations than the standard plus, minus, bitwise and, or and xor provided by the computer's architecture: things like the number of one bits in a word, the position of the rightmost one bit in a word, cyclic redundancy check, the difference between two integers or zero if it is negative, and so on. It is possible to write straightforward algorithms implementing these operations, but it is also possible to do it by combining bitwise logical and arithmetic operations in a clever trick. This book is a chock full of such tricks. The problem is that by 2012, none of it made sense. First, silicon is so cheap nowadays that many of these operations are implemented in hardware in commodity processors: Intel architecture processors have had an instruction for the position of the rightmost one bit in a word since the 80386; ARM processors have had it since version 5 of their architecture. Second, modern processors are superscalar: they execute multiple instructions at the same time unless there are data dependencies between the instructions; in order to compare the performance of a straightforward algorithm with that of a tricky one, one has to look at these dependencies, which the book doesn't. Third, since the 1990s, many commodity processors have had a vector instruction set: MMX and SSEx in the Intel architecture, AltiVec in the Power architecture, and so on; one would think that if the goal is to speed things up, one would look at them, but they do not merit a mention in this book. So one should look at this book as being not so much a practical computer science book as a microprocessor-punk novel.

Filter by:

Cross-category suggestions

Filter by:

Filter by:

Filter by:

Filter by:

Filter by:

Filter by:

Filter by: