 |
 |
|
 |
|
 |
|  |
|  |
|
 |
From: Warp
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 1 Aug 2006 17:31:26
Message: <44cfc82e@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Alain <ele### [at] netscape net> wrote:
> both 32 and 64 bits CPUs use 64 bits FPUs
Actually Intel (and compatible) processors use 80-bit floating point
numbers internally. I don't know why, but they just do.
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp <war### [at] tag povray org> wrote:
>
> A 64-bit processor has 64-bit registers. That's about it. All the
> opcodes are still the same (well, mostly).
>
> I don't know what you think a 64-bit processor is, but it's basically
> the exact same thing as a 32-bit processor with the only difference that
> registers are 64-bit long instead of 32-bit.
>
> What does it mean that they are twice as long? It means that you can
> make integer calculations with twice as many bits and also that you can
> directly access a whole lot more of memory. How this could speed up
> anything is beyond me.
>
> - Warp
I wasn't arguing that the 64-bit processors should be twice as fast. The
answer to that question is clearly no. I was trying to explain why
reasonably intelligent people might ask the question. It's because some
integer operations may be doubled up using the extra registry space. As
you've pointed out, due to all the bit shifting and underflow/overflow
error detection, there is clearly no speed increase, and very few
operations could actually benefit from this approach anyway. However, I
think it was an excellent question to ask, and the resulting discussion
here has been enlightening. Hopefully we've all learned a lot more about
how 64-bit computing works, which was the intent to begin with. Thanks for
your contribution to the discussion (no sarcasm here).
Mike
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Warp
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 1 Aug 2006 20:14:49
Message: <44cfee79@news.povray.org>
|
|
 |
|  |
|  |
|
 |
