Mail Archives: djgpp/1996/07/25/17:51:17
Nissim Chudnoff <nchudnof AT mbhs DOT edu> wrote:
>Will DJGPP substitute a bit shift for a multiply by power of 2?
>I heard that if you are doing say:
>var = wow * 64
>Some compilers will place a bit shift in the output code to speed it up.
Yup. It also uses a trick with LEA that I thought was neat.
EG:
lea eax,[eax+eax*4]
is faster than:
mul eax,5
(Or, should I say, "lea %eax(%eax,4),%eax" is faster than "mul $5,
%eax")
ABW
--
I have become... Comfortably numb...
Alaric B. Williams Internet : alaric AT abwillms DOT demon DOT co DOT uk
<A HREF="http://www.hardcafe.co.uk/Alaric/">http://www.hardcafe.co.uk/Alaric/</A>
- Raw text -