From 086bbd21cd1f4ef5c83ac82601ddd0be2f20e357 Mon Sep 17 00:00:00 2001 From: Toon Moene Date: Wed, 10 Jul 2002 23:13:26 +0200 Subject: [PATCH] Revert all patches for optimization of Complex .op. 2002-07-10 Toon Moene Revert all patches for optimization of Complex .op. Real. * complex_part_zero_p: Remove * expand_cmplxdiv_straight: Replace complex_part_zero_p(x) with x. * expand_cmplxdiv_wide: Ditto. * expand_binop: Ditto. From-SVN: r55379 --- gcc/ChangeLog | 9 +++++++++ gcc/optabs.c | 36 ++++++++---------------------------- 2 files changed, 17 insertions(+), 28 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 39f35e58897..a654380521e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2002-07-10 Toon Moene + + Revert all patches for optimization of Complex .op. Real. + * complex_part_zero_p: Remove + * expand_cmplxdiv_straight: Replace complex_part_zero_p(x) + with x. + * expand_cmplxdiv_wide: Ditto. + * expand_binop: Ditto. + 2002-07-10 Marek Michalkiewicz * config/avr/avr.md: Fix two 0x80000000 constants to make them diff --git a/gcc/optabs.c b/gcc/optabs.c index c9230618e45..dcb4df5f04b 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -108,8 +108,6 @@ static rtx ftruncify PARAMS ((rtx)); static optab new_optab PARAMS ((void)); static inline optab init_optab PARAMS ((enum rtx_code)); static inline optab init_optabv PARAMS ((enum rtx_code)); -static inline int complex_part_zero_p PARAMS ((rtx, enum mode_class, - enum machine_mode)); static void init_libfuncs PARAMS ((optab, int, int, const char *, int)); static void init_integral_libfuncs PARAMS ((optab, const char *, int)); static void init_floating_libfuncs PARAMS ((optab, const char *, int)); @@ -241,22 +239,6 @@ widen_operand (op, mode, oldmode, unsignedp, no_extend) return result; } -/* Test whether either the real or imaginary part of a complex floating - point number is 0.0, so that it can be ignored (when compiling - with -funsafe-math-optimizations). */ - -static inline int -complex_part_zero_p (part, class, submode) - rtx part; - enum mode_class class; - enum machine_mode submode; -{ - return part == 0 || - (flag_unsafe_math_optimizations - && class == MODE_COMPLEX_FLOAT - && part == CONST0_RTX (submode)); -} - /* Generate code to perform a straightforward complex divide. */ static int @@ -310,7 +292,7 @@ expand_cmplxdiv_straight (real0, real1, imag0, imag1, realr, imagr, submode, if (divisor == 0) return 0; - if (complex_part_zero_p (imag0, class, submode)) + if (imag0 == 0) { /* Mathematically, ((a)(c-id))/divisor. */ /* Computationally, (a+i0) / (c+id) = (ac/(cc+dd)) + i(-ad/(cc+dd)). */ @@ -476,7 +458,7 @@ expand_cmplxdiv_wide (real0, real1, imag0, imag1, realr, imagr, submode, /* Calculate dividend. */ - if (complex_part_zero_p (imag0, class, submode)) + if (imag0 == 0) { real_t = real0; @@ -581,7 +563,7 @@ expand_cmplxdiv_wide (real0, real1, imag0, imag1, realr, imagr, submode, /* Calculate dividend. */ - if (complex_part_zero_p (imag0, class, submode)) + if (imag0 == 0) { /* Compute a / (c+id) as a(c/d) / (c(c/d)+d) + i (-a) / (c(c/d)+d). */ @@ -1609,11 +1591,10 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods) else if (res != realr) emit_move_insn (realr, res); - if (!complex_part_zero_p (imag0, class, submode) - && !complex_part_zero_p (imag1, class, submode)) + if (imag0 != 0 && imag1 != 0) res = expand_binop (submode, binoptab, imag0, imag1, imagr, unsignedp, methods); - else if (!complex_part_zero_p (imag0, class, submode)) + else if (imag0 != 0) res = imag0; else if (binoptab->code == MINUS) res = expand_unop (submode, @@ -1633,8 +1614,7 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods) case MULT: /* (a+ib) * (c+id) = (ac-bd) + i(ad+cb) */ - if (!complex_part_zero_p (imag0, class, submode) - && !complex_part_zero_p (imag1, class, submode)) + if (imag0 != 0 && imag1 != 0) { rtx temp1, temp2; @@ -1697,7 +1677,7 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods) else if (res != realr) emit_move_insn (realr, res); - if (!complex_part_zero_p (imag0, class, submode)) + if (imag0 != 0) res = expand_binop (submode, binoptab, real1, imag0, imagr, unsignedp, methods); else @@ -1716,7 +1696,7 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods) case DIV: /* (a+ib) / (c+id) = ((ac+bd)/(cc+dd)) + i((bc-ad)/(cc+dd)) */ - if (complex_part_zero_p (imag1, class, submode)) + if (imag1 == 0) { /* (a+ib) / (c+i0) = (a/c) + i(b/c) */ -- 2.30.2