Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: How does SHR/SHL work?

Author: Vincent Diepeveen

Date: 15:10:26 02/14/01

Go up one level in this thread


On February 14, 2001 at 13:38:43, Severi Salminen wrote:

>Hi!
>
>I managed to speedup my movegenerator quite a bit making the crucial assembler
>functions completely branchless. Then I noticed one thing I was not quite sure
>about. I was using SHR eax,cl with values of cl more than 32 - first I didn't
>consider this possibility. So: Is SHR eax,33 same as SHR eax,1 - is cl allways
>between 0 and 32? It seems to be. Everything seemed to function just right so
>was I just very lucky to _not_ notice this before trying?

For the Pro, PII and PIII and K7 this is no problem.

It is a BIG problem on the P4 however.

But still the problem is not as bigtime a problem as a branch.
Eliminating possible mispredicted branches is crucial.

the branch misprediction works initially quite simple. The first time
it sees the branch is considers fall through.

If it goes wrong then it gives a penalty. For a short jump that's not
so big. If it is about a few tens of instructiosn the penalty already
gets bigger

>Severi



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.