From: drow Date: Tue, 19 Nov 2002 18:27:01 +0000 (+0000) Subject: * config/sh/sh.c (gen_shl_and): Revert previous patch. X-Git-Url: http://git.sourceforge.jp/view?a=commitdiff_plain;h=c721f167f1a9e058b46589de3514689551f05784;p=pf3gnuchains%2Fgcc-fork.git * config/sh/sh.c (gen_shl_and): Revert previous patch. * config/sh/sh.md (ashrdi3+1, ashrdi3+2): Predicate on reload_completed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59269 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a4f11ed0d80..31e3bbbd830 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2002-11-19 Daniel Jacobowitz + + * config/sh/sh.c (gen_shl_and): Revert previous patch. + * config/sh/sh.md (ashrdi3+1, ashrdi3+2): Predicate on + reload_completed. + 2002-11-19 Kazu Hirata * config/h8300/h8300.c (print_operand): Update the use of diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 7ea35dc5261..70cb0c1f167 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -1823,16 +1823,11 @@ gen_shl_and (dest, left_rtx, mask_rtx, source) if (first < 0) { - enum machine_mode mode - = ((mask << right) <= 0xff) ? QImode : HImode; - rtx lowpart = gen_lowpart (mode, source); - - if (no_new_pseudos && ! TARGET_SHMEDIA - && ! arith_reg_operand (lowpart, mode)) - return -1; emit_insn ((mask << right) <= 0xff - ? gen_zero_extendqisi2(dest, lowpart) - : gen_zero_extendhisi2(dest, lowpart)); + ? gen_zero_extendqisi2(dest, + gen_lowpart (QImode, source)) + : gen_zero_extendhisi2(dest, + gen_lowpart (HImode, source))); source = dest; } if (source != dest) @@ -1851,18 +1846,9 @@ gen_shl_and (dest, left_rtx, mask_rtx, source) mask <<= first; } if (first >= 0) - { - enum machine_mode mode = (mask <= 0xff) ? QImode : HImode; - rtx lowpart = gen_lowpart (mode, dest); - - if (no_new_pseudos && ! TARGET_SHMEDIA - && ! arith_reg_operand (lowpart, mode)) - return -1; - emit_insn (mask <= 0xff - ? gen_zero_extendqisi2(dest, lowpart) - : gen_zero_extendhisi2(dest, lowpart)); - } - + emit_insn (mask <= 0xff + ? gen_zero_extendqisi2(dest, gen_lowpart (QImode, dest)) + : gen_zero_extendhisi2(dest, gen_lowpart (HImode, dest))); if (total_shift > 0) { operands[2] = GEN_INT (total_shift); diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md index d57583bf6ac..ed14fbd4e33 100644 --- a/gcc/config/sh/sh.md +++ b/gcc/config/sh/sh.md @@ -2694,7 +2694,7 @@ (and:SI (ashift:SI (match_operand:SI 1 "register_operand" "") (match_operand:SI 2 "const_int_operand" "")) (match_operand:SI 3 "const_int_operand" "")))] - "TARGET_SH1 && (unsigned)INTVAL (operands[2]) < 32" + "TARGET_SH1 && reload_completed && (unsigned)INTVAL (operands[2]) < 32" [(use (reg:SI R0_REG))] "if (gen_shl_and (operands[0], operands[2], operands[3], operands[1])) FAIL; DONE;") @@ -2705,7 +2705,7 @@ (match_operand:SI 2 "const_int_operand" "")) (match_operand:SI 3 "const_int_operand" ""))) (clobber (reg:SI T_REG))] - "TARGET_SH1 && (unsigned)INTVAL (operands[2]) < 32" + "TARGET_SH1 && reload_completed && (unsigned)INTVAL (operands[2]) < 32" [(use (reg:SI R0_REG))] "if (gen_shl_and (operands[0], operands[2], operands[3], operands[1])) FAIL; DONE;")