Complete.Org: Mailing Lists: Archives: freeciv-dev: February 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: =?cn-big5?b?vbKr7bXY?= <iquin@xxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Server Error (PR#666)
From: Gaute B Strokkenes <gs234@xxxxxxxxx>
Date: 01 Feb 2001 17:45:45 +0000

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



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