This integer stuff explains following observations:
If there is high probability of A being zero, then it makes sense to replace
Int16 A, B, C ;
//...
C = A*B ;
with following construction
C = (A==0) ? 0 : A*B ;
The same "optimization" on Pentium brings worse results.
----- Original Message -----
From: "Alan Ingleby" <[EMAIL PROTECTED]>
Newsgroups: palm-dev-forum
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Friday, January 10, 2003 4:31 AM
Subject: Re: How fast is the Palm?
> "Ron Nicholson" <[EMAIL PROTECTED]> wrote in message
> news:108293@palm-dev-forum...
> > >One other point to note is that the DB processor cannot multiply 32 bit
> > >integers. This is emulated transparently by the compiler, so it isn't
> > >immediately obvious. Watch out for 32 bit multiplies.
> > Actually, the 68000 CPU core cannot do any hardware multiplies;
> > all multiplies are emulated. There are 68k 16x32 MULU and MULS
> > instructions, but they emulated in microcode by double pumping
> > the 16-bit adder, and thus takes 40 or 42 clock cycles to complete.
>
> Err.. I'd say you're nitpicking here. IIRC many of the 68k instructions
> take more than 10 cycles to complete, I just wouldn't call them "emulated"
> if the CPU natively knows what to do with them.
>
> What I'm talking about is 32x32 multiplies which effectively take a
several
> hundred clock cycles to execute. (IIRC, CW creates an inline function
which
> includes at least three MUL* opcodes.)
>
> Alan
>
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/