I’m trying to optimize some SuperH assembly. The div is significantly slower than the mul. I’m considering testing a reciprocal table + mul and compare the speed of that to a div for my application. I understand that the memory access for the table will be slow too, but still might be faster than a div.
However, when researching this, I came across some info talking about using log + exp tables for this purpose, rather than a reciprocal table.
I understand how log + exp can be used instead of division, but why take this approach instead of a reciprocal table? If you use log + exp, you need twice the memory, and worse, twice the number of memory accesses. (Although I suppose if you interleave them correctly you can load both the needed log + exp values into the same cache line in a single memory access)
What’s the advantage that log + exp tables provide over a simple reciprocal table?