This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Optimize C / R.


Roger Sayle wrote:

> The x86 backend could still implement the above RTL with a load from
> the constant pool.  The important thing is keeping the const0_rtx
> explicit in the RTL representation.

Apparently, the x86 isn't the only culprit here.  On Alpha, I get:

cf_:
        .frame $30,0,$26,0
        .prologue 0
        lds $f13,0($18)
        lds $f15,4($17)
        lds $f14,0($17)
        cpys $f31,$f13,$f10		<--- ABS
        cmptlt $f10,$f31,$f10		<--- COMPARE
        fbne $f10,$L2			<--- JUMP
        divs $f15,$f13,$f11
        divs $f14,$f13,$f10
$L3:
        sts $f11,4($16)
        sts $f10,0($16)
        ret $31,($26),1
        .align 4
$L2:
        divs $f13,$f31,$f10
        muls $f15,$f10,$f11
        muls $f14,$f10,$f12
        muls $f13,$f10,$f10
        subs $f11,$f14,$f11
        adds $f12,$f15,$f12
        divs $f11,$f10,$f11
        divs $f12,$f10,$f10
        br $31,$L3
        .end cf_

which obviously also doesn't know how to optimize abs(a) >= 0 ...

Hope this helps,

-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]