Author: Bo Persson
Date: 10:45:16 01/14/02
Go up one level in this thread
On January 13, 2002 at 16:28:32, David Rasmussen wrote:
>On January 13, 2002 at 15:19:18, Severi Salminen wrote:
>
>>>think. That would be really cool. MSVC++ have such an extension, sort of. But I
>>>don't know if it works well or not. I haven
>>>t tried using it.
>>
>>What extension?
>>
>>Severi
>
>An invariant or postcondition compiler directive. I can't remember it's name,
>but I found it once, in the help files. Maybe Dann knows. One is able to write
>something like "__inavariant__ (square >= 0 && square <= 63) or something like
>that.
>
>/David
It is called __assume( ) and is supposed to give hints to the compiler. I
haven't found much use for it though, possibly because the documentation is not
at all clear about exactly what is does. The only example is using it in a
switch statement, where a
switch(x)
{
...
default:
__assume(0)
}
would indicate that the default case is never taken, so the compiler can remove
its range check. Saves several instructions...
Bo Persson
bop2@telia.com
This page took 0 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.