At Wed, 3 Oct 2001 09:31:26 +0300,

Quote:

>> The charm of this operator, as well as */ and /MOD, is that

>> virtually all CPUs _do_ naturally produce a double product

>> from multiplication and divide a double by single giving both

>> quotient and product.

>OK. I was hoping that there was some nifty */MOD specific

>implementation trick for CPUs that didn't do that naturally.

>The reason I asked is that the Forth implementations that I've

>looked at for doubly or division challenged systems all first

>implement UM/MOD with a horrendously slow bit shifting algorithm,

>and then use it to implement other division-like operations.

>> AFAIK Forth is the only high-level language to take advantage

>> of this feature. Of course, to get the advantage you have to

>> code these operators in assembler.

>The more I think about this the cooler it is. It's a shame

>conventional languages throw away the hard work of the processor

>in discarding remainders and high bits of multiplications. It's

>probably the single result per operation reason that's keeping

>them back. :)

The problem is with processors which have no 32-bit and 32-bit to

64-bit multiplication instructions (such as ARM). I'm now trying to

implement all the arithmetic and logical words, and I've run into the

problem that such multiplication will have to be implemented in

software (division is also bad, because there is no division

instructions whatsoever on ARM). Does anyone know of 32-bit and

32-bit to 64-bit multiplication algorithms and 64-bit and 32-bit to

32-bit and 32-bit integer division/modulus assembly code for ARM?

--

Yes, I know my enemies.

They're the teachers who tell me to fight me.

Compromise, conformity, assimilation, submission, ignorance,

hypocrisy, brutality, the elite.

All of which are American dreams.

- Rage Against The Machine