Re: Emulating a 64-bit long with only 32 bits: code anyone?

Markus Ackermann <benji@wohnheim.uni-ulm.de>
8 Jun 2001 23:17:40 -0400

          From comp.compilers

Related articles
Emulating a 64-bit long with only 32 bits: code anyone? seanl@SPAM.jifsan.IS.cs.EVIL.umd.edu (Sean Luke) (2001-05-30)
Re: Emulating a 64-bit long with only 32 bits: code anyone? marcov@toad.stack.nl (2001-05-31)
Re: Emulating a 64-bit long with only 32 bits: code anyone? gneuner@dyn.com (2001-05-31)
Re: Emulating a 64-bit long with only 32 bits: code anyone? joewhaley@hotmail.com (John Whaley) (2001-06-03)
Re: Emulating a 64-bit long with only 32 bits: code anyone? Timothy_S_Coffey@bankone.com (2001-06-07)
Re: Emulating a 64-bit long with only 32 bits: code anyone? benji@wohnheim.uni-ulm.de (Markus Ackermann) (2001-06-08)
Re: Emulating a 64-bit long with only 32 bits: code anyone? marcov@toad.stack.nl (2001-06-08)
Re: Emulating a 64-bit long with only 32 bits: code anyone? Klaus.Bergdolt@gmx.de (2001-06-10)
Re: Emulating a 64-bit long with only 32 bits: code anyone? walter@nospamm-digitalmars.com (walter) (2001-06-14)
| List of all articles for this month |
From: Markus Ackermann <benji@wohnheim.uni-ulm.de>
Newsgroups: comp.compilers
Date: 8 Jun 2001 23:17:40 -0400
Organization: Compilers Central
References: 01-05-087
Keywords: arithmetic
Posted-Date: 08 Jun 2001 23:17:40 EDT

On 30 May 2001 00:21:12 -0400 in article 01-05-087 Sean Luke <seanl@spam.jifsan.is.cs.evil.umd.edu> wrote:
: My apologies if this is a FAQ. I'm designing a Java system for a machine
: that has only 32-bit longs (though it does have 64-bit doubles). I'm
: hoping that someone may know where you can find open source for code which
: manipulates 64-bit longs (multiply, divide, subtract, add, shift, bitwise
: and logical operations, etc.) using only 32 bits, using a structure like


: struct _LONG { int hi, int lo }


: ... as a "long" representation. I believe that Sun's KVM java code has
: stuff like this, but unfortunately Sun's license is too restrictive. ;-(
: Can anyone help here?


Have a look at Donald E. Knuth's MMIXware [1]. There you'll find a
complete C implementation of 64-bit integer and floating-point
arithmetics for 32-bit systems. The code is written in Don Knuth's
literate programming system CWEB and very well documented. As usual
with Don Knuth's code it is in the public domain.


[1] http://www-cs-faculty.stanford.edu/~knuth/mmixware.html)


: Sean Luke


Markus Ackermann


--
Markus Ackermann, Seb.-Kneipp-Weg 6, 89075 Ulm/Donau, +49-731-51451


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.