[FFmpeg-devel] -fsingle-precision-constant

Michael Niedermayer michaelni
Thu May 13 19:44:04 CEST 2010


On Thu, May 13, 2010 at 01:31:07PM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Thu, May 13, 2010 at 1:13 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> > when i looked at the asm gcc generates for mp3float i noticed it converts
> > floats to doubles all over the place.
> > Adding -fsingle-precision-constant makes the code a whole 10% faster overall
> > on core2
> 
> What if you add "f" as a postfix to relevant constants? Or can you
> give examples of functions where this is an issue so we can be more
> helpful?

all functions i guess

like
float func(float f){
    return f*1.2;
}

results in:

func:
        unpcklps        %xmm0, %xmm0
        cvtps2pd        %xmm0, %xmm0
        mulsd   .LC0(%rip), %xmm0
        unpcklpd        %xmm0, %xmm0
        cvtpd2ps        %xmm0, %xmm0
        ret

vs with -fsingle-precision-constant
func:
        mulss   .LC0(%rip), %xmm0
        ret

this is nuts

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100513/7e1ec50d/attachment.pgp>



More information about the ffmpeg-devel mailing list