From 09522f2113addcce3dc2a59faf65be639dec6201 Mon Sep 17 00:00:00 2001 From: Franz Sirl Date: Wed, 7 Jul 1999 01:04:41 +0000 Subject: [PATCH] reload1.c (gen_reload): When synthesizing a 3 operand add sequence... MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit � * reload1.c (gen_reload): When synthesizing a 3 operand add sequence, improve test for when to reload OP1 into the reload register instead of OP0. From-SVN: r27987 --- gcc/ChangeLog | 6 ++++++ gcc/reload1.c | 18 ++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 23f4f431f36..7c17ec4fad8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +Wed Jul 7 02:00:04 1999 Franz Sirl + + * reload1.c (gen_reload): When synthesizing a 3 operand add + sequence, improve test for when to reload OP1 into the reload + register instead of OP0. + Wed Jul 7 01:38:03 1999 Jim Wilson * unroll.c (unroll_loop): Don't delete NOTE_INSN_DELETED_LABEL notes. diff --git a/gcc/reload1.c b/gcc/reload1.c index f16ed109875..123cbf5edd3 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -7811,17 +7811,27 @@ gen_reload (out, in, opnum, type) delete_insns_since (last); /* If that failed, we must use a conservative two-insn sequence. - use move to copy constant, MEM, or pseudo register to the reload - register since "move" will be able to handle an arbitrary operand, - unlike add which can't, in general. Then add the registers. + + Use a move to copy one operand into the reload register. Prefer + to reload a constant, MEM or pseudo since the move patterns can + handle an arbitrary operand. If OP1 is not a constant, MEM or + pseudo and OP1 is not a valid operand for an add instruction, then + reload OP1. + + After reloading one of the operands into the reload register, add + the reload register to the output register. If there is another way to do this for a specific machine, a DEFINE_PEEPHOLE should be specified that recognizes the sequence we emit below. */ + code = (int) add_optab->handlers[(int) GET_MODE (out)].insn_code; + if (CONSTANT_P (op1) || GET_CODE (op1) == MEM || GET_CODE (op1) == SUBREG || (GET_CODE (op1) == REG - && REGNO (op1) >= FIRST_PSEUDO_REGISTER)) + && REGNO (op1) >= FIRST_PSEUDO_REGISTER) + || (code != CODE_FOR_nothing + && ! (*insn_operand_predicate[code][2]) (op1, insn_operand_mode[code][2]))) tem = op0, op0 = op1, op1 = tem; gen_reload (out, op0, opnum, type); -- 2.30.2