optabs.c (expand_cmplxdiv_wide): Use complex_part_zero_p.
authorToon Moene <toon@moene.indiv.nluug.nl>
Mon, 20 May 2002 08:30:03 +0000 (10:30 +0200)
committerToon Moene <toon@gcc.gnu.org>
Mon, 20 May 2002 08:30:03 +0000 (08:30 +0000)
2002-05-19  Toon Moene  <toon@moene.indiv.nluug.nl>

* optabs.c (expand_cmplxdiv_wide): Use complex_part_zero_p.
(expand_binop): Ditto (3 times).

From-SVN: r53655

gcc/ChangeLog
gcc/optabs.c

index 96fe9c3ba906ee688e26d4f2a6165e386c8854ef..31e4d6e73a1ab5b49950abb207d9ca6a50ff490d 100644 (file)
@@ -1,3 +1,8 @@
+2002-05-19  Toon Moene  <toon@moene.indiv.nluug.nl>
+
+       * optabs.c (expand_cmplxdiv_wide): Use complex_part_zero_p.
+       (expand_binop): Ditto (3 times).
+
 2002-05-19  Mark Mitchell  <mitchell@doubledemon.codesourcery.com>
 
        * Makefile.in (distclean): Remove QMTest stuff.
index 49771df1e98b992bdf5ff71882cde6147c70409c..46b86c534dad6fd47ecec5fbd95fd77923af66c2 100644 (file)
@@ -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