Author: Gerd Isenberg
Date: 14:49:41 12/22/05
Go up one level in this thread
On December 22, 2005 at 16:19:58, Zach Wegner wrote: >Hi Gerd, > >Very interesting. I find this line to be particularly elegant: > >> l = (h & -m) | (l & m-1); but also a bit redundant expression l = h | (l & m-1); is good enough. If one likes to scan vectors of bitboards, sse2 comes i mind ;-) pxor xmm2, xmm2 ; zero // quad to dword movdqa xmm1, xmm0 pcmpeqd xmm0, xmm2 psrlq xmm0, 32 ; high == 0 mask pand xmm0, xmm1 ; low if high == null otherwise zero psrlq xmm1, 32 ; high por xmm0, xmm1 ; keeps low if high == 0 otherwise high // dword to word movdqa xmm1, xmm0 pcmpeqw xmm0, xmm2 psrld xmm0, 16 ; high == 0 mask pand xmm0, xmm1 ; low if high == null otherwise zero psrld xmm1, 16 ; high por xmm0, xmm1 ; keeps low if high == 0 otherwise high // word to byte movdqa xmm1, xmm0 pcmpeqb xmm0, xmm2 psrlw xmm0, 8 ; high == 0 mask pand xmm0, xmm1 ; low if high == null otherwise zero psrlw xmm1, 8 ; high por xmm0, xmm1 ; keeps low if high == 0 otherwise high // byte to nibble ...
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.