Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2001:
[Freeciv-Dev] Re: Server Error (PR#666)
Home

[Freeciv-Dev] Re: Server Error (PR#666)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Server Error (PR#666)
From: 蔡恆華 <iquin@xxxxxxxxxx>
Date: Tue, 30 Jan 2001 21:58:27 -0500 (EST)

>> 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

Regards,
I.Q.
______________________________________________
FREE Personalized Email at Mail.com
Sign up at http://www.mail.com/?sr=signup



[Prev in Thread] Current Thread [Next in Thread]