Re: Optimizing floating point *(2^c) and /(2^c)

2010-03-30 Thread Jeroen Van Der Bossche
On 29 March 2010 19:51, Geert Bosch wrote: > > On Mar 29, 2010, at 13:19, Jeroen Van Der Bossche wrote: > >> 've recently written a program where taking the average of 2 floating >> point numbers was a real bottleneck. I've looked into the assembly >> ge

Optimizing floating point *(2^c) and /(2^c)

2010-03-29 Thread Jeroen Van Der Bossche
I've recently written a program where taking the average of 2 floating point numbers was a real bottleneck. I've looked into the assembly generated by gcc -O3 and apparently gcc treats multiplication and division by a hard-coded 2 like any other multiplication with a constant. I think, however, tha