Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: C and C++ --- NPS

Author: Walter Faxon

Date: 14:47:19 12/27/02

Go up one level in this thread


On December 26, 2002 at 22:48:35, Matt Taylor wrote:

<snip lotso neat stuff>

>The "cmove" instruction is "conditional move if equal/zero." If the previous
>comparison (val == some case) is true, it will replace the contents of result
>with the second operand.
>
>This strategy also works particularly well on IA-64 where the results of a
>comparison go into any one of 64 special 1-bit registers. In the example you
>gave, the particular symmetry would allow the processor to do the correct
>computation quickly without branching at all.
>
>In other cases where one is not so fortunate to have nice facilities, you can
>play games with masks. I won't get into all the many tricks & techniques for
>doing this because it would make this post even longer than it already is. In
>the case of MMX/SSE vector extensions to IA-32, comparisons will give you a
>resulting mask of -1 or 0 that you can manipulate.

<snip more great stuff -- this time for SSE>

>-Matt


Wow.

Other than my feeling a little retarded regarding cmove, etc., all I want to
know now is:  do you know of any "mother lode(s)" for coding tricks?  (I already
have a copy of the C-centric "Hacker's Delight".)

Either way, thanks, Matt.  You've really opened my eyes.

-- Walter



This page took 0.01 seconds to execute

Last modified: Thu, 07 Jul 11 08:48:38 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.