diff options
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r-- | gcc/optabs.c | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c index 9b4d4f1059c..2b9091bcf4e 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -359,10 +359,14 @@ widen_operand (op, mode, oldmode, unsignedp, no_extend) /* Generate code to perform a straightforward complex divide. */ static int -expand_cmplxdiv_straight (rtx real0, rtx real1, rtx imag0, rtx imag1, - rtx realr, rtx imagr, enum machine_mode submode, - int unsignedp, enum optab_methods methods, - enum mode_class class, optab binoptab) +expand_cmplxdiv_straight (real0, real1, imag0, imag1, realr, imagr, submode, + unsignedp, methods, class, binoptab) + rtx real0, real1, imag0, imag1, realr, imagr; + enum machine_mode submode; + int unsignedp; + enum optab_methods methods; + enum mode_class class; + optab binoptab; { rtx divisor; rtx real_t, imag_t; @@ -475,10 +479,14 @@ expand_cmplxdiv_straight (rtx real0, rtx real1, rtx imag0, rtx imag1, /* Generate code to perform a wide-input-range-acceptable complex divide. */ static int -expand_cmplxdiv_wide (rtx real0, rtx real1, rtx imag0, rtx imag1, - rtx realr, rtx imagr, enum machine_mode submode, - int unsignedp, enum optab_methods methods, - enum mode_class class, optab binoptab) +expand_cmplxdiv_wide (real0, real1, imag0, imag1, realr, imagr, submode, + unsignedp, methods, class, binoptab) + rtx real0, real1, imag0, imag1, realr, imagr; + enum machine_mode submode; + int unsignedp; + enum optab_methods methods; + enum mode_class class; + optab binoptab; { rtx ratio, divisor; rtx real_t, imag_t; @@ -496,11 +504,17 @@ expand_cmplxdiv_wide (rtx real0, rtx real1, rtx imag0, rtx imag1, imag1 = force_reg (submode, imag1); - temp1 = expand_unop (submode, abs_optab, real1, NULL_RTX, - unsignedp); - - temp2 = expand_unop (submode, abs_optab, imag1, NULL_RTX, - unsignedp); + /* XXX What's an "unsigned" complex number? */ + if (unsignedp) + { + temp1 = real1; + temp2 = imag1; + } + else + { + temp1 = expand_abs (submode, real1, NULL_RTX, 1); + temp2 = expand_abs (submode, imag1, NULL_RTX, 1); + } if (temp1 == 0 || temp2 == 0) return 0; |