On a side note, there are a few applications which truely benefit from
a 64-bit architecture and would be much slower in 32-bit ones.
One excellent example are computer chess programs. The best chess
computers in the world have always been 64-bit, and for a good reason:
Bitmasks of the chess board are an efficient technique to speed up
calculations. For instance, one bitmask could tell to which squares
a certain piece can move. Performing a logical and of this bitmask and
another telling the location of another piece tells the program really
fast (in 1 clock cycle or less, depending on the processor) whether the
latter can be captured by the former. This technique is used a lot in
the best chess software out there.
Now, a bitmask of the chess board requires, naturally, 64 bits (because
that's the amount of squares in the board). In a 64-bit processor it's
the size of a register, and thus performing operations on these bitmasks
is really fast. In 32-bit processors 2 registers (and thusly two operations)
would have to be used for each bitmask and each operation done to them,
making it considerably slower.
Unfortunately these special cases are rather rare, and for example
POV-Ray is not a program which would benefit much from 64-bit integers
(except for the added address space if there's more than 4 gigabytes
of memory in the computer).
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Tim Cook
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 2 Aug 2006 00:49:37
Message: <44d02ee1$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
So what's all the hubbub over 32-bit processors? Aren't they slower
than 16-bit CPUs in exactly the same way as 64s are to 32s? It just
take longer to assign anything and nothing needs the precision other
than some specialized applications. Besides, nobody needs more than 640
kB of RAM...
*wink*
--
Tim Cook
http://home.bellsouth.net/p/PWP-empyrean
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GFA dpu- s: a?-- C++(++++) U P? L E--- W++(+++)>$
N++ o? K- w(+) O? M-(--) V? PS+(+++) PE(--) Y(--)
PGP-(--) t* 5++>+++++ X+ R* tv+ b++(+++) DI
D++(---) G(++) e*>++ h+ !r--- !y--
------END GEEK CODE BLOCK------
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Stefan Viljoen
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 2 Aug 2006 02:19:06
Message: <44d043d9@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Mike Sobers spake:
> I wasn't arguing that the 64-bit processors should be twice as fast. The
> answer to that question is clearly no. I was trying to explain why
> reasonably intelligent people might ask the question. It's because some
> integer operations may be doubled up using the extra registry space. As
> you've pointed out, due to all the bit shifting and underflow/overflow
> error detection, there is clearly no speed increase, and very few
> operations could actually benefit from this approach anyway. However, I
> think it was an excellent question to ask, and the resulting discussion
> here has been enlightening. Hopefully we've all learned a lot more about
> how 64-bit computing works, which was the intent to begin with. Thanks
> for your contribution to the discussion (no sarcasm here).
>
> Mike
Hi Mike
Thanks, that's a rational view. It seems like sometimes in here stupid
people (like me) aren't allowed to ask stupid questions about stuff they
don't understand, because they promptly get beaten over the head with their
own question. :)
I've always liked the Pov group, cause you get so few elitist and "you're
stupid for even asking that! How can you even -think- that? Explain your
stupidity RIGHT NOW!" type answers in here. Guess that's changing.
But then, that's the POINT of asking a question - why ask a question (or
answer them) if you are omniscent and already know everything about
everything? Must be boring knowing everything about everything - nothing
new to learn or discover...
I just thought 64 is twice 32 , so it's got to be good for -something- and
do -something- better than a 32 bit processor. As you point out, it seemed
logical that -something- is twice -something- else - ok, its the register
sizes. So what? Now I know. No harm done.
--
Stefan Viljoen
Software Support Technician / Programmer
Polar Design Solutions
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Warp
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 2 Aug 2006 04:35:11
Message: <44d063be@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Stefan Viljoen <spamnot@ <removethis>polard.com> wrote:
> Thanks, that's a rational view. It seems like sometimes in here stupid
> people (like me) aren't allowed to ask stupid questions about stuff they
> don't understand, because they promptly get beaten over the head with their
> own question. :)
I was just asking, out of curiosity, what is it that makes some people
believe that a 64-bit system should/might be twice as fast (or just faster
by some degrees) than an equivalent 32-bit system.
It just feels that people never stop to think rationally about these
things. "What does it actually mean that it's a 64-bit system?" After
one thinks about that question and comes to a rational answer then one
should/may perhaps realize that there's no logical reason why a 64-bit
system should be twice as fast as a 32-bit system.
Perhaps one reason might be that the popularization of 64-bit desktop
systems (64-bitness has always been something only popular in obscure
big servers until now) as well as the popularization of dual-core desktop
systems (again, multiple processors have been something only used in
obscure big servers until now) have coincided, and thus people might
get those two things mixed up and think that they are somewhat related
(even though they really aren't; their popularization in desktop systems
at the same time is just coincidence).
Most people are also probably too young to remember the shift from
16-bit systems to 32-bit systems in Intel-based computers and have never
experienced first-hand the speed difference between a 16-bit binary
compared to a 32-bit binary (if they do the same thing there's basically
no speed difference except when big amounts of memory are needed or if
32-bit arithmetic is a very relevant part of the program's calculations).
> I just thought 64 is twice 32
Did you stop to think *what* is it that is "twice"? What it could
possibly be?
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Ger
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 2 Aug 2006 05:27:43
Message: <44d0700e@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Warp wrote:
> Stefan Viljoen <spamnot@ <removethis>polard.com> wrote:
>> Thanks, that's a rational view. It seems like sometimes in here stupid
>> people (like me) aren't allowed to ask stupid questions about stuff they
>> don't understand, because they promptly get beaten over the head with
>> their own question. :)
>
> I was just asking, out of curiosity, what is it that makes some people
> believe that a 64-bit system should/might be twice as fast (or just faster
> by some degrees) than an equivalent 32-bit system.
>
> It just feels that people never stop to think rationally about these
> things. "What does it actually mean that it's a 64-bit system?" After
> one thinks about that question and comes to a rational answer then one
> should/may perhaps realize that there's no logical reason why a 64-bit
> system should be twice as fast as a 32-bit system.
>
> Perhaps one reason might be that the popularization of 64-bit desktop
> systems (64-bitness has always been something only popular in obscure
> big servers until now) as well as the popularization of dual-core desktop
> systems (again, multiple processors have been something only used in
> obscure big servers until now) have coincided, and thus people might
> get those two things mixed up and think that they are somewhat related
> (even though they really aren't; their popularization in desktop systems
> at the same time is just coincidence).
>
> Most people are also probably too young to remember the shift from
> 16-bit systems to 32-bit systems in Intel-based computers and have never
> experienced first-hand the speed difference between a 16-bit binary
> compared to a 32-bit binary (if they do the same thing there's basically
> no speed difference except when big amounts of memory are needed or if
> 32-bit arithmetic is a very relevant part of the program's calculations).
>
>> I just thought 64 is twice 32
>
> Did you stop to think *what* is it that is "twice"? What it could
> possibly be?
>
On the other hand, did you stop to think that not everybody is familiar with
the inner workings of a computer? That there are actually very few people,
compared to the numbers that use them, that are knowlegable about the inner
workings?
Looking back I can see the validity in Stefan's reasoning.
--
Ger
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Vincent Le Chevalier
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 2 Aug 2006 05:34:45
Message: <44d071b5$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Warp a écrit :
> Perhaps one reason might be that the popularization of 64-bit desktop
> systems (64-bitness has always been something only popular in
> obscure big servers until now) as well as the popularization of
> dual-core desktop systems (again, multiple processors have been
> something only used in obscure big servers until now) have coincided,
> and thus people might get those two things mixed up and think that
> they are somewhat related (even though they really aren't; their
> popularization in desktop systems at the same time is just
> coincidence).
>
Implying that 64-bits systems are generally better or faster than
32-bits ones might also be related to the habit of measuring the
performance, or rather generation, of game consoles in terms of bits. I
remember clearly the time when every review was speaking of 8-bits,
16-bits, 32-bits, etc. Hey, I even think the first time I heard of bits
was actually in this context :-)
Roughly each generation was doubling the "bits", so it was in the end
associated with performance. Maybe some remnants of that habit among the
people who played consoles explain the misunderstanding...
On a related note, I wonder if raster graphics are sped up when there
are more bits in the registers ? The evolution of game consoles would
suggest so, but I'm not sure of where GPUs are in terms of bitness, they
could be working in a different bitness than the processor...
In the light of this discussion, one has to wonder why would the average
desktop user need a 64-bit system anyway. Are we going to eat up 4GB of
RAM using word processors and browsing the web ? Talk about bloat :-)
--
Vincent
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Nicolas George
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 2 Aug 2006 05:35:29
Message: <44d071e1$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Warp wrote in message <44cfee79@news.povray.org>:
> (except for the added address space if there's more than 4 gigabytes
> of memory in the computer).
Actually, you do not need more than 4GB of physical memory to get the
advantages of 64bit addressing: it is enough to have more than 4GB
(actually, 3 or so, on most modern operating systems, because the kernel
keeps some address space for itself) of _virtual_ memory.
Sometimes, it is faster to let the system handle swapping on a few page
faults than put tests and indirections everywhere in the program to check
for the availability of such or such data structure.
Sometimes, it is much slower, agreed. This depends completely on the shape
of the memory access of the program, and it is something very hard to
predict. But it is always much _simpler_ to rely on the system's virtual
memory.
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Warp
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 2 Aug 2006 08:39:55
Message: <44d09d1b@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Nicolas George <nicolas$george@salle-s.org> wrote:
> Sometimes, it is faster to let the system handle swapping on a few page
> faults than put tests and indirections everywhere in the program to check
> for the availability of such or such data structure.
I didn't understand this. What "such or such data structure" are you
talking about, and what does virtual memory has to do with that?
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Warp
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 2 Aug 2006 08:44:49
Message: <44d09e40@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Vincent Le Chevalier <gal### [at] libertyallsurfsp amfr> wrote:
> In the light of this discussion, one has to wonder why would the average
> desktop user need a 64-bit system anyway. Are we going to eat up 4GB of
> RAM using word processors and browsing the web ? Talk about bloat :-)
Remember the time when a 100MB hard disk was HUGE? Probably many thought
back then "why would the average user need such a huge hard disk?"
This was probably the case with every major developement in computers.
And history shows us that even though we *now* can't think of anything
really necessary, there *will* be something. Resources create the needs.
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Nicolas George
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 2 Aug 2006 10:03:17
Message: <44d0b0a5$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Warp wrote in message <44d09d1b@news.povray.org>:
> I didn't understand this. What "such or such data structure" are you
> talking about, and what does virtual memory has to do with that?
Let us take a simple case: assume you have a simple but big list of big
objects. First, let us assume that all the objects fit in memory. Then, you
only have to use a big array of pointers to the objects, and everything is
said.
But if all the objects do not fit in memory, you will need to store some of
them on hard disk while you do not use them. For each object, either the
pointer is not null, and gives the address of the object, or it is null, and
the object is not present in memory, but saved in a file called
objXXXXXXXX.swap (where XXXXXXXX is the number of the object). Each time you
want to access an object, you have to check if the pointer is null; if it is
null, you have to pick another object and save it to disk to make room, and
load the object you want.
Saving and loading objects is a painful task. Checking for null pointers
everywhere makes your code more complex and slower. Furthermore, if your
data structure is more complex than an array of big objects, you have to
somehow store the status of each swappable part so it is always available,
which means using a pointer to pointer-or-null instead of a direct pointer.
Last of all, if your program is multithreaded, you have to lock even
read-only data structures to prevent it from being swapped out by another
thread. And you also need to make statistics usage of your object, to avoid
swapping out an object you will need a few milliseconds later.
Good news: all this is in fact built in the modern processors and operating
systems. For all memory references, processors are able to use the address
not as a direct reference to physical memory, but as a reference to a
translation table; they can suspend the course of the program and start a
specific processing if the translation table shows that the target is not
available; they can also maintain very basic statistics about access to
these references. Operating systems use these facilities, filling the
translation table and handling unavailable references, to provide to its
processes a virtual memory potentially much bigger than the physical memory
of the computer.
For example, on a host with 16 MB of memory and more than 2 GB of hard
drive, a process could run as if it had 2 GB of memory, the OS copying
chunks of memory to and from hard drive as needed. Depending on the pattern
of the memory accesses of the process, the result can be almost as fast as
if the computer actually had 2 GB of memory, or awfully slow.
In the cases where the result is bad, doing the swapping "by hand" as I
described earlier may give better results, because it is possible to use a
knowledge of the algorithm to better select parts of the data structure to
swap out or pre-fetch. But most of the time it will not do much good,
because some algorithms just can not be swapped. Thus, it is often better to
just let the OS do its work.
Anyway, such a mechanism is limited by the size of the input to the
translation mapping, compared to the size of the target objects. When it is
done explicitly, those can be chosen to match exactly the needs of the
program. On the other hand, when relying on the processor facilities,
everything is limited by the pointer size. So on a 32 bit processor, a
process can never see more than 4 GB of (virtual) memory at once. Everything
beyond must be done explicitly.
In a time when a computer with 32 GB of memory and 4 GB of hard drive was a
very powerful computer, that was quite ok. But in a time when any
supermarket computer has 1 GB of memory and 200 GB of hard drive, it is time
to step forward.
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Darren New
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 2 Aug 2006 13:06:53
Message: <44d0dbad@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Warp wrote:
> I was just asking, out of curiosity, what is it that makes some people
> believe that a 64-bit system should/might be twice as fast (or just faster
> by some degrees) than an equivalent 32-bit system.
Analogies with other things that work that way, like a V-8 engine having
twice the acceleration than a 4-banger.
> It just feels that people never stop to think rationally about these
> things. "What does it actually mean that it's a 64-bit system?"
And some folks don't even know that much, before they ask. Some people
learn this stuff from the top down, as it were. :-)
--
Darren New / San Diego, CA, USA (PST)
This octopus isn't tasty. Too many
tentacles, not enough chops.
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Larry Hudson
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 2 Aug 2006 19:25:40
Message: <44d13474$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Warp wrote:
>
> Most people are also probably too young to remember the shift from
> 16-bit systems to 32-bit systems in Intel-based computers and have never
> experienced first-hand the speed difference between a 16-bit binary
> compared to a 32-bit binary (if they do the same thing there's basically
> no speed difference except when big amounts of memory are needed or if
> 32-bit arithmetic is a very relevant part of the program's calculations).
>
I even remember the shift from 8 to 16 bit systems. :-)
I started with an Altair -- anybody remember them???
8080 processor running at 2Mhz. It even started with a whopping 1K of
memory!
-=- Larry -=-
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Thomas de Groot
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 4 Aug 2006 03:07:26
Message: <44d2f22e$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
"Ger" <No.### [at] Thank You> schreef in bericht
news:44d0700e@news.povray.org...
>
> On the other hand, did you stop to think that not everybody is familiar
> with
> the inner workings of a computer? That there are actually very few people,
> compared to the numbers that use them, that are knowlegable about the
> inner
> workings?
> Looking back I can see the validity in Stefan's reasoning.
> --
I totally agree!!!
Myself, I have not the slightest idea how that box to my left works. But as
long as it does what I ask it to do, I am fine :-)
To tell the truth, beyond a basic knowledge, I don't want to know about the
inner machinery.
Thomas
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Warp
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 4 Aug 2006 04:41:07
Message: <44d30822@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Thomas de Groot <t.d### [at] inter nl net> wrote:
> To tell the truth, beyond a basic knowledge, I don't want to know about the
> inner machinery.
You don't *want* to know? Why? Some weird principle?
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Thomas de Groot
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 4 Aug 2006 08:46:24
Message: <44d341a0@news.povray.org>
|
|
 |
