On Mon, 2005-09-26 at 19:36, Sam Varshavchik wrote:
Nick Simicich writes:
I have no trouble compiling and executing this program on my 32 bit
Intel box. Just because I do not have 64 bit memory hardware does not
mean that I can't do 64 bit arithmetic - or have a 64 bit file.
And it doesn't mean that all 32-bit platforms implement 64-bit integer
arithmetic, neither does it mean that file sizes are stored in 64-bit
quantities.
[in all implementations, I presume].
Right. But my original comment was aimed at the incorrect claim that
the user in question would have to buy 64 bit hardware before they could
run 64 bit arithmetic. The "64 bit hardware" comment usually refers to
the size of the addressing in a single address space, and perhaps some
of the addressing busses. There has been hardware support for 64 bit
integer arithmetic (albeit limited) since the IBM 360, in the 1960s and
probably before that, that is just the oldest I am familiar with.
Someone, perhaps you, implied that it was essential to move to 64 bit
hardware to process numbers larger than 32 bits. That is patently false.
My little example program was designed to prove that. By the way, the
program also runs on Redhat 7.1, which is a couple years old and
predates the cheap 32 bit hardware (although there was plenty at the
time).
As a point, when you look at the generated assembler (try -S -o
whatever.s) there seem to be individual instructions that work on 32 bit
sections - this happens with the older assembler (and remarkably, with
the new assembler, and those indvidual instructions are combined to do
64 bit arithmetic.