[Sdcc-user] Peephole rules

2016-12-16 Thread Травкин Роман
Hello. Where I can read about writing peephole rules for sdcc? I looked at sources and found one file, but its syntax is unclear for me. Target platform is stm8 -- Check out the vibrant tech community on one of the world's

Re: [Sdcc-user] Peephole rules

2016-12-16 Thread 史斌
I suggest you begin with the simplest rules in the source. Ben Shi > 在 2016年12月16日,17:14,Травкин Роман 写道: > > Hello. Where I can read about writing peephole rules for sdcc? I looked at > sources and found one file, but its syntax is unclear for me. Target platform > is stm8 > ---

Re: [Sdcc-user] Peephole rules

2016-12-16 Thread Maarten Brock
> Hello. Where I can read about writing peephole rules for sdcc? I > looked at sources and found one file, but its syntax is unclear for me. > Target platform is stm8 Start by looking at the peephole definition file in the sources that is automatically used. https://sourceforge.net/p/sdcc/code/HEA

Re: [Sdcc-user] Peephole rules

2016-12-16 Thread Травкин Роман
I've loocked at this file (as I mentioned earlier). Some moments push me to ask questions. There are parameters like notUsed('a'), notSame(%2 'push' 'pop'), notSame(%1 'xl' 'xh' 'yl' 'yh'), immdInRange(0 255 '+' %1 %2 %9), labelIsUncondJump(), labelRefCountChange and many others. i can look at ex

Re: [Sdcc-user] Peephole rules

2016-12-16 Thread Травкин Роман
Is this rule correct? In PM0044 STM8 CPU Programming manual popw only gets 16bit registers (X, Y) replace restart {    popw    a    popw    a} by {    popw    x    ; peephole 14a merged pop a into popw x} if notUsed('a'), notUsed('x') This rule is from file https://sourceforge.net/p/sdcc/code/HEAD/

Re: [Sdcc-user] Peephole rules

2016-12-16 Thread R0b0t1
On Fri, Dec 16, 2016 at 4:47 AM, Травкин Роман wrote: > Is this rule correct? In PM0044 STM8 CPU Programming manual popw only gets > 16bit registers (X, Y) > > replace restart { > popwa > popwa > } by { > popwx > ; peephole 14a merged pop a into popw x > } if notUsed('a

Re: [Sdcc-user] Peephole rules

2016-12-16 Thread alvin albrecht
>I've loocked at this file (as I mentioned earlier). Some moments push me to >ask questions. There are parameters like > >notUsed('a'), >notSame(%2 'push' 'pop'), >notSame(%1 'xl' 'xh' 'yl' 'yh'), >immdInRange(0 255 '+' %1 %2 %9), >labelIsUncondJump(), >labelRefCountChange >and many others. i c

Re: [Sdcc-user] Peephole rules

2016-12-16 Thread R0b0t1
On Fri, Dec 16, 2016 at 8:29 PM, alvin albrecht wrote: > > What I found useful is to examine line ~1409 in > https://sourceforge.net/p/sdcc/code/HEAD/tree/trunk/sdcc/src/SDCCpeeph.c#l1409 > (static const struct ftab). This structure defines all the conditions that > can be placed on peephole rule