Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Move generation question for the big boys

Author: Vincent Diepeveen

Date: 16:48:08 09/15/01

Go up one level in this thread


On September 15, 2001 at 17:12:54, Rafael Andrist wrote:

Yes i meant OR of course, sorry about that. the example still stands
though replacing the operations.

>On September 15, 2001 at 16:17:52, Vincent Diepeveen wrote:
>
>>Like if i check for 2 non-array/pointer entities for being zero:
>>
>>if( a & b )

i meant if( a && b )
here.
>>  then do this and that;
>>
>>to produce some crap assembly:
>>  CMP EAX,0
>>  JNZ LOOP
>>  CMP EDX,0
>>  JNZ LOOP1
>>
>>Now already people will complain: "you don't need special CMP for
>>2 different statements". Well they're right.
>>
>>In fact you don't need 2 compares even. All you need is something
>>primitive like:
>>
>>  ADD EAX,EDX
>>  CMP EAX,0
>>  JNZ LOOP1
>>
>
>This won't work because eax+edx can be zero if, e.g., eax=-2 and edx=2. If you
>use only positive values (pointers), it can happen too if you get an overflow.
>
>You have to write it that way:
>
>; reading from memory
>; do something else to avoid AGI stall
>or  eax, edx
>; use other pipe for other thing
>cmp eax, 0
>jnz loop1
>
>
>Rafael B. Andrist



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.