There is an info on it in gccint.
Namelly peephole2 described well.
The best thing to do is just:
Get _small_ complette C example which results in the code to be optimized.
Compile it with -S -O2 -dp flags once and -S -O2 -dP second time.
Provide optimal solution.
Post it (or send me).
I'll write a peephole.
cheers,
~d
P.S. before makeing any changes to gcc code, post it here.
On Tuesday 19 August 2003 22:53, Takahashi, Chris wrote:
> I have been looking at code generated and I see a lot of inefficient code
> generated. When testing parts of bit fields I get the following code:
>
> if (!elemofbitfield) {
>
> bit.b const,rX
> clr.b r15
> adc.b r15
> and.b #-1,r15
> cmp #lo(0),r15
> jne .Lxxx
>
> This could be accomplished by:
> bit.b const,rX
> jc .Lxxx
>
> It seems silly to waist all this.
>
> I also see a lot of instances of this:
>
> mov rX,rY
> mov rY,rX
>
> when the following has the same result and side effects:
>
> mov rX,rY
>
> I have also seen something similar with long int moves.
>
> I've been looking into writing something for the peephole2 optimizer but I
> can't figure out the syntax. Is there any help on this topic past 'info
> gccint'?
>
> -Chris Takahashi
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by Dice.com.
> Did you know that Dice has over 25,000 tech jobs available today? From
> careers in IT to Engineering to Tech Sales, Dice has tech jobs from the
> best hiring companies. http://www.dice.com/index.epl?rel_code=104
> _______________________________________________
> Mspgcc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
--
/*****************************************************************
("`-''-/").___..--''"`-._ (\ Dimmy the Wild UA1ACZ
`6_ 6 ) `-. ( ).`-.__.`) State Polytechnical Univ.
(_Y_.)' ._ ) `._ `. ``-..-' Radio-Physics Departament
_..`--'_..-_/ /--'_.' ,' Saint Petersburg, Russia
(il),-'' (li),' ((!.-' +7 (812) 5403923, 5585314
*****************************************************************/