Re: Cannot optimize 64bit Linux code
- From: santosh <santosh.k83@xxxxxxxxx>
- Date: Fri, 29 Feb 2008 01:14:40 +0530
legrape@xxxxxxxxx wrote:
I am porting a piece of C code to 64bit on Linux. I am using 64bit
integers. It is a floating point intensive code and when I compile
(gcc) on 64 bit machine, I don't see any runtime improvement when
optimizing -O3. If I construct a small program I can get significant
(>4x) speed improvement using -O3 versus -g. If I compile on a 32 bit
machine, it runs 5x faster on the 64 bit machine than does the 64bit
compiled code.
It seems like something is inhibiting the optimization. Someone on
comp.lang.fortran suggested it might be an alignment problem. I am
trying to go through and eliminate all 32 bit integers righ now (this
is a pretty large hunk of code). But thought I would survey this
group, in case it is something naive I am missing.
Any opinion is welcomed. I really need this to run up to speed, and I
need the big address space. Thanks in advance.
This group may not be the best option. Maybe you should try a Linux or
GCC group?
If the same code and compilation commands produce such runtime
difference then perhaps the 64 bit version of the compiler and it's
runtime libraries, as well as perhaps the system runtime libraries are
not yet exploiting all the optimisations possible. Did you try giving
gcc the permission to use intrinsics and SSE? Alignment could well be a
problem though gcc *should* have chosen the best alignment for the
target, unless you specified otherwise. Are there any aspects to your
code (like choice of data types, compiler specific pragmas, struct
padding) that are perhaps selected for 32 bit systems and thus less
than optimal under 64 bit?
Did you try with the Intel compiler? If it produces better code then
that is a piece of evidence indicative, perhaps, that gcc isn't
emitting good code.
.
- References:
- Cannot optimize 64bit Linux code
- From: legrape
- Cannot optimize 64bit Linux code
- Prev by Date: Re: Cannot optimize 64bit Linux code
- Next by Date: Variable-sized lines of text in linked list
- Previous by thread: Re: Cannot optimize 64bit Linux code
- Next by thread: Re: Cannot optimize 64bit Linux code
- Index(es):
Relevant Pages
|