[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [computer-go] Pattern Matcher
The example is very clear IMHO.
Use P6 optimizations. Default it might use I386 and that doesn't have CMOV.
GCC is also doing it.
What gcc compiler are you using?
I'm using here 3.4.0 (mingw special) and at the opterons i'm using 3.4.3
which is far better.
for k8 the optimizations to use are:
-fprofile-generate -O2 (or whatever level you prefer if you don' tknow
how to inline functions by hand which are important) -mtune=k8 -mcpu=k8
then you run for a while, delete object files and recompile with
-fprofile-use and further the same string.
net2003 should do it too (didn't test) when using -G7 (speeds up diep 2%
over msvc 6 sp5 processorpack).
At 11:42 9-11-2004 -0500, Lars Nilsson wrote:
>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/
>
>
_______________________________________________
computer-go mailing list
computer-go@xxxxxxxxxxxxxxxxx
http://www.computer-go.org/mailman/listinfo/computer-go/