From 9ec49cb6d91f3f650b58d8bbd73c2d3e047d70ea Mon Sep 17 00:00:00 2001 From: ceriel Date: Tue, 24 Sep 1991 10:45:43 +0000 Subject: [PATCH] Avoid DVI instruction. Use library call instead --- lang/pc/comp/code.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/lang/pc/comp/code.c b/lang/pc/comp/code.c index c9e896fd5..a80d6e718 100644 --- a/lang/pc/comp/code.c +++ b/lang/pc/comp/code.c @@ -188,12 +188,9 @@ CodeBeginBlock(df) C_mli(word_size); C_loc(word_size - 1); C_adi(word_size); - C_loc(word_size); - C_dvi(word_size); - /* size in words */ - C_loc(word_size); - C_mli(word_size); - /* size in bytes */ + C_loc(word_size - 1); + C_com(word_size); + C_and(word_size); C_dup(word_size); C_lol(StackAdjustment); C_adi(word_size); @@ -531,22 +528,15 @@ CodeBoper(expr, true_label) break; 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: Operands(leftop, rightop); if( tp->tp_fund == T_INTEGER ) { - C_cal("_mdi"); + C_cal(expr->nd_symb == MOD ? "_mdi" : "_dvi"); C_asp(2 * tp->tp_size); C_lfr(tp->tp_size); } 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_lfr(tp->tp_size); } -- 2.34.1