This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC is 7 times slower than Intel? How to optimize? Need help!!


John Fine wrote:
> Andrew Haley wrote:
>> John Fine wrote:
>>  
>>> I'm confident neither gcc nor Intel10 is inlining the exp() function,
>>>     
>>
>> Why are you confident of that?  With -ffast-math -O2 that is precisely
>> what
>> gcc will do.  That's why Ian suggested it.
> 
> I should have asked whether the architecture being tested was 32bit or
> 64bit.  I was assuming 64 bit and probably shouldn't have.
> 
> I had done similar tests myself with Intel10 in both 32 bit and 64 bit
> and with gcc in only 64 bit.  I never saw exp() inlined.
> 
> I retested with the source code from this thread in both Intel10 and gcc
> 4.1.2 both 32 bit and 64 bit, with -O2 in all cases and -ffast-math for
> gcc.  The exp() was inlined for 32 bit gcc but not for either Intel10
> compile and not for 64 bit gcc.  But the Intel results were four time
> faster than the gcc results.  Surprisingly, the gcc speed was the same
> for the 32 bit with inlined code and the 64 bit with non inlined code. 

Well, that's interesting.  Somehow, the Intel compiler is four times
faster than gcc even when gcc is generating straight inlined floating-point
instructions.  Something very odd is going on here.  I'm wondering if we're
looking at the right thing.  For example, we've been assuimg that the run-
time is dominated by the time of exp().

Andrew.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]