4 ms·
I meant in computational resource terms, on hardware. It's obviously a pain to actually write. > The values don't need to be cached I don't see how addition c
by Veedrac 11y ago
I meant in computational resource terms, on hardware. It's obviously a pain to actually write.
> The values don't need to be cached
I don't see how addition could be implemented in a semi-reasonable amount of time without table lookup, nor does it seem to be mentioned.
- dnautics 11y agofloating point multiplications expend considerable resources... 64-bit mult on x86 is 3 cycles, IIRC.
- Veedrac 11y agoErgo "multiplication is reasonable" rather than "very fast". 3 cycles doesn't seem like a ton to me (searching suggests it's actually 5, but that's still not a ton for a 64 bit multiply IMO).
- trsohmers 11y agoOther than mathematical correctness, which was why John started working on unums, one of the coolest things about "Unums 2.0" as shown in this presentation is that all four arithmetic operations (add, subtract, multiply, divide) can take the same time. The 64 bit IEEE FPU my company is developing is able to do add and subtract in a single cycle, a multiply or fused multiply add in 3 cycles, and a divide in 17 cycles... all of which are pretty much the fastest reasonable implementations you can get. To give you an idea of actual time to do those things, doing an add takes around 300 picoseconds, while the multiply is around 3,000 picoseconds. An order of magnitude increase in time to do an operation is a lot when it comes to hardware complexity (and thus associated area and power cost).
- Veedrac 11y agoBut, like I said, if big lookup tables work for Unums, they should also work for floats.
- pklausler 11y agoIIRC, add is 3 on Haswell, mult and fma are 5. But I'm too lazy to look it up.
- userbinator 11y agoTo put things into perspective, on the 8087 floating-point multiplication was over 100 cycles (and divisions 200+). We've come a long way since then.
- stephencanon 11y ago5 cycles latency, but two multiplications can issue every cycle. The throughput is actually greater than what's available for integer multiplication.