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
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
> ---
> 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
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
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/
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
>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
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