[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [computer-go] Pattern Matcher
On Tue, 09 Nov 2004 17:23:03 +0100, Vincent Diepeveen <diep@xxxxxxxxxxxxxxxxx> wrote:
> At 16:09 9-11-2004 +0100, Arend Bayer wrote:
> A simple example of that can be demonstrated using more local variables
>
> #define EYE_BONUS 500
> ...
> ... {
> if( a == 1 && b[i] == 361 ) // very bad and slow code
> score += EYE_BONUS;
>
> The C compilers are so good nowadays that they will be able to make CMOV's
> out of :
> ...
> ... {
> int x=b[i];
> if( a == 1 && x == 361 )
> score += EYE_BONUS;
>
> speed savings are on average a factor 12 for this piece of code.
Fascinating. gcc generates better code for the first case than the
second case, and MSVC++ generates identical code in both cases
(corresponding to the code from gcc in the first case). Can you
explain how that fits with your comment "very bad and slow code"?
Lars
_______________________________________________
computer-go mailing list
computer-go@xxxxxxxxxxxxxxxxx
http://www.computer-go.org/mailman/listinfo/computer-go/