Mail Archives: djgpp/1997/02/13/19:18:22
Benjamin D Chambers <chambersb AT juno DOT com> wrote in article
<19970210 DOT 173501 DOT 4967 DOT 2 DOT chambersb AT juno DOT com>...
> Well, some of you may recall that a while ago I was challenged to PROVE
> (with code) that shifts are faster than MUL's for equivelant arithmetic.
> Actually, I couldn't QUITE do this - based on the minimum execution time
> of 13 cycles for a mul (on a 486, sorry Pentium folks) I couldn't find
> ANY number in the range 1-65536 that would take even this long. If
> someone think's they've found one, let me know and I'll take a look.
That's a interesting question. First do you time the execution time? On
P5's you
can take the TSC, but 486? Then, have you coded your test code in ASM or C.
If C, the
compiler may generate shifts and lea instruction instead of muls if he
knows the values
at compile time.
--
Michael Beck beck AT dgroup DOT de
- Raw text -