Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: About compiler optimizations

Author: Vincent Diepeveen

Date: 13:52:19 12/20/02

Go up one level in this thread


On December 20, 2002 at 16:32:04, David Rasmussen wrote:

I uninstalled .net directly after smelling similar horrors too.

Equally important was that after i worked around it the
.net was 2% slower for me than msvc 6.0 sp4 procpack.

Note that exactly that procpack was the difference!

Now it is possible that the procpack created bugs with others
and therefore wasn't included in .net, therefore let's be clear
that i do not claim it to be better than .net at all.

It just is for me. Surely it is cheaper considering you to buy
all kind of stuff to disable others from disassembling easily your
source code with .net

m$ decision is to earn more money on it seemingly. Well that is their
choice. It isn't mine to actually pay for all that. gcc is for free :)

>On December 20, 2002 at 14:51:03, Eugene Nalimov wrote:
>
>>I'll be happy if you do that.
>>
>
>I haven't gone through the tedious task of creating a simple test case, so all I
>can show you is some code that in the context it is in, fails with MSVC++.NET.
>This is from an old version of Chezzz:
>
>	// Generate the attack masks for attacks on a file
>	for (Square square = A1; square <= H8; ++square)
>	{
>		minus8Direction[square] = 0;
>		plus8Direction[square] = 0;
>		for (BitBoard state = 0; state <= 255; ++state)
>		{
>			BitBoard tmp = 0;
>			BitBoard shiftState = state << FileShift(square);
>			for (Square to = square - 8; to >= A1; to -= 8)
>			{
>				tmp |= Mask(to);
>				if (Mask(rotate90Left[to]) & shiftState)
>					break;
>				if (state == 0)
>				{
>					minus8Direction[square] |= Mask(to);
>					directions[square][to] = -8;
>				}
>			}
>                        // Look at this loop:
>			for (Square to = square + 8; to <= H8; to += 8)
>			{
>				tmp |= mask[to];
>				if (Mask(rotate90Left[to]) & shiftState)
>					break;
>			}
>                        // And then look at this:
>			for (Square to = square + 8; to <= H8; to += 8)
>			{
>				if (state == 0)
>				{
>					plus8Direction[square] |= Mask(to);
>					directions[square][to] = 8;
>				}
>				else
>					break;
>			}
>			fileAttack[square][int(state)] = tmp;
>		}
>	}
>
>As you can see, the commented loops could be one loop instead of two. I have
>several blocks like this one, to generate attack masks. All of them, except this
>one, has only one loop where this one needs two. If I put them together,
>something goes wrong. Back when it happened, I _did_ examine it very carefully
>on several platforms with several compilers and with a debugger. I found out
>precisely where the problem occured with MSVC++.NET, but I can't remember now.
>The important thing is that I just tried to compile the version with the loops
>combined, and it showed the error again. And this wasn't even with
>optimizations, this was in the standard Debug configuration! I guess, to be
>really useful, you would have to have access to the whole source file containing
>this code, and I'm not sure I want to do that. But I guess I could send you the
>produced assember output for the two versions of the file, if you tell me how to
>create files with assembler output in MSVC++.NET, a feature I never use. Or do
>you have a better idea?
>
>I have more code that fails with MSVC++.NET. A (simple) part of my book code
>fails when compiled with some specific set of optimization options turned on.
>This doesn't crash. A very simple test is just always false, so no book moves
>are never available to the program. That happened to me at CCT4 after a
>recompile, when I enabled some optimization.
>
>/David



This page took 0.01 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.