freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Devel] suggested improvement to FT_Add64


From: Nathan Hurst
Subject: Re: [Devel] suggested improvement to FT_Add64
Date: Fri, 12 Oct 2001 10:07:23 +1000
User-agent: Mutt/1.3.22i

On Thu, Oct 11, 2001 at 06:40:18PM +0100, Graham Asher wrote:
> This might be said to be nitpicking, but there is a small improvement to be
> made to FT_Add64, which might save a cycle or two:

It actually costs 1 instruction on PPC with gcc -O2.

>   void FT_Add64( FT_Int64*  x,
>     register FT_UInt32  lo, hi;
> 
>     lo = x->lo + y->lo;
>     hi = x->hi + y->hi + ( lo < x->lo );

FT_Add641__FP8FT_Int64N20:
.LFB1:
        lwz 0,4(3)
        lwz 11,4(4)
        lwz 9,0(3)
        add 11,0,11
        cmpw 7,11,0
        lwz 10,0(4)
        stw 11,4(5)
        add 9,9,10
        mfcr 0
        rlwinm 0,0,29,1
        add 9,9,0
        stw 9,0(5)
        blr

> with
> 
>   void FT_Add64( FT_Int64*  x,
>     z->lo = x->lo + y->lo;
>     z->hi = x->hi + y->hi + (z->lo < x->lo );

FT_Add642__FP8FT_Int64N20:
.LFB2:
        lwz 0,4(4)
        lwz 9,4(3)
        add 9,9,0
        stw 9,4(5)
        lwz 11,4(3)
        lwz 10,0(4)
        cmpw 7,9,11
        lwz 0,0(3)
        mfcr 9
        rlwinm 9,9,29,1
        add 0,0,10
        add 0,0,9
        stw 0,0(5)
        blr

njh



reply via email to

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