Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Gerbil 64-bit Speedup

Author: Bo Persson

Date: 14:00:56 03/30/04

Go up one level in this thread


On March 30, 2004 at 12:20:55, Fabien Letouzey wrote:

>
>Normally for local variables and arguments (I always consider arguments as local
>variables) I only use "normal" size (it is in the C spirit that "int" is
>supposed to be fastest, so the unsigned-index stuff is really bad news).

But this is Beta class stuff. Eugene told us in another post that there are
additional possibilities to optimize for signed values.

Remember that these compilers are about a year old already, meaning that we are
comparing an infant 64 bitter against one of the best 32 bit compilers.

I have looked at the assembly output of these for some of my code, and was not
particularly impressed by the quality of the 64 bit code. Here is one example,
where an inlined function is deciding what to do, based on its constant 0
parameter:

  00015	32 c0		 xor	 al, al
  00017	84 c0		 test	 al, al
  00019	74 15		 je	 SHORT $L197972

It uses an xor instruction to get a zero, then its tests the zero to see what
value it has, and then a conditional jump based on if the zero really was zero.

A perfect compiler would see that the zero isn't used anywhere else, so it is
really not needed. You don't have to test either, because the value is known at
compile time, that's why the xor worked in the first place. If you optimize away
the branch-not-taken as well, you don't need the jump either.


Now that Eugene and friends have worked on it for another year, that might have
improved.


Bo Persson




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.