cmd/compile: strength reduce floating point #19827
In cases where it doesn't affect correctness, we could strength reduce some floating-point ops.
For the divide->multiply reduction, we could do any value whose reciprocal is representable exactly. Is that just powers of two?
We already do x1,x-1,x/1,x/-1.
See issue #19819
For amd64, the Agner Fog tables say that turning an
Conversely, on arm64, there may not be a win. Both
Division, on the other hand, appears to be consistently more expensive (dozens of cycles of result latency... up to 64 on the A57).
x*2 -> x+x is almost certainly a win.
x*-2 -> -(x+x) is less clear. I could be convinced either way.