From: Richard Kenner Date: Fri, 12 Aug 1994 18:58:02 +0000 (-0400) Subject: (movsf): Don't truncate if not register; clean up. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f2974b07109105b6d817a847d81ef5547b262609;p=gcc.git (movsf): Don't truncate if not register; clean up. From-SVN: r7907 --- diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 9915670b1f1..856bf45c2a7 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -3794,18 +3794,18 @@ if (GET_CODE (operands[0]) == MEM) { - operands[1] = force_reg (SFmode, operands[1]); - if (! TARGET_POWERPC) - if (reload_in_progress || reload_completed) - emit_insn (gen_truncdfsf2 (operands[1], + /* If operands[1] is a register, it may have double-precision data + in it, so truncate it to single precision. We need not do + this for POWERPC. */ + if (! TARGET_POWERPC && GET_CODE (operands[1]) == REG) + { + rtx newreg = reload_in_progress ? operands[1] : gen_reg_rtx (SFmode); + emit_insn (gen_truncdfsf2 (newreg, gen_rtx (SUBREG, DFmode, operands[1], 0))); - else - { - rtx newreg = gen_reg_rtx (SFmode); - emit_insn (gen_truncdfsf2 (newreg, - gen_rtx (SUBREG, DFmode, operands[1], 0))); - operands[1] = newreg; - } + operands[1] = newreg; + } + + operands[1] = force_reg (SFmode, operands[1]); } if (GET_CODE (operands[0]) == REG && REGNO (operands[0]) < 32)