[Freeciv-Dev] Re: Server Error (PR#666)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Tue, 30 Jan 2001, iquin@xxxxxxxxxx wrote:
>>> The effect is barely noticable and this is a CPU intensive part.
> The effect is you can draw a straight line from north pole to
> south pole without touching any island at x=0. This is normal
> with 9 islands but weird with 90 islands.
> The CPU time saving is avoiding calls to normalize_map_pos()
> (s-n)*(e-w) times, only calling is_coastline() islemass times.
>> The compiler is perfectly capable of performing that sort of
>> trivial optimisation itself. Or at least it should. 8-)
> Unfortunately, it doesn't. At least not with gcc on x86 platforms.
> Diffing with "gcc -O3 -S" gives: (only essential parts are shown)
> - movl 16(%ebp),%eax ; (x+xo-w)
> - addl %ebx,%eax
> - subl %esi,%eax ; %esi is w
> + leal -1(%ebx,%esi),%eax ; (x+xo-1) %esi is xo
> and
> - incl %ebx ; for(x=w;x<e;x++)
> - cmpl %edi,%ebx
> - jl .L11
> + decl %ebx ; do while(--x)
> + jne .L11
Hm. I stand corrected, it seems.
Could you email me the soure that you compiled to produce this? I'd
like to try to chase this down.
--
Big Gaute http://www.srcf.ucam.org/~gs234/
.. over in west Philadelphia a puppy is vomiting..
|
|