improved some code for floating point

This commit is contained in:
ceriel 1988-01-11 17:06:11 +00:00
parent 897b86cba2
commit 538896f0a3
2 changed files with 39 additions and 49 deletions

View file

@ -73,7 +73,7 @@ con_float() {
p = (char *) &f; p = (char *) &f;
} }
fprintf(codefile, ".data1 0%o", *p++ & 0377); fprintf(codefile, ".data1 0%o", *p++ & 0377);
for (i = argval-2; i; i--) { for (i = argval-1; i; i--) {
fprintf(codefile,",0%o", *p++ & 0377); fprintf(codefile,",0%o", *p++ & 0377);
} }
#else OWNFLOAT #else OWNFLOAT

View file

@ -714,6 +714,7 @@ loc sli $1==1 && $2==4 | X_REG X_REG |
"sal %[1],1" "sal %[1],1"
"rcl %[2],1" "rcl %[2],1"
erase(%[1]) erase(%[2]) | %[2] %[1] | | erase(%[1]) erase(%[2]) | %[2] %[1] | |
loc sli $1==16 && $2==4 | rmorconst rmorconst | | %[1] {ANYCON, 0} | |
sli $1==2 | SHIFT_CREG X_REG | sli $1==2 | SHIFT_CREG X_REG |
"sal %[2],cl" "sal %[2],cl"
setcc(%[2]) erase(%[2]) | %[2] | | (2,8) setcc(%[2]) erase(%[2]) | %[2] | | (2,8)
@ -790,10 +791,12 @@ rmu !defined($1)| X_ACC |
"call .rmu" erase(%[1]) | | | "call .rmu" erase(%[1]) | | |
*/ */
slu | | | | sli $1 | slu | | | | sli $1 |
loc slu | | | | loc $1 sli $2 |
lol loc slu | | | | lol $1 loc $2 sli $3 | lol loc slu | | | | lol $1 loc $2 sli $3 |
loc sru $1==1 && $2==2 | X_REG | loc sru $1==1 && $2==2 | X_REG |
"shr %[1],1" "shr %[1],1"
setcc(%[1]) erase(%[1]) | %[1] | | (2,2) setcc(%[1]) erase(%[1]) | %[1] | | (2,2)
loc sru $1==16 && $2==4 | rmorconst rmorconst | | {ANYCON, 0} %[2] | |
sru $1==2 | SHIFT_CREG X_REG | sru $1==2 | SHIFT_CREG X_REG |
"shr %[2],cl" "shr %[2],cl"
setcc(%[2]) erase(%[2]) | %[2] | | (2,8) setcc(%[2]) erase(%[2]) | %[2] | | (2,8)
@ -831,24 +834,18 @@ ngf $1==4 | | | | cal ".ngf4" |
ngf $1==8 | | | | cal ".ngf8" | ngf $1==8 | | | | cal ".ngf8" |
fif $1==4 | | | | cal ".fif4" | fif $1==4 | | | | cal ".fif4" |
fif $1==8 | | | | cal ".fif8" | fif $1==8 | | | | cal ".fif8" |
fef $1==4 | | fef $1==4 | X_REG X_REG |
remove(ALL) remove(ALL)
"pop bx" "push %[2]"
"pop ax" "push %[2]"
"push ax" "push %[1]" | | cal ".fef4" |
"push ax" fef $1==8 | X_REG X_REG X_REG X_REG |
"push bx" | | cal ".fef4" |
fef $1==8 | |
remove(ALL) remove(ALL)
"pop ax" "push %[4]"
"pop bx" "push %[4]"
"pop cx" "push %[3]"
"pop dx" "push %[2]"
"push dx" "push %[1]" | | cal ".fef8" |
"push dx"
"push cx"
"push bx"
"push ax" | | cal ".fef8" |
/**************************************** /****************************************
* Group 6 : pointer arithmetic. * * Group 6 : pointer arithmetic. *
@ -1534,21 +1531,18 @@ loc loc cif $1==4 && $2==4 | |
remove(ALL) remove(ALL)
"mov ax,$1" "mov ax,$1"
"push ax" | | cal ".cif4" asp 2 | "push ax" | | cal ".cif4" asp 2 |
loc loc cif $1==2 && $2==8 | | loc loc cif $1==2 && $2==8 | X_REG |
remove(ALL) remove(ALL)
"pop ax" "push %[1]"
"push ax" "push %[1]"
"push ax" "push %[1]"
"push ax"
"mov ax,$1" "mov ax,$1"
"push ax" | | cal ".cif8" | "push ax" | | cal ".cif8" |
loc loc cif $1==4 && $2==8 | | loc loc cif $1==4 && $2==8 | X_REG X_REG |
remove(ALL) remove(ALL)
"pop ax" "push %[1]"
"pop dx" "push %[2]"
"push ax" "push %[1]"
"push ax"
"push dx"
"mov ax,$1" "mov ax,$1"
"push ax" | | cal ".cif8" | "push ax" | | cal ".cif8" |
loc loc cuf $1==2 && $2==4 | | loc loc cuf $1==2 && $2==4 | |
@ -1559,21 +1553,18 @@ loc loc cuf $1==4 && $2==4 | |
remove(ALL) remove(ALL)
"mov ax,$1" "mov ax,$1"
"push ax" | | cal ".cuf4" asp 2 | "push ax" | | cal ".cuf4" asp 2 |
loc loc cuf $1==2 && $2==8 | | loc loc cuf $1==2 && $2==8 | X_REG |
remove(ALL) remove(ALL)
"pop ax" "push %[1]"
"push ax" "push %[1]"
"push ax" "push %[1]"
"push ax"
"mov ax,$1" "mov ax,$1"
"push ax" | | cal ".cuf8" | "push ax" | | cal ".cuf8" |
loc loc cuf $1==4 && $2==8 | | loc loc cuf $1==4 && $2==8 | X_REG X_REG |
remove(ALL) remove(ALL)
"pop ax" "push %[1]"
"pop dx" "push %[2]"
"push ax" "push %[1]"
"push ax"
"push dx"
"mov ax,$1" "mov ax,$1"
"push ax" | | cal ".cuf8" | "push ax" | | cal ".cuf8" |
loc loc cfi $1==4 && $2==2 | | loc loc cfi $1==4 && $2==2 | |
@ -1605,7 +1596,7 @@ loc loc cfu $1==4 && $2==2 | |
"mov ax,$1" "mov ax,$1"
"push ax" "push ax"
"mov ax,$2" "mov ax,$2"
"push ax" | | cal ".cfu" asp 6 | "push ax" | | cal ".cfu" asp 8 lfr 2 |
loc loc cfu $1==4 && $2==4 | | loc loc cfu $1==4 && $2==4 | |
remove(ALL) remove(ALL)
"mov ax,$1" "mov ax,$1"
@ -1617,7 +1608,7 @@ loc loc cfu $1==8 && $2==2 | |
"mov ax,$1" "mov ax,$1"
"push ax" "push ax"
"mov ax,$2" "mov ax,$2"
"push ax" | | cal ".cfu" asp 10 | "push ax" | | cal ".cfu" asp 12 lfr 2 |
loc loc cfu $1==8 && $2==4 | | loc loc cfu $1==8 && $2==4 | |
remove(ALL) remove(ALL)
"mov ax,$1" "mov ax,$1"
@ -1626,15 +1617,14 @@ loc loc cfu $1==8 && $2==4 | |
"push ax" | | cal ".cfu" asp 8 | "push ax" | | cal ".cfu" asp 8 |
loc loc cff $1==8 && $2==4 | | loc loc cff $1==8 && $2==4 | |
remove(ALL) | | cal ".cff4" asp 4 | remove(ALL) | | cal ".cff4" asp 4 |
loc loc cff $1==4 && $2==8 | | loc loc cff $1==4 && $2==8 | X_REG X_REG |
remove(ALL) remove(ALL)
"pop bx" allocate(REG)
"pop dx" "xor %[a],%[a]"
"xor ax,ax" "push %[a]"
"push ax" "push %[a]"
"push ax" "push %[2]"
"push dx" "push %[1]" | | cal ".cff8" |
"push bx" | | cal ".cff8" |
/**************************************** /****************************************
* Group 9 : Logical instructions * * Group 9 : Logical instructions *