some more fixes
This commit is contained in:
parent
130abb7e3b
commit
91bdfb9a12
2 changed files with 12 additions and 14 deletions
|
@ -118,7 +118,6 @@ regsave(regstr, off, size)
|
||||||
fprintf(codefile, "mov si,%ld(bp)\n", off);
|
fprintf(codefile, "mov si,%ld(bp)\n", off);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
assert( ! strcmp(regstr, "di"));
|
|
||||||
if (! firstreg) firstreg = 1;
|
if (! firstreg) firstreg = 1;
|
||||||
di_off = off;
|
di_off = off;
|
||||||
fputs("push di\n", codefile);
|
fputs("push di\n", codefile);
|
||||||
|
|
|
@ -176,8 +176,9 @@ addreg = ADDREG
|
||||||
+ RADDREG
|
+ RADDREG
|
||||||
#endif
|
#endif
|
||||||
rm = anyreg + memory2
|
rm = anyreg + memory2
|
||||||
rmnoacc = RREG + BREG + CXREG + DXREG + memory2
|
rmnoacc = RREG + BREG + CXREG + memory2
|
||||||
rmorconst = const + rm
|
rmorconst = const + rm
|
||||||
|
noregvar = const + REG + BREG + memory2
|
||||||
regorconst = const + anyreg
|
regorconst = const + anyreg
|
||||||
#ifdef REGVARS
|
#ifdef REGVARS
|
||||||
/* Needed because there is a shortage of ADDREG-registers.
|
/* Needed because there is a shortage of ADDREG-registers.
|
||||||
|
@ -304,11 +305,12 @@ loi $1==4 | addreg | | {ind_regoff2,%[1],"2"} {ind_reg2,%[1]}| |
|
||||||
{LOCAL2,%[1.ind]+2,2} {LOCAL2,%[1.ind],2} | |
|
{LOCAL2,%[1.ind]+2,2} {LOCAL2,%[1.ind],2} | |
|
||||||
... | nocoercions : ADDR_EXTERN| | {EXTERN2, %[1.off]+"+2"}
|
... | nocoercions : ADDR_EXTERN| | {EXTERN2, %[1.off]+"+2"}
|
||||||
{EXTERN2, %[1.off]} | |
|
{EXTERN2, %[1.off]} | |
|
||||||
loi $1>4 | |
|
loi $1>4 | noregvar |
|
||||||
remove(ALL)
|
remove(ALL)
|
||||||
allocate(CXREG={ANYCON,$1/2})
|
allocate(CXREG={ANYCON,$1/2})
|
||||||
"mov ax,si"
|
"mov ax,si"
|
||||||
"mov bx,di"
|
"mov bx,di"
|
||||||
|
"mov si,%[1]"
|
||||||
"sub sp,%($1%)"
|
"sub sp,%($1%)"
|
||||||
"mov di,sp"
|
"mov di,sp"
|
||||||
"rep movs"
|
"rep movs"
|
||||||
|
@ -382,7 +384,7 @@ ste | regorconst |
|
||||||
#ifdef REGVARS
|
#ifdef REGVARS
|
||||||
sil inreg($1)==2| regorconst |
|
sil inreg($1)==2| regorconst |
|
||||||
remove(referals)
|
remove(referals)
|
||||||
move(%[1],regvar($1)) | | |
|
move(%[1],{ind_reg2, regvar($1)}) | | |
|
||||||
... | nocoercions : STACK |
|
... | nocoercions : STACK |
|
||||||
"pop (%(regvar($1)%)" samecc | | |(2,26)
|
"pop (%(regvar($1)%)" samecc | | |(2,26)
|
||||||
#endif
|
#endif
|
||||||
|
@ -487,13 +489,13 @@ sti $1==4 | addreg regorconst regorconst |
|
||||||
move(%[2],{ind_regoff2, bp, tostring(%[1.ind])})
|
move(%[2],{ind_regoff2, bp, tostring(%[1.ind])})
|
||||||
move(%[3],{ind_regoff2, bp,
|
move(%[3],{ind_regoff2, bp,
|
||||||
tostring(%[1.ind]+2)})| | |
|
tostring(%[1.ind]+2)})| | |
|
||||||
sti $1>4 | |
|
sti $1>4 | noregvar |
|
||||||
remove(ALL)
|
remove(ALL)
|
||||||
allocate(CXREG={ANYCON,$1/2})
|
allocate(CXREG={ANYCON,$1/2})
|
||||||
"mov ax,si"
|
"mov ax,si"
|
||||||
"mov bx,di"
|
"mov bx,di"
|
||||||
"mov si,sp"
|
"mov si,sp"
|
||||||
"pop di"
|
"mov di,%[1]"
|
||||||
"rep movs"
|
"rep movs"
|
||||||
"mov sp,si"
|
"mov sp,si"
|
||||||
"mov si,ax"
|
"mov si,ax"
|
||||||
|
@ -629,7 +631,7 @@ mli $1==2 | X_ACC rm |
|
||||||
*/
|
*/
|
||||||
nocc erase(%[1]) | %[1] | |(2,118)+%[2]
|
nocc erase(%[1]) | %[1] | |(2,118)+%[2]
|
||||||
... | rmnoacc rmorconst |
|
... | rmnoacc rmorconst |
|
||||||
allocate(%[1],%[2],ACC=%[2],DXREG)
|
allocate(%[2],ACC=%[2],DXREG)
|
||||||
"mul %[1]"
|
"mul %[1]"
|
||||||
nocc erase(%[a]) | ax | |(2,118)+%[1]
|
nocc erase(%[a]) | ax | |(2,118)+%[1]
|
||||||
mli $1==4 | X_ACC X_DXREG |
|
mli $1==4 | X_ACC X_DXREG |
|
||||||
|
@ -642,7 +644,7 @@ mli !defined($1)| X_ACC |
|
||||||
"call .mli" | | |
|
"call .mli" | | |
|
||||||
*/
|
*/
|
||||||
dvi $1==2 | rmnoacc rmorconst |
|
dvi $1==2 | rmnoacc rmorconst |
|
||||||
allocate(%[1], %[2], ACC=%[2], DXREG)
|
allocate(%[2], ACC=%[2], DXREG)
|
||||||
"cwd"
|
"cwd"
|
||||||
"idiv %[1]"
|
"idiv %[1]"
|
||||||
erase(%[a]) | ax | |(3,176)+%[1]
|
erase(%[a]) | ax | |(3,176)+%[1]
|
||||||
|
@ -655,12 +657,12 @@ dvi !defined($1)| X_ACC |
|
||||||
*/
|
*/
|
||||||
#ifdef LONGEMPAT
|
#ifdef LONGEMPAT
|
||||||
loc loc cii dvi loc loc cii $1==2 && $2==4 && $4==4 && $5==4 && $6==2
|
loc loc cii dvi loc loc cii $1==2 && $2==4 && $4==4 && $5==4 && $6==2
|
||||||
| rm-ACC-DXREG X_ACC X_DXREG |
|
| rmnoacc X_ACC X_DXREG |
|
||||||
"idiv %[1]"
|
"idiv %[1]"
|
||||||
erase(%[2]) erase(%[3]) | ax | |(2,171)+%[1]
|
erase(%[2]) erase(%[3]) | ax | |(2,171)+%[1]
|
||||||
#endif
|
#endif
|
||||||
rmi $1==2 | rmnoacc rmorconst |
|
rmi $1==2 | rmnoacc rmorconst |
|
||||||
allocate(%[1], %[2], ACC=%[2], DXREG)
|
allocate(%[2], ACC=%[2], DXREG)
|
||||||
"cwd"
|
"cwd"
|
||||||
"idiv %[1]"
|
"idiv %[1]"
|
||||||
erase(%[a]) | dx | |(3,176)+%[1]
|
erase(%[a]) | dx | |(3,176)+%[1]
|
||||||
|
@ -673,7 +675,7 @@ rmi !defined($1)| X_ACC |
|
||||||
*/
|
*/
|
||||||
#ifdef LONGEMPAT
|
#ifdef LONGEMPAT
|
||||||
loc loc cii rmi loc loc cii $1==2 && $2==4 && $4==4 && $5==4 && $6==2
|
loc loc cii rmi loc loc cii $1==2 && $2==4 && $4==4 && $5==4 && $6==2
|
||||||
| rm-ACC-DXREG X_ACC X_DXREG |
|
| rmnoacc X_ACC X_DXREG |
|
||||||
"idiv %[1]"
|
"idiv %[1]"
|
||||||
erase(%[2]) erase(%[3]) | dx | |(2,171)+%[1]
|
erase(%[2]) erase(%[3]) | dx | |(2,171)+%[1]
|
||||||
#endif
|
#endif
|
||||||
|
@ -2441,17 +2443,14 @@ trp | X_ACC |
|
||||||
| reg_off | "add %[1.reg],%[1.off]"
|
| reg_off | "add %[1.reg],%[1.off]"
|
||||||
erase(%[1.reg]) setcc(%[1.reg])
|
erase(%[1.reg]) setcc(%[1.reg])
|
||||||
| %[1.reg] | |(2,3) + %[1]
|
| %[1.reg] | |(2,3) + %[1]
|
||||||
#ifdef DEEPER
|
|
||||||
| halfindir |
|
| halfindir |
|
||||||
allocate(%[1],REG)
|
allocate(%[1],REG)
|
||||||
move(%[1],%[a])
|
move(%[1],%[a])
|
||||||
samecc | %[a] | |(0,0)
|
samecc | %[a] | |(0,0)
|
||||||
#else
|
|
||||||
| halfindir |
|
| halfindir |
|
||||||
allocate(%[1],ADDREG)
|
allocate(%[1],ADDREG)
|
||||||
move(%[1],%[a])
|
move(%[1],%[a])
|
||||||
samecc | %[a] | |(0,0)
|
samecc | %[a] | |(0,0)
|
||||||
#endif
|
|
||||||
|
|
||||||
/********************************
|
/********************************
|
||||||
* From source to token *
|
* From source to token *
|
||||||
|
|
Loading…
Add table
Reference in a new issue