c++ compilers

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

jaespo
Posts: 7
Joined: Sun Oct 12, 2014 11:58 pm
Location: Omaha Ne

c++ compilers

Post by jaespo »

In your experience, which c++ compiler generates the fastest code for 64 bit intel, for a bit-board engine that doesn't use memory management or the std:: library?

I suspect the answer is "it depends", or "it's close", but here are some choices:

1) gcc
2) Microsoft c++
3) clang/llvm
4) Intel c++
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: c++ compilers

Post by bob »

jaespo wrote:In your experience, which c++ compiler generates the fastest code for 64 bit intel, for a bit-board engine that doesn't use memory management or the std:: library?

I suspect the answer is "it depends", or "it's close", but here are some choices:

1) gcc
2) Microsoft c++
3) clang/llvm
4) Intel c++
From my testing, Intel is best, but only for actual Intel processors. For AMD there was a bit of trickery going on that made the executable slower, intentionally.
mar
Posts: 2559
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: c++ compilers

Post by mar »

I would say intel and gcc are rougly on par but it really depends.
Then clang and last msc, but there are corner cases where a specific compiler can do better than the rest,
but only if you're writing something else than a chess engine.

Intel compiler on AMD:
Intel doesn't use SSE-optimized paths on non-Intel CPUs (the binary can be easily patched though).
I don't know why they still do that because they should have the edge regardless.

For a chess engine this only affects memset and memmove,
so I doubt it will have any noticeable impact unless you copy like crazy.
jdart
Posts: 4367
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: c++ compilers

Post by jdart »

They are pretty much equal, in my experience. Intel C++ used to be better but current versions of gcc and MSVC are giving it decent competition. Intel still has some good auxiliary profiling and performance tools, though.

--Jon
User avatar
velmarin
Posts: 1600
Joined: Mon Feb 21, 2011 9:48 am

Re: c++ compilers

Post by velmarin »

Intel is the best,
intrinsic including,
AMD also.
User avatar
vittyvirus
Posts: 646
Joined: Wed Jun 18, 2014 2:30 pm
Full name: Fahad Syed

Re: c++ compilers

Post by vittyvirus »

jdart wrote:They are pretty much equal, in my experience. Intel C++ used to be better but current versions of gcc and MSVC are giving it decent competition. Intel still has some good auxiliary profiling and performance tools, though.

--Jon
+1
Microsoft VC++ optimizes better than G++ for me.
User avatar
SMIRF
Posts: 91
Joined: Wed Mar 26, 2014 4:29 pm
Location: Buettelborn/Hessen/Germany

Re: c++ compilers

Post by SMIRF »

How do you estimate Digital Mars C/C++?