LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-28-2004, 03:07 AM   #1
duckie
LQ Newbie
 
Registered: Apr 2004
Location: Switzerland
Distribution: SuSE
Posts: 2

Rep: Reputation: 0
gcc on Opteron: 64bit-mode slower than 32bit-mode!!!?


I recently tried a 'numerical hello world' on our new Opteron-system but got somewhat confused when it turned out that the 32-bit mode ran twice as fast as the 64-bit mode!

The test-code was essentially:
for (i=0; i<i_stop; i++) {
for (j=0; j<j_stop; j++)
sum+=sin(double(i))+cos(double(i));
}

compile 64-bit
g++ test.cpp -O2

compile 32-bit
g++ test.cpp -O2 -m32

It does not matter if I add more optimization switches, the 32-bit version still runs on half the time...

The system:
Dual Opteron 244, 8GB Ram
SuSE 9.0-64bit for AMD64, kernel 2.4.21-209-smp, gcc-3.3.1-23

Do anyone have a clue where the problem is?

Hopefully

Anders

Last edited by duckie; 04-28-2004 at 03:11 AM.
 
Old 05-20-2004, 09:00 AM   #2
bluie
LQ Newbie
 
Registered: May 2004
Location: Europe
Distribution: Mutable
Posts: 10

Rep: Reputation: 0
Hi duckie!
A pragmatic answer: use the -ffast-math compiler-option for better results.
Maybe the sin-function is not optimized by default for 64-bit.

Hope this helps some, bluie
 
Old 05-20-2004, 10:51 AM   #3
duckie
LQ Newbie
 
Registered: Apr 2004
Location: Switzerland
Distribution: SuSE
Posts: 2

Original Poster
Rep: Reputation: 0
Thank you,

now I got the exspected performance

Anders
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can 64bit processor run both 64bit and 32bit computers? DJOtaku Linux - General 4 09-08-2005 08:14 PM
Graphics mode in GCC alexiezt Programming 1 01-28-2005 06:56 AM
How can I change display mode from character mode to graph mode wuzhong Linux - Hardware 1 08-08-2004 09:36 AM
XOrg in 32bit mode? r_jensen11 Linux - Software 2 06-28-2004 07:10 PM
LFS compiled in 64bit mode? ParticleHunter Linux From Scratch 4 06-03-2004 01:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration