Port-vax archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: New Vax - future directions :-)

> On Jul 6, 2021, at 10:46 AM, Johnny Billquist <bqt%Update.UU.SE@localhost> wrote:
> On 2021-07-06 15:11, Paul Koning wrote:
>>> On Jul 6, 2021, at 5:08 AM, Johnny Billquist <bqt%Update.UU.SE@localhost> wrote:
>>> ...
>>> Well, the processor handbook even have the description on how you use EMUL and MUL to do multiplication of two 64-bit values. Without EMUL it becomes a much larger and more tedious process to multiply 64-bit values. But yes, it's only usable for signed multiplications. Which is annoying. (And is the same problem on the PDP-11.)
>> Turning a signed multiply into an unsigned one isn't very hard.  Unsigned div is another matter, unfortunately.
> Hmm. I tried to figure that one out before, without much success. I've done various silly things like halfing a value if it's too big, and then double the end result, and other silly things. But they all feel rather unelegant.
> You have a better way?

Yes, but it's been a while since I went through all the details.  The basic idea is that in x *unsigned y, if the upper bit of x is set, the result equals (x *signed y) + (y << wordlength).  If both x and y have the upper bit set it gets only slightly more complicated.


Home | Main Index | Thread Index | Old Index