From 3364872d40a49c4c42e29cf7874bd44c8d5583c6 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Fri, 26 Dec 2003 22:07:07 +0000 Subject: [PATCH] rs6000.c (legitimate_offset_address_p): Do not restrict DFmode and TFmode to word alignment. 2003-12-26 Fariborz Jahanian Geoffrey Keating David Edelsohn * config/rs6000/rs6000.c (legitimate_offset_address_p): Do not restrict DFmode and TFmode to word alignment. * config/rs6000/rs6000.md (movdf_hardfloat64): Use 'o' constraint for ld/std and order before mr. Co-Authored-By: David Edelsohn Co-Authored-By: Geoffrey Keating From-SVN: r75040 --- gcc/ChangeLog | 9 +++++++++ gcc/config/rs6000/rs6000.c | 4 ++-- gcc/config/rs6000/rs6000.md | 10 ++++++---- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5898c3cef28..ba7e756cfcc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2003-12-26 Fariborz Jahanian + Geoffrey Keating + David Edelsohn + + * config/rs6000/rs6000.c (legitimate_offset_address_p): Do not + restrict DFmode and TFmode to word alignment. + * config/rs6000/rs6000.md (movdf_hardfloat64): Use 'o' constraint + for ld/std and order before mr. + 2003-12-26 Andrew Pinski * config/darwin.h (LINK_COMMAND_SPEC): Arrange diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 5e3d49a1062..4dc83c103c2 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -2448,7 +2448,7 @@ legitimate_offset_address_p (enum machine_mode mode, rtx x, int strict) case DFmode: case DImode: - if (!TARGET_POWERPC64) + if (mode == DFmode || !TARGET_POWERPC64) extra = 4; else if (offset & 3) return false; @@ -2456,7 +2456,7 @@ legitimate_offset_address_p (enum machine_mode mode, rtx x, int strict) case TFmode: case TImode: - if (!TARGET_POWERPC64) + if (mode == TFmode || !TARGET_POWERPC64) extra = 12; else if (offset & 3) return false; diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 402c08cfac3..3ab0465a316 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -8159,16 +8159,18 @@ [(set_attr "type" "*,load,store,*,*,*") (set_attr "length" "8,8,8,8,12,16")]) +; ld/std require word-aligned displacements, so use offsettable constraint. +; List o->r and r->o before r->r for reload. (define_insn "*movdf_hardfloat64" - [(set (match_operand:DF 0 "nonimmediate_operand" "=!r,??r,m,f,f,m,!cl,!r,!r,!r,!r") - (match_operand:DF 1 "input_operand" "r,m,r,f,m,f,r,h,G,H,F"))] + [(set (match_operand:DF 0 "nonimmediate_operand" "=o,??r,!r,f,f,m,!cl,!r,!r,!r,!r") + (match_operand:DF 1 "input_operand" "r,o,r,f,m,f,r,h,G,H,F"))] "TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS && (gpc_reg_operand (operands[0], DFmode) || gpc_reg_operand (operands[1], DFmode))" "@ - mr %0,%1 - ld%U1%X1 %0,%1 std%U0%X0 %1,%0 + ld%U1%X1 %0,%1 + mr %0,%1 fmr %0,%1 lfd%U1%X1 %0,%1 stfd%U0%X0 %1,%0 -- 2.30.2