Message ID | 20120204054652.GC4832@bubble.grove.modra.org |
---|---|
State | New |
Headers | show |
On Sat, Feb 4, 2012 at 12:46 AM, Alan Modra <amodra@gmail.com> wrote: > http://gcc.gnu.org/ml/gcc-patches/2007-01/msg01835.html changed the > code I'm tweaking here to use DFmode subregs when loading a TFmode > constant into regs for e500. This just extends that change to all > rs6000 targets, the simplest fix I found for PR52107, a problem I > discovered when looking at powerpc64-linux libgcc. > It would also be possible to fix this in the rs6000.md movdi splitter > dealing with large constants, at least for this testcase when we know > we are dealing with a hard float reg. However, I think it's better > not to generate DImode fp values in the first place. Bootstrapped and > regression tested powerpc64-linux. OK to apply everywhere? > PR target/52107 > * config/rs6000/rs6000.c (rs6000_emit_move): Don't create DImode > subregs of TFmode. This fix is okay in trunk and 4.6. I am more reluctant to approve backporting it to GCC 4.5 at this late date. Thanks, David
Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 183781) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -7006,17 +7006,14 @@ rs6000_emit_move (rtx dest, rtx source, if (!TARGET_IEEEQUAD && TARGET_LONG_DOUBLE_128 && mode == TFmode && GET_CODE (operands[1]) == CONST_DOUBLE) { - /* DImode is used, not DFmode, because simplify_gen_subreg doesn't - know how to get a DFmode SUBREG of a TFmode. */ - enum machine_mode imode = (TARGET_E500_DOUBLE ? DFmode : DImode); - rs6000_emit_move (simplify_gen_subreg (imode, operands[0], mode, 0), - simplify_gen_subreg (imode, operands[1], mode, 0), - imode); - rs6000_emit_move (simplify_gen_subreg (imode, operands[0], mode, - GET_MODE_SIZE (imode)), - simplify_gen_subreg (imode, operands[1], mode, - GET_MODE_SIZE (imode)), - imode); + rs6000_emit_move (simplify_gen_subreg (DFmode, operands[0], mode, 0), + simplify_gen_subreg (DFmode, operands[1], mode, 0), + DFmode); + rs6000_emit_move (simplify_gen_subreg (DFmode, operands[0], mode, + GET_MODE_SIZE (DFmode)), + simplify_gen_subreg (DFmode, operands[1], mode, + GET_MODE_SIZE (DFmode)), + DFmode); return; }