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.
|