This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: long long performance
- To: Rob Willis <rob at e-critical dot com>
- Subject: Re: long long performance
- From: Alan Lehotsky <lehotsky at tiac dot net>
- Date: Wed, 13 Dec 2000 17:21:40 -0500
- Cc: gcc at gcc dot gnu dot org
- References: <3A37F1ED.ED6C4133@e-critical.com>
At 2:02 PM -0800 12/13/00, Rob Willis wrote:
>Thanks for the info. Assuming the longlong multiply isnt too much more
>complex, it still does not explain the 13x slower performance over that
>of just a normal long mulitply. The timing on my P3/600 gave the
>following (i've already subtracted out the overhead for the loop and
>variable assignment):
>
>All times are for 1 billion operations to complete.
>
>long long mult: 33 secs
>long mult: 2.4 secs
Unless I'm missing something if you double the number of
bits you are multiplying, you have 4x as many multiplies to
do; e.g.
ab x cd => ac + ad + bc + bd (with appropriate
shifting of the
addends)
add to that the overhead of adding the pieces and the
general lameness of the x86 architecture and it's probably
pretty easy to end up nearly 16 times slower.
Plus, with the x86, your long variables could live in
registers, while 'long long' will be on the stack, and
by this point, I think you should be happy that it's only
14 times slower :-)
If you want fast 64 bit integers, try a PowerPC or even
better, an Alpha.
-- Al
--
------------------------------------------------------------------------
Quality Software Management
http://www.tiac.net/users/qsmgmt
apl@alum.mit.edu
(978)287-0435 Voice
(978)808-6836 Cell
(978)287-0436 Fax
Software Process Improvement and Management Consulting
Language Design and Compiler Implementation