mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-25 10:20:40 +08:00
re PR middle-end/12705 (: complex powers)
PR middle-end/12705 * optabs.c (expand_binop): When expanding complex operations inline, always calculate result into a new temporary register. Minor code clean-ups. From-SVN: r72871
This commit is contained in:
parent
7989e4dc24
commit
c7d91a943b
@ -1,3 +1,10 @@
|
||||
2003-10-23 Roger Sayle <roger@eyesopen.com>
|
||||
|
||||
PR middle-end/12705
|
||||
* optabs.c (expand_binop): When expanding complex operations
|
||||
inline, always calculate result into a new temporary register.
|
||||
Minor code clean-ups.
|
||||
|
||||
2003-10-24 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
|
||||
|
||||
* objc/lang-specs.h: Handle -print-objc-runtime-info.
|
||||
|
29
gcc/optabs.c
29
gcc/optabs.c
@ -1521,24 +1521,17 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
|
||||
rtx real0 = 0, imag0 = 0;
|
||||
rtx real1 = 0, imag1 = 0;
|
||||
rtx realr, imagr, res;
|
||||
rtx seq;
|
||||
rtx equiv_value;
|
||||
rtx seq, result;
|
||||
int ok = 0;
|
||||
|
||||
/* Find the correct mode for the real and imaginary parts. */
|
||||
enum machine_mode submode = GET_MODE_INNER(mode);
|
||||
enum machine_mode submode = GET_MODE_INNER (mode);
|
||||
|
||||
if (submode == BLKmode)
|
||||
abort ();
|
||||
|
||||
if (! target)
|
||||
target = gen_reg_rtx (mode);
|
||||
|
||||
start_sequence ();
|
||||
|
||||
realr = gen_realpart (submode, target);
|
||||
imagr = gen_imagpart (submode, target);
|
||||
|
||||
if (GET_MODE (op0) == mode)
|
||||
{
|
||||
real0 = gen_realpart (submode, op0);
|
||||
@ -1558,6 +1551,10 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
|
||||
if (real0 == 0 || real1 == 0 || ! (imag0 != 0 || imag1 != 0))
|
||||
abort ();
|
||||
|
||||
result = gen_reg_rtx (mode);
|
||||
realr = gen_realpart (submode, result);
|
||||
imagr = gen_imagpart (submode, result);
|
||||
|
||||
switch (binoptab->code)
|
||||
{
|
||||
case PLUS:
|
||||
@ -1749,16 +1746,10 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
|
||||
|
||||
if (ok)
|
||||
{
|
||||
if (binoptab->code != UNKNOWN)
|
||||
equiv_value
|
||||
= gen_rtx_fmt_ee (binoptab->code, mode,
|
||||
copy_rtx (op0), copy_rtx (op1));
|
||||
else
|
||||
equiv_value = 0;
|
||||
|
||||
emit_no_conflict_block (seq, target, op0, op1, equiv_value);
|
||||
|
||||
return target;
|
||||
rtx equiv = gen_rtx_fmt_ee (binoptab->code, mode,
|
||||
copy_rtx (op0), copy_rtx (op1));
|
||||
emit_no_conflict_block (seq, result, op0, op1, equiv);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user