From 6a4e49c11d37b842954ce3edd38fded25e2411b2 Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Tue, 12 Mar 2002 14:32:37 +0000 Subject: [PATCH] s390.md (reload_insi, [...]): Change mode of scratch register to DImode / TImode. * config/s390/s390.md (reload_insi, reload_indi): Change mode of scratch register to DImode / TImode. config/s390/s390.c (s390_expand_plus_operand): Make sure scratch register used does not overlap the target. From-SVN: r50652 --- gcc/ChangeLog | 9 +++++++-- gcc/config/s390/s390.c | 19 ++++++++++++++----- gcc/config/s390/s390.md | 6 +++--- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 583285c9382..6bbc35f9f51 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2002-03-12 Ulrich Weigand + + * config/s390/s390.md (reload_insi, reload_indi): Change mode of + scratch register to DImode / TImode. + config/s390/s390.c (s390_expand_plus_operand): Make sure scratch + register used does not overlap the target. + 2002-03-12 Kaveh R. Ghazi * Makefile.in (debug.o): Depend on debug.h. @@ -76,8 +83,6 @@ * alias.c (record_component_aliases): Record aliases for base classes too. -2002-03-11 Ulrich Weigand - * config/s390/s390.h (REG_ALLOC_ORDER): Add missing register. 2002-03-11 Douglas B Rupp diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index f4696e44f7f..2881aabc65b 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -1,5 +1,5 @@ /* Subroutines used for code generation on IBM S/390 and zSeries - Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Hartmut Penner (hpenner@de.ibm.com) and Ulrich Weigand (uweigand@de.ibm.com). @@ -1169,14 +1169,23 @@ s390_plus_operand (op, mode) SCRATCH may be used as scratch register. */ void -s390_expand_plus_operand (target, src, scratch) +s390_expand_plus_operand (target, src, scratch_in) register rtx target; register rtx src; - register rtx scratch; + register rtx scratch_in; { - /* src must be a PLUS; get its two operands. */ - rtx sum1, sum2; + rtx sum1, sum2, scratch; + + /* ??? reload apparently does not ensure that the scratch register + and the target do not overlap. We absolutely require this to be + the case, however. Therefore the reload_in[sd]i patterns ask for + a double-sized scratch register, and if one part happens to be + equal to the target, we use the other one. */ + scratch = gen_rtx_REG (Pmode, REGNO (scratch_in)); + if (rtx_equal_p (scratch, target)) + scratch = gen_rtx_REG (Pmode, REGNO (scratch_in) + 1); + /* src must be a PLUS; get its two operands. */ if (GET_CODE (src) != PLUS || GET_MODE (src) != Pmode) abort (); diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index 1ec96849b36..f4fbfc0a4f3 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -1,5 +1,5 @@ ;;- Machine description for GNU compiler -- S/390 / zSeries version. -;; Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. +;; Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. ;; Contributed by Hartmut Penner (hpenner@de.ibm.com) and ;; Ulrich Weigand (uweigand@de.ibm.com). ;; This file is part of GNU CC. @@ -3151,7 +3151,7 @@ (define_expand "reload_indi" [(parallel [(match_operand:DI 0 "register_operand" "=a") (match_operand:DI 1 "s390_plus_operand" "") - (match_operand:DI 2 "register_operand" "=&a")])] + (match_operand:TI 2 "register_operand" "=&a")])] "TARGET_64BIT" " { @@ -3238,7 +3238,7 @@ (define_expand "reload_insi" [(parallel [(match_operand:SI 0 "register_operand" "=a") (match_operand:SI 1 "s390_plus_operand" "") - (match_operand:SI 2 "register_operand" "=&a")])] + (match_operand:DI 2 "register_operand" "=&a")])] "!TARGET_64BIT" " { -- 2.30.2