produce better code for v6 %

This commit is contained in:
Bill Currie 2002-09-13 17:38:19 +00:00
parent 308ff7163f
commit eb4aa7ccec

View file

@ -1445,13 +1445,17 @@ binary_expr (int op, expr_t *e1, expr_t *e2)
{
expr_t *tmp1, *tmp2;
e = new_block_expr ();
if (e2->type < ex_string)
tmp1 = new_temp_def_expr (&type_float);
else
tmp1 = e2;
tmp2 = new_temp_def_expr (&type_float);
e2 = binary_expr ('&', e2, new_float_expr (-1.0));
e1 = binary_expr ('&', e1, new_float_expr (-1.0));
append_expr (e, assign_expr (tmp1, e2));
append_expr (e, assign_expr (tmp2,
binary_expr ('/', e1, tmp1)));
if (tmp1 != e2)
append_expr (e, new_bind_expr (e2, tmp1));
append_expr (e, new_bind_expr (binary_expr ('/', e1, tmp1),
tmp2));
e2 = binary_expr ('&', tmp2, new_float_expr (-1.0));
e->e.block.result = binary_expr ('-', tmp2, e2);
e2 = e;