Avoid DVI instruction. Use library call instead

This commit is contained in:
ceriel 1991-09-24 10:45:43 +00:00
parent 4ecf088423
commit 9ec49cb6d9

View file

@ -188,12 +188,9 @@ CodeBeginBlock(df)
C_mli(word_size); C_mli(word_size);
C_loc(word_size - 1); C_loc(word_size - 1);
C_adi(word_size); C_adi(word_size);
C_loc(word_size); C_loc(word_size - 1);
C_dvi(word_size); C_com(word_size);
/* size in words */ C_and(word_size);
C_loc(word_size);
C_mli(word_size);
/* size in bytes */
C_dup(word_size); C_dup(word_size);
C_lol(StackAdjustment); C_lol(StackAdjustment);
C_adi(word_size); C_adi(word_size);
@ -531,22 +528,15 @@ CodeBoper(expr, true_label)
break; break;
case DIV: case DIV:
Operands(leftop, rightop);
if( tp->tp_fund == T_INTEGER || tp->tp_fund == T_LONG)
C_dvi(tp->tp_size);
else
crash("(CodeBoper: bad type DIV)");
break;
case MOD: case MOD:
Operands(leftop, rightop); Operands(leftop, rightop);
if( tp->tp_fund == T_INTEGER ) { if( tp->tp_fund == T_INTEGER ) {
C_cal("_mdi"); C_cal(expr->nd_symb == MOD ? "_mdi" : "_dvi");
C_asp(2 * tp->tp_size); C_asp(2 * tp->tp_size);
C_lfr(tp->tp_size); C_lfr(tp->tp_size);
} }
else if( tp->tp_fund == T_LONG) { else if( tp->tp_fund == T_LONG) {
C_cal("_mdil"); C_cal(expr->nd_symb == MOD ? "_mdil" : "_dvil");
C_asp(2 * tp->tp_size); C_asp(2 * tp->tp_size);
C_lfr(tp->tp_size); C_lfr(tp->tp_size);
} }