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

Michael Meissner meissner@linux.vnet.ibm.com
Tue Oct 7 16:39:00 GMT 2008


On Mon, Oct 06, 2008 at 11:23:32PM -0700, jackfrost wrote:
> 
> 
> Ian Lance Taylor-3 wrote:
> > 
> > Try -ffast-math.  I think it's the default for icc when optimizing.
> > Ian
> > 
> 
> I've tried  -ffast-math.
> with the same result.

Since the two tests are nothing but sin and exp calls respectively, you need to
get faster/vector versions of the sin/exp routines.  If you are using the
development version of the compiler you can use either AMD's optimized math
library (acml) or Intel's optimized math library (svml), both of which provide
vectorized versions of sin/exp.  You will need to download these libraries from
AMD or Intel respectively.

For the default versions of exp and sin that is in glibc, you will need to talk
to the GLIBC folks to get faster versions installed in the library.  Faster
versions were originally proposed in 2006, and it got bogged down in the glibc
process.  The person who did the initial work (Evandro Menezes) has since left
AMD, but if its important to you, maybe you can work with the GLIBC maintainers
to get faster versions in libm.  Unfortunately, it is a long process, and can
be frustrating at times to satistify all of the accuracy/speed constraints in
glibc.

-- 
Michael Meissner, IBM
4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
meissner@linux.vnet.ibm.com



More information about the Gcc-help mailing list