removed recursive comments
removed NC with sti rules added rule to reverse operands of adi 2 added rule to convert loc sbi to loc adi added loc slu -> loc sli rule added local++ rule added rule for asping xsource2 added rule for csb when nothing on stack
This commit is contained in:
parent
8af636a3c1
commit
8304ce5eae
1 changed files with 35 additions and 22 deletions
|
@ -34,8 +34,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* #define REGPATCH /* save all registers in link block */
|
/* #define REGPATCH \* save all registers in link block */
|
||||||
/* #define UNTESTED /* include untested rules */
|
/* #define UNTESTED \* include untested rules */
|
||||||
|
|
||||||
#ifdef REGPATCH
|
#ifdef REGPATCH
|
||||||
#define SL 8
|
#define SL 8
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
#define NC nocoercions:
|
#define NC nocoercions:
|
||||||
|
|
||||||
/* options */
|
/* options */
|
||||||
/* #define DORCK /* rck is expanded instead of thrown away */
|
/* #define DORCK \* rck is expanded instead of thrown away */
|
||||||
#define REGVARS /* use register variables */
|
#define REGVARS /* use register variables */
|
||||||
|
|
||||||
EM_WSIZE=2
|
EM_WSIZE=2
|
||||||
|
@ -383,50 +383,50 @@ sti $1==2 | REG xsource2 |
|
||||||
sti $1==1 | REG source1or2 |
|
sti $1==1 | REG source1or2 |
|
||||||
INDSTORE
|
INDSTORE
|
||||||
move(%[2],{regdef1,%[1]}) | | |
|
move(%[2],{regdef1,%[1]}) | | |
|
||||||
... | NC regconst2 source1or2 |
|
... | regconst2 source1or2 |
|
||||||
INDSTORE
|
INDSTORE
|
||||||
move(%[2],{regind1,%[1.reg],%[1.ind]}) | | |
|
move(%[2],{regind1,%[1.reg],%[1.ind]}) | | |
|
||||||
... | NC ADDR_EXTERNAL source1or2 |
|
... | ADDR_EXTERNAL source1or2 |
|
||||||
INDSTORE
|
INDSTORE
|
||||||
move(%[2],{relative1,%[1.ind]}) | | |
|
move(%[2],{relative1,%[1.ind]}) | | |
|
||||||
... | NC ADDR_LOCAL source1or2 |
|
... | ADDR_LOCAL source1or2 |
|
||||||
INDSTORE
|
INDSTORE
|
||||||
move(%[2],{regind1, lb, tostring(%[1.ind])}) | | |
|
move(%[2],{regind1, lb, tostring(%[1.ind])}) | | |
|
||||||
... | NC relative2 source1or2 |
|
... | relative2 source1or2 |
|
||||||
INDSTORE
|
INDSTORE
|
||||||
move(%[2],{reldef1,%[1.ind]}) | | |
|
move(%[2],{reldef1,%[1.ind]}) | | |
|
||||||
... | NC regind2 source1or2 |
|
... | regind2 source1or2 |
|
||||||
INDSTORE
|
INDSTORE
|
||||||
move(%[2],{reginddef1,%[1.reg],%[1.ind]}) | | |
|
move(%[2],{reginddef1,%[1.reg],%[1.ind]}) | | |
|
||||||
sti $1==4 | NC dadres2 FLT_REG |
|
sti $1==4 | dadres2 FLT_REG |
|
||||||
INDSTORE
|
INDSTORE
|
||||||
"movfo %[2],*%[1]"
|
"movfo %[2],*%[1]"
|
||||||
samecc | | |
|
samecc | | |
|
||||||
... | NC dadres2 ftolong |
|
... | dadres2 ftolong |
|
||||||
INDSTORE
|
INDSTORE
|
||||||
"setl\nmovfi %[2.reg],*%[1]\nseti"
|
"setl\nmovfi %[2.reg],*%[1]\nseti"
|
||||||
samecc | | |
|
samecc | | |
|
||||||
... | NC regconst2 FLT_REG |
|
... | regconst2 FLT_REG |
|
||||||
INDSTORE
|
INDSTORE
|
||||||
"movfo %[2],%[1.ind](%[1.reg])"
|
"movfo %[2],%[1.ind](%[1.reg])"
|
||||||
samecc | | |
|
samecc | | |
|
||||||
... | NC regconst2 ftolong |
|
... | regconst2 ftolong |
|
||||||
INDSTORE
|
INDSTORE
|
||||||
"setl\nmovfi %[2.reg],%[1.ind](%[1.reg])\nseti"
|
"setl\nmovfi %[2.reg],%[1.ind](%[1.reg])\nseti"
|
||||||
samecc | | |
|
samecc | | |
|
||||||
... | NC ADDR_LOCAL FLT_REG |
|
... | ADDR_LOCAL FLT_REG |
|
||||||
INDSTORE
|
INDSTORE
|
||||||
"movfo %[2],%[1.ind](r5)"
|
"movfo %[2],%[1.ind](r5)"
|
||||||
samecc | | |
|
samecc | | |
|
||||||
... | NC ADDR_LOCAL ftolong |
|
... | ADDR_LOCAL ftolong |
|
||||||
INDSTORE
|
INDSTORE
|
||||||
"setl\nmovfi %[2.reg],%[1.ind](r5)\nseti"
|
"setl\nmovfi %[2.reg],%[1.ind](r5)\nseti"
|
||||||
samecc | | |
|
samecc | | |
|
||||||
... | NC ADDR_EXTERNAL FLT_REG |
|
... | ADDR_EXTERNAL FLT_REG |
|
||||||
INDSTORE
|
INDSTORE
|
||||||
"movfo %[2],%[1.ind]"
|
"movfo %[2],%[1.ind]"
|
||||||
samecc | | |
|
samecc | | |
|
||||||
... | NC ADDR_EXTERNAL ftolong |
|
... | ADDR_EXTERNAL ftolong |
|
||||||
INDSTORE
|
INDSTORE
|
||||||
"setl\nmovfi %[2.reg],%[1.ind]\nseti"
|
"setl\nmovfi %[2.reg],%[1.ind]\nseti"
|
||||||
samecc | | |
|
samecc | | |
|
||||||
|
@ -438,19 +438,19 @@ sti $1==4 | NC dadres2 FLT_REG |
|
||||||
"mov (sp)+,(%[1])+"
|
"mov (sp)+,(%[1])+"
|
||||||
"mov (sp)+,(%[1])"
|
"mov (sp)+,(%[1])"
|
||||||
erase(%[1]) | | | (4,2040)
|
erase(%[1]) | | | (4,2040)
|
||||||
sti $1==8 | NC dadres2 DBL_REG |
|
sti $1==8 | dadres2 DBL_REG |
|
||||||
INDSTORE
|
INDSTORE
|
||||||
"movf %[2],*%[1]"
|
"movf %[2],*%[1]"
|
||||||
samecc | | |
|
samecc | | |
|
||||||
... | NC regconst2 DBL_REG |
|
... | regconst2 DBL_REG |
|
||||||
INDSTORE
|
INDSTORE
|
||||||
"movf %[2],%[1.ind](%[1.reg])"
|
"movf %[2],%[1.ind](%[1.reg])"
|
||||||
samecc | | |
|
samecc | | |
|
||||||
... | NC ADDR_LOCAL DBL_REG |
|
... | ADDR_LOCAL DBL_REG |
|
||||||
INDSTORE
|
INDSTORE
|
||||||
"movf %[2],%[1.ind](r5)"
|
"movf %[2],%[1.ind](r5)"
|
||||||
samecc | | |
|
samecc | | |
|
||||||
... | NC ADDR_EXTERNAL DBL_REG |
|
... | ADDR_EXTERNAL DBL_REG |
|
||||||
INDSTORE
|
INDSTORE
|
||||||
"movf %[2],%[1.ind]"
|
"movf %[2],%[1.ind]"
|
||||||
samecc | | |
|
samecc | | |
|
||||||
|
@ -558,6 +558,8 @@ adi $1==2 | NC SCR_REG CONST2 | | {regconst2,%[1],tostring(%[2.num])} | |
|
||||||
... | NC SCR_REG regconst2 |
|
... | NC SCR_REG regconst2 |
|
||||||
"add %[2.reg],%[1]" erase(%[1]) |
|
"add %[2.reg],%[1]" erase(%[1]) |
|
||||||
{regconst2,%[1],%[2.ind]} | | (2,450)
|
{regconst2,%[1],%[2.ind]} | | (2,450)
|
||||||
|
... | NC CONST2+ADDR_EXTERNAL+ADDR_LOCAL+regconst2 SCR_REG |
|
||||||
|
| %[1] %[2] | adi 2 |
|
||||||
... | NC source2-REG CONST2+ADDR_EXTERNAL+ADDR_LOCAL |
|
... | NC source2-REG CONST2+ADDR_EXTERNAL+ADDR_LOCAL |
|
||||||
allocate(%[1],REG=%[1]) | %[2] %[a] | adi 2 |
|
allocate(%[1],REG=%[1]) | %[2] %[a] | adi 2 |
|
||||||
... | NC regconst2 CONST2 | |
|
... | NC regconst2 CONST2 | |
|
||||||
|
@ -617,6 +619,7 @@ adi !defined($1)| source2 |
|
||||||
move(%[1],r0)
|
move(%[1],r0)
|
||||||
"jsr pc,adi~" | | |
|
"jsr pc,adi~" | | |
|
||||||
#endif
|
#endif
|
||||||
|
loc sbi $2==2 | | | | loc 0-$1 adi 2 |
|
||||||
sbi $1==2 | source2 SCR_REG |
|
sbi $1==2 | source2 SCR_REG |
|
||||||
"sub %[1],%[2]"
|
"sub %[1],%[2]"
|
||||||
setcc(%[2]) erase(%[2]) | %[2] | | (2,450)+%[1]
|
setcc(%[2]) erase(%[2]) | %[2] | | (2,450)+%[1]
|
||||||
|
@ -789,6 +792,7 @@ rmu !defined($1)| source2 |
|
||||||
"jsr pc,rmu~" | | |
|
"jsr pc,rmu~" | | |
|
||||||
#endif
|
#endif
|
||||||
slu | | | | sli $1 |
|
slu | | | | sli $1 |
|
||||||
|
loc slu | | | | loc $1 sli $2 |
|
||||||
sru $1==2 | SCR_REG xsource2 |
|
sru $1==2 | SCR_REG xsource2 |
|
||||||
allocate(%[2],REG_PAIR)
|
allocate(%[2],REG_PAIR)
|
||||||
move(%[2],%[a.2])
|
move(%[2],%[a.2])
|
||||||
|
@ -1029,6 +1033,9 @@ lol lol adp stl sti $1==$2 && $2==$4 && inreg($1)==2 && $3==2 && $5==2 | source2
|
||||||
lol lol adp stl $1==$2 && $2==$4 && inreg($1)==2 | |
|
lol lol adp stl $1==$2 && $2==$4 && inreg($1)==2 | |
|
||||||
allocate(REG=regvar($1)) | %[a]
|
allocate(REG=regvar($1)) | %[a]
|
||||||
| lol $2 adp $3 stl $2 |
|
| lol $2 adp $3 stl $2 |
|
||||||
|
lol lol adp stl $1==$2 && $2==$4 | |
|
||||||
|
allocate(REG={LOCAL2, $1, 2}) | %[a]
|
||||||
|
| lol $2 adp $3 stl $2 |
|
||||||
lol adp stl $1==$3 && $2==1 && inreg($1)==2 | |
|
lol adp stl $1==$3 && $2==1 && inreg($1)==2 | |
|
||||||
remove(regvar($1))
|
remove(regvar($1))
|
||||||
"inc %(regvar($1)%)"
|
"inc %(regvar($1)%)"
|
||||||
|
@ -2282,7 +2289,8 @@ ret | | remove(all)
|
||||||
* Group 15 : Miscellaneous instructions *
|
* Group 15 : Miscellaneous instructions *
|
||||||
************************************************/
|
************************************************/
|
||||||
|
|
||||||
asp $1==2 | | remove(all)
|
asp $1==2 | NC xsource2 | | | |
|
||||||
|
... | | remove(all)
|
||||||
"tst (sp)+" | | |
|
"tst (sp)+" | | |
|
||||||
asp $1==4 | | remove(all)
|
asp $1==4 | | remove(all)
|
||||||
"cmp (sp)+,(sp)+" | | |
|
"cmp (sp)+,(sp)+" | | |
|
||||||
|
@ -2352,11 +2360,16 @@ csa !defined($1)| source2 |
|
||||||
"mov (sp)+,r1"
|
"mov (sp)+,r1"
|
||||||
"jmp csa~" | | |
|
"jmp csa~" | | |
|
||||||
#endif
|
#endif
|
||||||
lae csb $2==2 | source2 |
|
lae csb $2==2 | NC source2 |
|
||||||
remove(all)
|
remove(all)
|
||||||
move(%[1],r1)
|
move(%[1],r1)
|
||||||
move({ADDR_EXTERNAL,$1},r0)
|
move({ADDR_EXTERNAL,$1},r0)
|
||||||
"jmp csb~" | | |
|
"jmp csb~" | | |
|
||||||
|
... | |
|
||||||
|
remove(all)
|
||||||
|
move({ADDR_EXTERNAL,$1},r0)
|
||||||
|
"mov (sp)+,r1"
|
||||||
|
"jmp csb~" | | |
|
||||||
|
|
||||||
csb $1==2 | |
|
csb $1==2 | |
|
||||||
remove(all)
|
remove(all)
|
||||||
|
|
Loading…
Add table
Reference in a new issue