Yahoo Groups archive

68300

Index last updated: 2026-04-29 00:01 UTC

Thread

64/32 division

64/32 division

2003-02-11 by Dimiter Popoff

Hi all,

I have written an assembler (or is it a compiler?) which produces
power PC code from CPU32 sources (and more than that, but this is
another topic). To my surprise, the code length is only about
3.5 times the length for CPU32 - without the optimization, which
I have yet to make work.

I got stuck with the division 64/32 bits the CPU32 has. The PPC
has 32/32 - and that's all.
 I know how to do it in a loop - have done it for several CPUs before.
 I also know how to do it using the FPU the PPC has - but I don't want
to do so, the on/off switch for the FPU is privileged while the divide
is user level.

 I still hope I am overlooking some obvious way to do the division
using the divide 32/32 plus a couple of shifts (like left-normalizing
the dividend and then right shifting back the quotient or something).
The PPC does not seem to have 'fractional division' in the sense, say,
the HC11 has (dividend*2^32/divisor would be OK for me, if I had it).

 Thanks in advance,

Dimiter

P.S. this webmail address of mine is still under test, please CC me with
your replies at tgi@....

------------------------------------------------------------------------
Dimiter Popoff
http://transgalactic.freeyellow.com

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.