Re:How does your programming language handle “minus zero” (-...
by maximilianburke on Friday March 05, 2021 @11:06AM
(#26358346)
It might be a little faster for addition and subtraction in synthetic benchmarks -- and with the use of pipelining might end up being slower overall -- but multiplication and division are considerably faster with floating point.
[ Parent
| on HN ]
Re:How does your programming language handle “minus zero” (-...
by dnautics on Friday March 05, 2021 @01:25PM
(#26360088)
division, yes, but multiplication is faster, but it's not huge. The limiting factor for multiplication is that it's O(N^2) in multiplied digits; so a 32-bit fixed point has 32x32 and IEEE fp32 multiplication has 23x23.
Re:How does your programming language handle “minus zero” (-...
by krackers on Friday March 05, 2021 @05:19PM
(#26362920)
That's assuming that you're implementing multiplication in software though, right? Since CPUs have dedicated multipliers, aren't both around a single cycle?
Re:How does your programming language handle “minus zero” (-...
by dnautics on Friday March 05, 2021 @05:50PM
(#26363258)
They are not in general (iirc 64b mult is down to 3 cycles now), but usually in an x86 cpu it can run microinstructions out of order enough so that the multiplication looks like it's finished in one cycle.