|  |
|  |
|
 |
"Warp" <war### [at] tag povray org> schreef in bericht
news:44d30822@news.povray.org...
> Thomas de Groot <t.d### [at] inter nl net> wrote:
>> To tell the truth, beyond a basic knowledge, I don't want to know about
>> the
>> inner machinery.
>
> You don't *want* to know? Why? Some weird principle?
>
Well, just because I feel it is a waste of time for me.
I have a PC for doing things I want it to do, I don't need nor want to know
(most of the time) why or how it does it. I just don't have the basic
knowledge and, frankly speaking, I have more interesting things to do.
This said however, I am always curious about what is said on the matter in
the ng's by those who are more knowledgeable :-) just gleaning here and
there a little bit of information that I may need some day.
I am fairly certain that there are a lot of people like me around here.
Thomas
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Ger
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 4 Aug 2006 09:15:01
Message: <44d34855@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Thomas de Groot wrote:
>
> Well, just because I feel it is a waste of time for me.
>
> I have a PC for doing things I want it to do, I don't need nor want to
> know (most of the time) why or how it does it. I just don't have the basic
> knowledge and, frankly speaking, I have more interesting things to do.
>
> This said however, I am always curious about what is said on the matter in
> the ng's by those who are more knowledgeable :-) just gleaning here and
> there a little bit of information that I may need some day.
>
> I am fairly certain that there are a lot of people like me around here.
>
Compare the number of people that know how a car functions to the number of
people driving a car. Same thing goes for computers. In the end they are
nothing but a tool to get something done.
--
Ger
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Thomas de Groot
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 4 Aug 2006 10:06:42
Message: <44d35472$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
"Ger" <No.### [at] Thank You> schreef in bericht
news:44d34855@news.povray.org...
>
> Compare the number of people that know how a car functions to the number
> of
> people driving a car. Same thing goes for computers. In the end they are
> nothing but a tool to get something done.
> --
Exactly my point.
Thomas
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Larry Hudson <org### [at] yahoo com> wrote:
> Warp wrote:
> >
> > Most people are also probably too young to remember the shift from
> > 16-bit systems to 32-bit systems in Intel-based computers and have never
> > experienced first-hand the speed difference between a 16-bit binary
> > compared to a 32-bit binary (if they do the same thing there's basically
> > no speed difference except when big amounts of memory are needed or if
> > 32-bit arithmetic is a very relevant part of the program's calculations).
> >
> I even remember the shift from 8 to 16 bit systems. :-)
> I started with an Altair -- anybody remember them???
> 8080 processor running at 2Mhz. It even started with a whopping 1K of
> memory!
>
> -=- Larry -=-
I remember the shift to 8 bit from 4 bit. In fact I’ve got a “4 bit” Casio
calculator hiding some where. Now that my job does not depend on it like
Thomas I don’t care what’s under the bonnet (hood) as long as it goes and
goes fast enough.
Stephen
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
I've run benchmarks on my computer comparing 64-bit povray vs. 32-bit
povray. See for yourself:
sempron 1.6 GHz 32-bit kernel, 32-bit povray, sse2
Total Time: 0 hours 34 minutes 41.0 seconds (2081 seconds)
sempron 1.6 GHz 64-bit kernel, 32-bit povray
Total Time: 0 hours 36 minutes 41 seconds (2201 seconds)
sempron 1.6 GHz 64-bit kernel, 64-bit povray gcc 3.4
Total Time: 0 hours 29 minutes 27 seconds (1767 seconds)
duron 1.6 GHz
Total Time: 0 hours 40 minutes 46.0 seconds (2446 seconds)
So there you go: a 17.7% increase in rendering time on the benchmark scene.
Of course, as others have pointed out, there probably won't be a speedup on
architectures that were 64-bit to begin with.
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Eero Ahonen
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 5 Aug 2006 03:54:32
Message: <44d44eb8@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Warp wrote:
>
> I was just asking, out of curiosity, what is it that makes some people
> believe that a 64-bit system should/might be twice as fast (or just faster
> by some degrees) than an equivalent 32-bit system.
>
It has lately been common to explain that the CPU MHz doesn't actually
tell the speed of the computer, but just part of it. While most PC-users
has never heard of eg. Sun Ultrasparcs, the AMD64 is the first 64-bit
system to them. And like you said, it has a bunch of features to run
faster. Optimizing in 64-bit mode, yes, but also eg. the integrated
memory controller. Opteron handles memory a _lot_ faster than same aged
Xeon.
That's one thing to make 64bit faster than 32bit - in people's mind.
Just my 2 cents.
--
Eero "Aero" Ahonen
http://www.zbxt.net
aer### [at] removethis zbxt net invalid
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Eero Ahonen
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bitopsys?
Date: 5 Aug 2006 03:59:47
Message: <44d44ff3$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Darren New wrote:
>
> Analogies with other things that work that way, like a V-8 engine having
> twice the acceleration than a 4-banger.
Which is also poop ;).
--
Eero "Aero" Ahonen
http://www.zbxt.net
aer### [at] removethis zbxt net invalid
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Warp
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 6 Aug 2006 11:45:49
Message: <44d60ead@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Thomas de Groot <t.d### [at] inter nl net> wrote:
> Well, just because I feel it is a waste of time for me.
Information is never a waste of time.
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Eero Ahonen
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 6 Aug 2006 13:50:31
Message: <44d62be7$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Warp wrote:
> Thomas de Groot <t.d### [at] inter nl net> wrote:
>
>>Well, just because I feel it is a waste of time for me.
>
>
> Information is never a waste of time.
>
It also may be a waste of other resources, too.
--
Eero "Aero" Ahonen
http://www.zbxt.net
aer### [at] removethis zbxt net invalid
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Thomas de Groot
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 7 Aug 2006 03:11:51
Message: <44d6e7b7$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
"Warp" <war### [at] tag povray org> schreef in bericht
news:44d60ead@news.povray.org...
> Thomas de Groot <t.d### [at] inter nl net> wrote:
>> Well, just because I feel it is a waste of time for me.
>
> Information is never a waste of time.
>
True. I agree. But if you lack the knowledge to appreciate particular
information, then it becomes random noise so to speak :-)
What I mean is that instead of spending (precious) time struggling through
information I do not really understand, I prefer to concentrate upon what I
need to do. Time is short...
Thomas
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Warp
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 7 Aug 2006 07:36:59
Message: <44d725db@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Thomas de Groot <t.d### [at] inter nl net> wrote:
> What I mean is that instead of spending (precious) time struggling through
> information I do not really understand, I prefer to concentrate upon what I
> need to do. Time is short...
And then, when you don't have even the most basic information, you make
all kinds of wrong assumptions, mistakes and, in the worst case, a fool
of yourself.
Basic information is never useless.
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Thomas de Groot
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 7 Aug 2006 10:49:12
Message: <44d752e8$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
"Warp" <war### [at] tag povray org> schreef in bericht
news:44d725db@news.povray.org...
>
> And then, when you don't have even the most basic information, you make
> all kinds of wrong assumptions, mistakes and, in the worst case, a fool
> of yourself.
>
> Basic information is never useless.
>
That also is true. Except for the fool, as I believe that one should not
peremptorily offer advice about things one does not know anything about. But
asking questions or even making wrong assumptions is never foolish.
Still, I do not want to know how my car does what it does (I mean:
transporting me from A to B and back again)... :-)
Thomas
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Alain
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 7 Aug 2006 20:59:09
Message: <44d7e1dd$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Warp nous apporta ses lumieres en ce 01/08/2006 17:31:
> Alain <ele### [at] netscape net> wrote:
>> both 32 and 64 bits CPUs use 64 bits FPUs
>
> Actually Intel (and compatible) processors use 80-bit floating point
> numbers internally. I don't know why, but they just do.
>
OK then. So, as long as your results STAY in the FPU and you keep on reusing
them, you can keep an improved acuracy. But, as soon as you need to put your
results anywhere else, you fall back to 64 bits acuracy. Would be good if you
could preserve those extra 16 bits. This would open up double and half precision
FP numbers.
--
Alain
-------------------------------------------------
SHOPPING MATH
A man will pay $20 for a $10 item he needs.
A woman will pay $10 for a $20 item that she doesn't need.
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Alain
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bitopsys?
Date: 7 Aug 2006 21:12:32
Message: <44d7e500$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Tim Cook nous apporta ses lumieres en ce 02/08/2006 00:49:
> So what's all the hubbub over 32-bit processors? Aren't they slower
> than 16-bit CPUs in exactly the same way as 64s are to 32s? It just
> take longer to assign anything and nothing needs the precision other
> than some specialized applications. Besides, nobody needs more than 640
> kB of RAM...
>
> *wink*
>
The early 32 bit processors where indead a bit slower than contemporary 16 bit
ones. Also, early 32 bit programms where almost always slower than 16 bit
versions when running on the same 32 bit processor. It's worth noting that
almost all 16 bit processors had at least 20 bit address bus, up to maybe 32 for
the latest. Also, ALL 8 bit CPU had 16 bit address path before the 8086 (20 bit
address space).
--
Alain
-------------------------------------------------
You can go anywhere you want if you look serious and carry a clipboard.
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Warp
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 8 Aug 2006 05:46:01
Message: <44d85d58@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Alain <ele### [at] netscape net> wrote:
> OK then. So, as long as your results STAY in the FPU and you keep on reusing
> them, you can keep an improved acuracy. But, as soon as you need to put your
> results anywhere else, you fall back to 64 bits acuracy.
Not really. You can store the numbers in memory using the 80-bit
accuracy. In C/C++ you can usually do that with the 'long double' type.
I don't know, however, if there's a speed penalty in storing/reading
memory in units larger than 64 bits...
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Alain
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 8 Aug 2006 09:29:56
Message: <44d891d4@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Warp nous apporta ses lumieres en ce 08/08/2006 05:46:
> Alain <ele### [at] netscape net> wrote:
>> OK then. So, as long as your results STAY in the FPU and you keep on reusing
>> them, you can keep an improved acuracy. But, as soon as you need to put your
>> results anywhere else, you fall back to 64 bits acuracy.
>
> Not really. You can store the numbers in memory using the 80-bit
> accuracy. In C/C++ you can usually do that with the 'long double' type.
>
> I don't know, however, if there's a speed penalty in storing/reading
> memory in units larger than 64 bits...
>
Probably, one more write/read operation. You also have word alignment concerns,
the extra 16 bits = 1/2 word, 1/4 word on 64 bit platform.
How long before we get quad, 128 bit, precision FPU?
--
Alain
-------------------------------------------------
Fighting for peace is like screwing for virginity.
- The Bayou, Baton Rouge , LO
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Tue, 08 Aug 2006 11:46:01 +0200, Warp <war### [at] tag povray org> wrote:
> Alain <ele### [at] netscape net> wrote:
>> OK then. So, as long as your results STAY in the FPU and you keep on
>> reusing
>> them, you can keep an improved acuracy. But, as soon as you need to put
>> your
>> results anywhere else, you fall back to 64 bits acuracy.
>
> Not really. You can store the numbers in memory using the 80-bit
> accuracy. In C/C++ you can usually do that with the 'long double' type.
Not with a Microsoft C++ compiler though. In their infinite wisdom they
chose the 64-bit type for both 'double' and 'long double'.
> I don't know, however, if there's a speed penalty in storing/reading
> memory in units larger than 64 bits...
There was on the original Pentium. Newer processors may have wider data
paths though.
--
FE
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Warp
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 8 Aug 2006 20:36:20
Message: <44d92e04@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Fredrik Eriksson <noo### [at] nowhere com> wrote:
> Not with a Microsoft C++ compiler though. In their infinite wisdom they
> chose the 64-bit type for both 'double' and 'long double'.
It's the same wisdom that makes 'long' 32-bit even when compiling to
a 64-bit binary... (This is the only compiler in the world that I know
of which does that.)
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Mike Sobers" <sob### [at] mindspring com> wrote:
> Your question was "why do some people think it could be twice as fast?".
> It's because some people understand math and binary operations, but not
> neccessarily how computer architecture is designed around them. That's why
> the question was asked in the first place, because a lot of us have a lot to
> learn about what advantages the new higher-precision hardware/software will
> provide.
>
> Mike
Well said! And, I might add, it shouldn't be necessary for us POV users to
have to become computer scientists or programming/architecture experts just
in order to understand why 64-bit POV on a 64-bit machine is faster (or
slower) than the 32-bit one. Simple, real-world benchmarks would
suffice...not a lot of holier-than-though technical browbeating.
Ken W.
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Warp
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 10 Aug 2006 17:15:40
Message: <44dba1fb@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Kenneth <kdw### [at] earthlink net> wrote:
> And, I might add, it shouldn't be necessary for us POV users to
> have to become computer scientists or programming/architecture experts just
> in order to understand why 64-bit POV on a 64-bit machine is faster (or
> slower) than the 32-bit one.
If someone doesn't understand the difference between a 32-bit and a
64-bit processor and has the misconception that the latter will be
twice (or at least considerably) faster than the former and makes a
buying decision based on that misconception, he is up to a disappointment.
I don't think it's a bad thing to know the real difference.
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Warp <war### [at] tag povray org> wrote:
> Kenneth <kdw### [at] earthlink net> wrote:
> > And, I might add, it shouldn't be necessary for us POV users to
> > have to become computer scientists or programming/architecture experts just
> > in order to understand why 64-bit POV on a 64-bit machine is faster (or
> > slower) than the 32-bit one.
>
> If someone doesn't understand the difference between a 32-bit and a
> 64-bit processor and has the misconception that the latter will be
> twice (or at least considerably) faster than the former and makes a
> buying decision based on that misconception, he is up to a disappointment.
> I don't think it's a bad thing to know the real difference.
>
> --
> - Warp
Yes, but how much arcane knowledge are any of us, as individuals, expected
to know? Echoing the sentiments expressed earlier, we all have to pick and
choose what we devote our time to learning. My refrigerator keeps my food
cold, but do I really need to know how the refrigeration cycle works in
order to use it (or buy one?) It's a bit unfair to assume that all of us
out here *should* know all about the inner workings of 64-bit processors,
and to bludgeon us if we don't. Processor architecture may be one of your
own prime interests, I don't know; but there are many of us (judging from
these posts) that *just don't need to know* such stuff. (Hey, I'm still
trying to learn POV-Ray!)
HOWEVER, that said, I do fall into the situation you've described, having
bought a 64-bit machine--an emachines T6412-- in the (seemingly mistaken!)
belief that it WOULD run POV-Ray "twice as fast" as as equivalent 32-bit
machine. A belief based on all of the non-technical ideas expressed here
so far-- basically that 64-bit sounds like it is "twice" 32-bit. A dumb
belief? No. I think it comes from a lot of different ingredients (not the
least of which is computer manufacturer's hype.) It is indeed unfortunate
that computers, more so than just about any other technical gadget, seem to
require so VAST a store of knowledge in order to to understand (and to
purchase wisely.) Impossibly vast, IMHO. But am I disppointed with my
purchase? Not at all! The only machine I can compare it to is my old
32-bit Pentium II 400MHZ. And it runs (32-bit) POV-Ray 6X faster. That's
all I really need to know!
SO...will it run 64-bit POV-Ray faster still? I haven't yet installed that
version, but I'm inclined to think not, judging from all that has been
discussed so far. That's disappointing.
Ken W.
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Bryan Valencia
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 16 Aug 2006 13:03:41
Message: <44e34fed$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
My favorite is "Long Boolean" where true="0000000000000001" and
false="0000000000000000"
"Warp" <war### [at] tag povray org> wrote in message
news:44d92e04@news.povray.org...
> Fredrik Eriksson <noo### [at] nowhere com> wrote:
> > Not with a Microsoft C++ compiler though. In their infinite wisdom they
> > chose the 64-bit type for both 'double' and 'long double'.
>
> It's the same wisdom that makes 'long' 32-bit even when compiling to
> a 64-bit binary... (This is the only compiler in the world that I know
> of which does that.)
>
> --
> - Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Nicolas George
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 27 Aug 2006 14:29:00
Message: <44f1e46c$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Warp wrote in message <44cdf9bd$1@news.povray.org>:
> Now, the AMD64 is a special case: 64-bit binaries optimized for the
> AMD64 run slightly faster than 32-bit binaries optimized for the same
> processor. However, this speedup has nothing to do with the amount of
> bits used. It is because in 64-bit mode the CPU has enhancements which
> the binary can use for faster performance (the biggest enhancement is
> a bunch of additional CPU registers).
There is another point. I just remarked that the following code:
for(i = 0; i <= N; i++)
r += (double)i * (i / 100000000);
runs four to six times faster in 64 bits mode than in 32 bits mode on AMD64
or its intel clone, with gcc. This probably has to do with gcc using
different FPU mechanisms (SSE2 vs. x87). I am currently waiting for some of
my friends to test with different compilers and/or explain what they
understand of SSE2.
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Warp
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 27 Aug 2006 16:18:09
Message: <44f1fe00@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Nicolas George <nicolas$george@salle-s.org> wrote:
> for(i = 0; i <= N; i++)
> r += (double)i * (i / 100000000);
What is the type of 'i' there?
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Nicolas George
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 27 Aug 2006 19:00:03
Message: <44f223f3@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Warp wrote in message <44f1fe00@news.povray.org>:
> Nicolas George <nicolas$george@salle-s.org> wrote:
>> for(i = 0; i <= N; i++)
>> r += (double)i * (i / 100000000);
>
> What is the type of 'i' there?
An unsigned; but it should not change anything, since it is the very same
code in both modes. Well, it could have been a long long, but I am not that
careless; and in fact, the difference between 64-bit integer arithmetic in
both modes is much smaller. Some of the missing parts are:
#define N 1000000000
static double
calc_double(void)
{
unsigned i;
register double r = 0; /* or not register */
for(i = 0; i <= N; i++)
r += (double)i * (i / 100000000);
return(r);
}
getrusage(RUSAGE_SELF, &t0);
r1 = calc_double();
getrusage(RUSAGE_SELF, &t1);
(the rest is just necessary noise)
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Warp
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 27 Aug 2006 19:13:34
Message: <44f2271e@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Nicolas George <nicolas$george@salle-s.org> wrote:
> Warp wrote in message <44f1fe00@news.povray.org>:
> > Nicolas George <nicolas$george@salle-s.org> wrote:
> >> for(i = 0; i <= N; i++)
> >> r += (double)i * (i / 100000000);
> >
> > What is the type of 'i' there?
> An unsigned; but it should not change anything
Well, I asked because I suspected it was an integer, in which case
the above code doesn't make too much sense.
In C (and C++) the sentence "(i / 100000000)" is 0 for any (unsigned)
value of i less than 100000000. That because both arguments being integer,
that's an integer division, not a floating point one.
Then, of course, the first 'i' is multiplied by 0, so 'r' is repeatedly
added '0' to it, which makes no difference.
I don't know if this makes a difference in speed in different processors,
but it *might* be that the AMD64 can smartly perform those operations
(which always yield '0' as the answer) faster with its 64-bit-mode
enhancements. But not necessarily. It's just a guess.
Anyways, what you probably wanted to do is this:
r += (double)i * (i / 100000000.0);
which makes much more sense. Could you test if it that also is considerably
faster in 64-bit mode?
> register double r = 0; /* or not register */
The 'register' keyword is a no-op. It doesn't do anything and is just
a useless backwards-compatible drag of history.
(Besides, even when it meant something (like 20 years ago or so), you
couldn't possibly use it with a 'double' because registers are used for
integers only.)
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Nicolas George
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 27 Aug 2006 22:06:08
Message: <44f24f90@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Warp wrote in message <44f2271e@news.povray.org>:
> I don't know if this makes a difference in speed in different processors,
> but it *might* be that the AMD64 can smartly perform those operations
> (which always yield '0' as the answer) faster with its 64-bit-mode
> enhancements. But not necessarily. It's just a guess.
No, it does not chance anything at all.
I made that benchmark in the first time to compare floating point arithmetic
and 64 bits integer arithmetic, to select which one to use for a situation
where both would be acceptable. At first, I just used "r += i * i", but I
added the division to get a result that fits in 64 bits, and to be able to
compare it to a trusted result. Adding it barely changed the timings at all.
> The 'register' keyword is a no-op. It doesn't do anything and is just
> a useless backwards-compatible drag of history.
I tried it because I suspected the 80 bits / 64 bits problem: maybe gcc
would feel freer to keep the double in 80 bits precision. But it did not
change anything.
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Warp
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 27 Aug 2006 22:16:03
Message: <44f251e2@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Nicolas George <nicolas$george@salle-s.org> wrote:
> I tried it because I suspected the 80 bits / 64 bits problem: maybe gcc
> would feel freer to keep the double in 80 bits precision.
'double' is 64-bit in x86 architectures (and in fact in most other
architectures too). If you want a 80-bit fp number, use 'long double'.
> But it did not change anything.
As I said, the 'register' keyword is a no-op. I would bet that most
if not all modern compilers simply ignore it completely (except when
checking for correct syntactical usage, just for backwards compatibility;
after that check they most probably just drop it completely).
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Thorsten Froehlich
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 28 Aug 2006 08:24:35
Message: <44f2e083$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Nicolas George wrote:
> I made that benchmark in the first time to compare floating point arithmetic
> and 64 bits integer arithmetic, to select which one to use for a situation
> where both would be acceptable. At first, I just used "r += i * i", but I
> added the division to get a result that fits in 64 bits, and to be able to
> compare it to a trusted result. Adding it barely changed the timings at all.
You do realise that "unsigned" declares an "unsigned int", which will be 32
bit in both 32 and 64 bit modes of compilation? Thus, the only thing your
code as posted tests is how well the compiler handles the slowest operations
in there, which are the 32 bit integer division and the conversion of a 32
bit integer to a double. Neither of which tell you much about performance of
anything but those two specific operations, which are special cases in and
by themselves.
In fact, the integer division is slow due to the iterative algorithm (in
hardware!) needed to execute it. It would in fact be slower for most 64 bit
integers assuming the numbers you divide are sufficiently big (outside 32
bit range) because the time an integer division takes is not constant but
rather depends on the number of one- and zero-bits with any reasonable
processor released in the last three decades.
Thorsten
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Thorsten Froehlich
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 28 Aug 2006 08:38:28
Message: <44f2e3c4$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Warp wrote:
> As I said, the 'register' keyword is a no-op. I would bet that most
> if not all modern compilers simply ignore it completely (except when
> checking for correct syntactical usage, just for backwards compatibility;
> after that check they most probably just drop it completely).
Please be advised that your statement is incorrect. 'register' is not
defined to be a "no-op" at all. See for example ISO/IEC 14882:2003 (or 1998
if you like, either way it is the ISO C++ standard) section 7.1.1 number 3.
Specifically, it is a hint to the compiler that "the object so declared will
be heavily used". Of course, it is true that some modern compilers
completely ignore it, but that is more due to their register allocators not
being able to handle external priority hints rather than the keyword being
specified to be a "no-op" anywhere. Also note that is is completely legal to
declare a float or double as 'register', it I completely reasonable to
expect a compiler to be able to use this hint to optimise the usage of
floating-point registers (except that a x87 FPU does not have registers but
a stack, most RISC processors do of course have a full complement of
floating-point registers).
Thorsten
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Warp
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 28 Aug 2006 09:07:08
Message: <44f2ea7c@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Thorsten Froehlich <tho### [at] trf de> wrote:
> Please be advised that your statement is incorrect. 'register' is not
> defined to be a "no-op" at all. See for example ISO/IEC 14882:2003 (or 1998
> if you like, either way it is the ISO C++ standard) section 7.1.1 number 3.
> Specifically, it is a hint to the compiler that "the object so declared will
> be heavily used".
I meant "it's in practice a no-op". I didn't mean it's "officially a
deprecated keyword".
Of course in theory it gives a hint to the compiler, and in really old
C compilers it really had an effect, but AFAIK compilers have ignored it
completely for over a decade. They will use their own internal optimization
algorithms regardless of that keyword.
It's the same as with the 'inline' keyword with regard to optimization:
When optimizing, compilers usually completely ignore that keyword. It doesn't
have any effect on the output. (But of course 'inline' has other meaningful
uses which makes it a non-no-op.)
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Warp
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 28 Aug 2006 09:10:11
Message: <44f2eb33@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Thorsten Froehlich <tho### [at] trf de> wrote:
> In fact, the integer division is slow due to the iterative algorithm (in
> hardware!) needed to execute it. It would in fact be slower for most 64 bit
> integers assuming the numbers you divide are sufficiently big (outside 32
> bit range) because the time an integer division takes is not constant but
> rather depends on the number of one- and zero-bits with any reasonable
> processor released in the last three decades.
Are you sure it's an iterative algorithm at transistor level?
One would think that, for example, adding two integers is iterative
(how else could you know if the sum of two bits overflows, thus creating
the need to add an additional 1 to the next bit?). However, it is
perfectly possible to add integers of any amount of bits in 1 clock cycle.
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Thorsten Froehlich
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 28 Aug 2006 09:42:30
Message: <44f2f2c6$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Warp wrote:
> Thorsten Froehlich <tho### [at] trf de> wrote:
>> In fact, the integer division is slow due to the iterative algorithm (in
>> hardware!) needed to execute it. It would in fact be slower for most 64 bit
>> integers assuming the numbers you divide are sufficiently big (outside 32
>> bit range) because the time an integer division takes is not constant but
>> rather depends on the number of one- and zero-bits with any reasonable
>> processor released in the last three decades.
>
> Are you sure it's an iterative algorithm at transistor level?
Yes. I don't have a good reference at hand, but a very quick search reveals
<http://www.intel.com/technology/itj/2006/volume10issue02/art01_Intro_to_Core_Duo/p03_improved_cores.htm>.
Just search for "IDIV" in that document and notice the remark about the
algorithm being iterative and them employing "early exit", which accounts
for the variable execution time (aka number of zeros and ones in the input).
Given that this talks about Intel's most modern CPU core, implications
should be clear.
Of course, all this is much better explained in books about computer
hardware (plenty of those around). The good ones present several variations
of algorithms available in detail. However, in essence the algorithms remain
rather similar to a binary version of the common decimal "by hand" division
method we all once learned in school. As you may recall, that "algorithm" is
also iterative ;-)
Thorsten
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Nicolas George
Subject: Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?
Date: 28 Aug 2006 10:53:31
Message: <44f3036b@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Thorsten Froehlich wrote in message <44f2e083$1@news.povray.org>:
> You do realise that "unsigned" declares an "unsigned int", which will be 32
> bit in both 32 and 64 bit modes of compilation? Thus, the only thing your
> code as posted tests is how well the compiler handles the slowest operations
> in there, which are the 32 bit integer division and the conversion of a 32
> bit integer to a double. Neither of which tell you much about performance of
> anything but those two specific operations, which are special cases in and
> by themselves.
I made a benchmark suited to the specific case I wanted to optimize¹, and it
served me. I stumbled on the difference for floats as a side effect, and
just reported it in this thread because it seemed relevant.
After digging in the assembly code, I found the exact cause, which is a
combination of architecture improvements and bad compiler optimisation. As
you guessed, the bottleneck is the integer to float conversion (the
division, on the other hand, is meaningless, since it is the very same in 32
and 64 bits).
In 64 bits, gcc uses cvtsi2sdq to convert the integer into a SSE2 register.
In 32 bits, the default is to use the FPU, and the conversion goes through
the stack; in 32 bits with SSE2, the conversion goes through the stack,
through the FPU and again through the stack, which is a (known) very bad
optimisation by gcc. Converting to use cvtsi2sd gives results similar to the
64 bits version.
As a conclusion, it is possible to sum up with:
- (Already explained here) 64 bits processors are also a new generation of
processors, with new features and a better architecture, that lead to
better performances both in 64 bits and 32 bits mode.
- (New remark) 64 bits processors need a rewrite of the compiler's code
generation phase, that can provide improved usage of the new features.
1 : if you want to know everything, my goal is to compute mean square error
and linear correlation coefficient of video image, where the most repeated
operation is something like "t += *d * *d". Since there is a very large
number of pixels, t needs to be either a 64 bits integer or a double
precision float. I found that 64 bits integer were slightly faster on 64
bits CPU, and not too much slower on 32 bits CPU.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |