From c0fe508e8b201c7789a66f252609a0f9006acfe9 Mon Sep 17 00:00:00 2001 From: Toon Moene Date: Mon, 20 May 2002 10:30:03 +0200 Subject: [PATCH] optabs.c (expand_cmplxdiv_wide): Use complex_part_zero_p. 2002-05-19 Toon Moene * optabs.c (expand_cmplxdiv_wide): Use complex_part_zero_p. (expand_binop): Ditto (3 times). From-SVN: r53655 --- gcc/ChangeLog | 5 +++++ gcc/optabs.c | 14 ++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 96fe9c3ba90..31e4d6e73a1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-05-19 Toon Moene + + * optabs.c (expand_cmplxdiv_wide): Use complex_part_zero_p. + (expand_binop): Ditto (3 times). + 2002-05-19 Mark Mitchell * Makefile.in (distclean): Remove QMTest stuff. diff --git a/gcc/optabs.c b/gcc/optabs.c index 49771df1e98..46b86c534da 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -554,7 +554,7 @@ expand_cmplxdiv_wide (real0, real1, imag0, imag1, realr, imagr, submode, /* Calculate dividend. */ - if (imag0 == 0) + if (complex_part_zero_p (imag0, class, submode)) { /* Compute a / (c+id) as a(c/d) / (c(c/d)+d) + i (-a) / (c(c/d)+d). */ @@ -1553,7 +1553,7 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods) else real1 = op1; - if (real0 == 0 || real1 == 0 || ! (imag0 != 0|| imag1 != 0)) + if (real0 == 0 || real1 == 0 || ! (imag0 != 0 || imag1 != 0)) abort (); switch (binoptab->code) @@ -1570,10 +1570,11 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods) else if (res != realr) emit_move_insn (realr, res); - if (imag0 && imag1) + if (!complex_part_zero_p (imag0, class, submode) + && !complex_part_zero_p (imag1, class, submode)) res = expand_binop (submode, binoptab, imag0, imag1, imagr, unsignedp, methods); - else if (imag0) + else if (!complex_part_zero_p (imag0, class, submode)) res = imag0; else if (binoptab->code == MINUS) res = expand_unop (submode, @@ -1593,7 +1594,8 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods) case MULT: /* (a+ib) * (c+id) = (ac-bd) + i(ad+cb) */ - if (imag0 && imag1) + if (!complex_part_zero_p (imag0, class, submode) + && !complex_part_zero_p (imag1, class, submode)) { rtx temp1, temp2; @@ -1656,7 +1658,7 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods) else if (res != realr) emit_move_insn (realr, res); - if (imag0 != 0) + if (!complex_part_zero_p (imag0, class, submode)) res = expand_binop (submode, binoptab, real1, imag0, imagr, unsignedp, methods); else