Disclaimer: So this is obviously a silly question and I want to start by saying I don't want to discuss the financial costs of this, as I'm aware CPU cache is expensive. As this hasn't been made obvious enough, this is PURELY ACADEMIC - NOT FOR IMPLEMENTATION. Think "thought experiment"
I've been wondering if it would be possible to precompute all the work an ALU would do and store the results in a lookup table.
For this specific example, I've been looking at a subset of instructions the ALU is responsible for in a MIPS Architecture which is "AND, OR, add, sub, slt, NOR".
In this architecture, these operations would take 4 bits to encode which we'll call the control, as there are only 6 operations. In addition, we'd have to take two 32 bit values as input and return a 32 bit value as output along with 3 1 bit flags. (Details listed here)
At a really high level, we'd use the 4 bit control, along with the two 32 bit inputs to return the 32 bit result and the 3 1 bit flags. So couldn't each control act as an offset to our cache, and use the input values to index into our lookup? We could even squeeze out some more memory for operations that have the commutative property (1+2 = 2+1)
I'm aware this is goofy question but I was curious if anyone had any insight. Perhaps it could be faster? If not, maybe use less electricity or generate less heat? At the very least it's interesting.