Perhaps one additional information. Bellow is a longer excerpt from the
translation. (muls alternative).
tmp0 = MULTIPLY16C16(wsptr[7], -FIX_0_211164243);
move.w d6,d3
muls.w #-1730,d3
if( wsptr[5] != 0 )
move.w 10(a2),d7
beq.s *+10 ; 0x00000398
tmp0 += MULTIPLY16C16(wsptr[5], FIX_1_451774981);
move.w d7,d0
muls.w #11893,d0
add.l d0,d3
if( wsptr[3] != 0 )
move.w 6(a2),136(a7)
beq.s *+12 ; 0x000003aa
My interpretation is following:
(short)*(short) -> (long)D3
(short)*(short) -> (long)D0
(long)D0 += (long)D3
That should be OK, shouldn't be?
----- Original Message -----
From: "Ben Combee" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Friday, January 10, 2003 10:49 PM
Subject: Re: CW compiler
> At 22:19 2003-1-10 +0100, you wrote:
> >I just observed very strange thing.
> >
> >By changing the source line order the same source line (multiplication)
is
> >translated either into
> >
> > movea.w d4,a0
> > move.l a0,86(a7)
> > move.l a0,d0
> > move.l #-1730,d1
> > jsr __lmul__
> > move.l d0,d3
> >
> >or into
> >
> > move.w d6,d3
> > muls.w #-1730,d3
> >
> >The second alternative seems to be optically shorter, but it actually
uses
> >register value inherited from the previous code. That's OK.
> >What I don't understand is that in one case the multiplication is
realized
> >via muls instruction, in the other a call to the emulator is used
instead.
>
> Could you show the lines of code? The first one is doing a signed 32-bit
> multiplication, while the second is doing a signed 16-bit
> multiplication. Is it possible that with one line order, you've got a
long
> temporary result that's affecting the multiplication?
>
> --
> Ben Combee <[EMAIL PROTECTED]>
> CodeWarrior for Palm OS technical lead
> Palm OS programming help @ www.palmoswerks.com
>
>
> --
> 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/