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:
sater 1984-07-18 13:39:24 +00:00
parent 8af636a3c1
commit 8304ce5eae

View file

@ -34,8 +34,8 @@
*
*/
/* #define REGPATCH /* save all registers in link block */
/* #define UNTESTED /* include untested rules */
/* #define REGPATCH \* save all registers in link block */
/* #define UNTESTED \* include untested rules */
#ifdef REGPATCH
#define SL 8
@ -48,7 +48,7 @@
#define NC nocoercions:
/* options */
/* #define DORCK /* rck is expanded instead of thrown away */
/* #define DORCK \* rck is expanded instead of thrown away */
#define REGVARS /* use register variables */
EM_WSIZE=2
@ -383,50 +383,50 @@ sti $1==2 | REG xsource2 |
sti $1==1 | REG source1or2 |
INDSTORE
move(%[2],{regdef1,%[1]}) | | |
... | NC regconst2 source1or2 |
... | regconst2 source1or2 |
INDSTORE
move(%[2],{regind1,%[1.reg],%[1.ind]}) | | |
... | NC ADDR_EXTERNAL source1or2 |
... | ADDR_EXTERNAL source1or2 |
INDSTORE
move(%[2],{relative1,%[1.ind]}) | | |
... | NC ADDR_LOCAL source1or2 |
... | ADDR_LOCAL source1or2 |
INDSTORE
move(%[2],{regind1, lb, tostring(%[1.ind])}) | | |
... | NC relative2 source1or2 |
... | relative2 source1or2 |
INDSTORE
move(%[2],{reldef1,%[1.ind]}) | | |
... | NC regind2 source1or2 |
... | regind2 source1or2 |
INDSTORE
move(%[2],{reginddef1,%[1.reg],%[1.ind]}) | | |
sti $1==4 | NC dadres2 FLT_REG |
sti $1==4 | dadres2 FLT_REG |
INDSTORE
"movfo %[2],*%[1]"
samecc | | |
... | NC dadres2 ftolong |
... | dadres2 ftolong |
INDSTORE
"setl\nmovfi %[2.reg],*%[1]\nseti"
samecc | | |
... | NC regconst2 FLT_REG |
... | regconst2 FLT_REG |
INDSTORE
"movfo %[2],%[1.ind](%[1.reg])"
samecc | | |
... | NC regconst2 ftolong |
... | regconst2 ftolong |
INDSTORE
"setl\nmovfi %[2.reg],%[1.ind](%[1.reg])\nseti"
samecc | | |
... | NC ADDR_LOCAL FLT_REG |
... | ADDR_LOCAL FLT_REG |
INDSTORE
"movfo %[2],%[1.ind](r5)"
samecc | | |
... | NC ADDR_LOCAL ftolong |
... | ADDR_LOCAL ftolong |
INDSTORE
"setl\nmovfi %[2.reg],%[1.ind](r5)\nseti"
samecc | | |
... | NC ADDR_EXTERNAL FLT_REG |
... | ADDR_EXTERNAL FLT_REG |
INDSTORE
"movfo %[2],%[1.ind]"
samecc | | |
... | NC ADDR_EXTERNAL ftolong |
... | ADDR_EXTERNAL ftolong |
INDSTORE
"setl\nmovfi %[2.reg],%[1.ind]\nseti"
samecc | | |
@ -438,19 +438,19 @@ sti $1==4 | NC dadres2 FLT_REG |
"mov (sp)+,(%[1])+"
"mov (sp)+,(%[1])"
erase(%[1]) | | | (4,2040)
sti $1==8 | NC dadres2 DBL_REG |
sti $1==8 | dadres2 DBL_REG |
INDSTORE
"movf %[2],*%[1]"
samecc | | |
... | NC regconst2 DBL_REG |
... | regconst2 DBL_REG |
INDSTORE
"movf %[2],%[1.ind](%[1.reg])"
samecc | | |
... | NC ADDR_LOCAL DBL_REG |
... | ADDR_LOCAL DBL_REG |
INDSTORE
"movf %[2],%[1.ind](r5)"
samecc | | |
... | NC ADDR_EXTERNAL DBL_REG |
... | ADDR_EXTERNAL DBL_REG |
INDSTORE
"movf %[2],%[1.ind]"
samecc | | |
@ -558,6 +558,8 @@ adi $1==2 | NC SCR_REG CONST2 | | {regconst2,%[1],tostring(%[2.num])} | |
... | NC SCR_REG regconst2 |
"add %[2.reg],%[1]" erase(%[1]) |
{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 |
allocate(%[1],REG=%[1]) | %[2] %[a] | adi 2 |
... | NC regconst2 CONST2 | |
@ -617,6 +619,7 @@ adi !defined($1)| source2 |
move(%[1],r0)
"jsr pc,adi~" | | |
#endif
loc sbi $2==2 | | | | loc 0-$1 adi 2 |
sbi $1==2 | source2 SCR_REG |
"sub %[1],%[2]"
setcc(%[2]) erase(%[2]) | %[2] | | (2,450)+%[1]
@ -789,6 +792,7 @@ rmu !defined($1)| source2 |
"jsr pc,rmu~" | | |
#endif
slu | | | | sli $1 |
loc slu | | | | loc $1 sli $2 |
sru $1==2 | SCR_REG xsource2 |
allocate(%[2],REG_PAIR)
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 | |
allocate(REG=regvar($1)) | %[a]
| 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 | |
remove(regvar($1))
"inc %(regvar($1)%)"
@ -2282,7 +2289,8 @@ ret | | remove(all)
* Group 15 : Miscellaneous instructions *
************************************************/
asp $1==2 | | remove(all)
asp $1==2 | NC xsource2 | | | |
... | | remove(all)
"tst (sp)+" | | |
asp $1==4 | | remove(all)
"cmp (sp)+,(sp)+" | | |
@ -2352,11 +2360,16 @@ csa !defined($1)| source2 |
"mov (sp)+,r1"
"jmp csa~" | | |
#endif
lae csb $2==2 | source2 |
lae csb $2==2 | NC source2 |
remove(all)
move(%[1],r1)
move({ADDR_EXTERNAL,$1},r0)
"jmp csb~" | | |
... | |
remove(all)
move({ADDR_EXTERNAL,$1},r0)
"mov (sp)+,r1"
"jmp csb~" | | |
csb $1==2 | |
remove(all)