Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Acknowledgement MMX-Flood Filler

Author: Gerd Isenberg

Date: 02:29:00 09/13/02

Go up one level in this thread


On September 13, 2002 at 04:07:55, Sune Fischer wrote:

>On September 12, 2002 at 21:19:08, Gerd Isenberg wrote:
>
>>Hi all,
>>
>>My first MMX-Routine (MSC inline asm) that gains considerable performance!
>
>Wow, that's great. How much faster do think it is?

hmmm, about 25-30%. The unrolled boolean is at least double so fast as the
c-code in average, or even better in pathalogical cases.

>
>Do I need a special header or flags to compile it, msvc doesn't know how?

oups sorry, you have to install the "Visual C++ 6.0 Processor Pack" from:
http://msdn.microsoft.com/vstudio/downloads/ppack/default.asp


You may also have a closer look at:
http://www.amd.com/us-en/Processors/DevelopWithAMD/0,,30_2252_739_2983,00.html
about mmx, athlons mmx extensions and code optimazations.


>
>I actually need two variations of it, one for rooks and one for bishops, can you
>translate them to MMX (without too much effort of course)?
>
<snip>

>Cheers,
>-S.

About the flood fill for rooks, where you grow only vertically and horicontally,
the mmx "fill" code may look like this:

        movq	mm3, mm1	; := sq1
	movq	mm4, mm1	; := sq1
	movq	mm5, mm1	; := sq1
	movq	mm6, mm1	; := sq1
	psrlq	mm3, 1		; sq1>>1 shift board left  in h->a direction
	psllq	mm4, 1		; sq1<<1 shift board right in a->h direction
	pand	mm3, [notH]	; clear h-file due to wrapped bits from a file
	pand	mm4, [notA]	; clear a-file due to wrapped bits from h file
	psrlq	mm5, 8		; sq1>>8 shift down in 8->1 direction
	psllq	mm6, 8		; sq1<<8 shift up   in 1->8 direction
	por	mm1, mm3	; sq1 |= sq1>>1
	por	mm1, mm4	;     |  sq1<<1
	por	mm1, mm5	;     |  sq1>>8
	por	mm1, mm6	;     |  sq1<<8
	pand	mm1, mm0	; sq1 & path -> drop flood not in path

and in similar way for the diagonal fill.

regards,
Gerd




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.