Mail Archives: djgpp/1997/02/02/16:52:36
On Sun, 02 Feb 1997 08:44:50 GMT ovek AT arcticnet DOT no (Ove Kaaven) writes:
>chambersb AT juno DOT com (Benjamin D Chambers) wrote:
>
>Need help?
>After trying this out, I no longer have any doubt that gcc can make
>shifting faster than mul's, it will employ lea, sal, add, and sub in
>pretty ingenious ways (*never* resorts to mul). On my Pentium, I found
>that the multiplication with shift versions was almost double as fast
>on average as mul versions (at least the range I checked). Look at the
>generated mult.s and be impressed by gcc's optimization prowess. I
>don't have much time for further testing, so if you want to conduct
>more extensive tests, modify the generator and test code below as
>appropriate, provided you have enough RAM and stack (which I didn't
>for the entire 64K range). This also shows the power of preprocessors.
Well, what do you know???
That's almost exactly the method I was using (though it took me around 2
hours, got rather messier than this, and didn't seem to work right).
...Chambers
- Raw text -