• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GCC with patches for OS216


Commit MetaInfo

Revision495bf6087a2fe026ed0155b32a43407d7b3f7900 (tree)
Zeit1998-04-20 10:22:13
AutorRichard Henderson <rth@cygn...>
CommiterJeff Law

Log Message

reload1.c (eliminate_regs): Delete LOAD_EXTENDED_OP code that boiled down to && ! 0.

        • reload1.c (eliminate_regs): Delete LOAD_EXTENDED_OP code that
          boiled down to && ! 0.
        • reload.c (find_reloads): Always force (subreg (mem)) to be
          reloaded if WORD_REGISTER_OPERATIONS.
        • reload.c (find_reloads_toplev): Handle arbitrary non-paradoxical
          SUBREGs of CONST_INTs.
        • reload.c (push_reload): If WORD_REGISTER_OPERATIONS, reload the
          SUBREG_REG if the word count is unchanged, also in the input reload
        1. Disable non-applicable sanity checks.
        • reload.c (push_reload): In WORD_REGISTER_OPERATIONS code, add test
          to require the SUBREG mode to be smaller than the SUBREG_REG mode.
        • reload1.c (eliminate_regs): Likewise.
        • reload.c (push_reload): If WORD_REGISTER_OPERATIONS, reload the
          SUBREG_REG if the word count is unchanged.
        • reload1.c (eliminate_regs) [case SET]: If W_R_O, preserve
          subregs of identical word size for push_reload.

Various alpha fixes from the mainline sources.

Co-Authored-By: J"orn Rennecke <amylaar@cygnus.co.uk>
Co-Authored-By: Jim Wilson <wilson@cygnus.com>

From-SVN: r19336

Ändern Zusammenfassung

Diff

--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,29 @@
1+Mon Apr 20 02:17:37 1998 Richard Henderson <rth@cygnus.com>
2+ Jim Wilson <wilson@cygnus.com>
3+ J"orn Rennecke <amylaar@cygnus.co.uk>
4+
5+ * reload1.c (eliminate_regs): Delete LOAD_EXTENDED_OP code that
6+ boiled down to && ! 0.
7+
8+ * reload.c (find_reloads): Always force (subreg (mem)) to be
9+ reloaded if WORD_REGISTER_OPERATIONS.
10+
11+ * reload.c (find_reloads_toplev): Handle arbitrary non-paradoxical
12+ SUBREGs of CONST_INTs.
13+
14+ * reload.c (push_reload): If WORD_REGISTER_OPERATIONS, reload the
15+ SUBREG_REG if the word count is unchanged, also in the input reload
16+ case. Disable non-applicable sanity checks.
17+
18+ * reload.c (push_reload): In WORD_REGISTER_OPERATIONS code, add test
19+ to require the SUBREG mode to be smaller than the SUBREG_REG mode.
20+ * reload1.c (eliminate_regs): Likewise.
21+
22+ * reload.c (push_reload): If WORD_REGISTER_OPERATIONS, reload the
23+ SUBREG_REG if the word count is unchanged.
24+ * reload1.c (eliminate_regs) [case SET]: If W_R_O, preserve
25+ subregs of identical word size for push_reload.
26+
127 Mon Apr 20 00:58:48 1998 H.J. Lu (hjl@gnu.org)
228
329 * reg-stack.c (subst_asm_stack_regs): Change to return the last
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -890,6 +890,13 @@ push_reload (in, out, inloc, outloc, class,
890890 && INTEGRAL_MODE_P (GET_MODE (SUBREG_REG (in)))
891891 && LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (in))) != NIL)
892892 #endif
893+#ifdef WORD_REGISTER_OPERATIONS
894+ || ((GET_MODE_SIZE (inmode)
895+ < GET_MODE_SIZE (GET_MODE (SUBREG_REG (in))))
896+ && ((GET_MODE_SIZE (inmode) - 1) / UNITS_PER_WORD ==
897+ ((GET_MODE_SIZE (GET_MODE (SUBREG_REG (in))) - 1)
898+ / UNITS_PER_WORD)))
899+#endif
893900 ))
894901 || (GET_CODE (SUBREG_REG (in)) == REG
895902 && REGNO (SUBREG_REG (in)) < FIRST_PSEUDO_REGISTER
@@ -927,7 +934,7 @@ push_reload (in, out, inloc, outloc, class,
927934 in_subreg_loc = inloc;
928935 inloc = &SUBREG_REG (in);
929936 in = *inloc;
930-#ifndef LOAD_EXTEND_OP
937+#if ! defined (LOAD_EXTEND_OP) && ! defined (WORD_REGISTER_OPERATIONS)
931938 if (GET_CODE (in) == MEM)
932939 /* This is supposed to happen only for paradoxical subregs made by
933940 combine.c. (SUBREG (MEM)) isn't supposed to occur other ways. */
@@ -989,7 +996,15 @@ push_reload (in, out, inloc, outloc, class,
989996 && REGNO (SUBREG_REG (out)) >= FIRST_PSEUDO_REGISTER)
990997 || GET_CODE (SUBREG_REG (out)) == MEM)
991998 && ((GET_MODE_SIZE (outmode)
992- > GET_MODE_SIZE (GET_MODE (SUBREG_REG (out))))))
999+ > GET_MODE_SIZE (GET_MODE (SUBREG_REG (out))))
1000+#ifdef WORD_REGISTER_OPERATIONS
1001+ || ((GET_MODE_SIZE (outmode)
1002+ < GET_MODE_SIZE (GET_MODE (SUBREG_REG (out))))
1003+ && ((GET_MODE_SIZE (outmode) - 1) / UNITS_PER_WORD ==
1004+ ((GET_MODE_SIZE (GET_MODE (SUBREG_REG (out))) - 1)
1005+ / UNITS_PER_WORD)))
1006+#endif
1007+ ))
9931008 || (GET_CODE (SUBREG_REG (out)) == REG
9941009 && REGNO (SUBREG_REG (out)) < FIRST_PSEUDO_REGISTER
9951010 && ((GET_MODE_SIZE (outmode) <= UNITS_PER_WORD
@@ -1023,7 +1038,7 @@ push_reload (in, out, inloc, outloc, class,
10231038 out_subreg_loc = outloc;
10241039 outloc = &SUBREG_REG (out);
10251040 out = *outloc;
1026-#ifndef LOAD_EXTEND_OP
1041+#if ! defined (LOAD_EXTEND_OP) && ! defined (WORD_REGISTER_OPERATIONS)
10271042 if (GET_CODE (out) == MEM
10281043 && GET_MODE_SIZE (GET_MODE (out)) > GET_MODE_SIZE (outmode))
10291044 abort ();
@@ -2757,10 +2772,20 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
27572772 register access. If the data is, in fact, in memory we
27582773 must always load using the size assumed to be in the
27592774 register and let the insn do the different-sized
2760- accesses. */
2775+ accesses.
2776+
2777+ This is doubly true if WORD_REGISTER_OPERATIONS. In
2778+ this case eliminate_regs has left non-paradoxical
2779+ subregs for push_reloads to see. Make sure it does
2780+ by forcing the reload.
2781+
2782+ ??? When is it right at this stage to have a subreg
2783+ of a mem that is _not_ to be handled specialy? IMO
2784+ those should have been reduced to just a mem. */
27612785 || ((GET_CODE (operand) == MEM
27622786 || (GET_CODE (operand)== REG
27632787 && REGNO (operand) >= FIRST_PSEUDO_REGISTER))
2788+#ifndef WORD_REGISTER_OPERATIONS
27642789 && (((GET_MODE_BITSIZE (GET_MODE (operand))
27652790 < BIGGEST_ALIGNMENT)
27662791 && (GET_MODE_SIZE (operand_mode[i])
@@ -2775,7 +2800,9 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
27752800 && INTEGRAL_MODE_P (GET_MODE (operand))
27762801 && LOAD_EXTEND_OP (GET_MODE (operand)) != NIL)
27772802 #endif
2778- ))
2803+ )
2804+#endif
2805+ )
27792806 /* Subreg of a hard reg which can't handle the subreg's mode
27802807 or which would handle that mode in the wrong number of
27812808 registers for subregging to work. */
@@ -4162,6 +4189,29 @@ find_reloads_toplev (x, opnum, type, ind_levels, is_set_dest)
41624189 GET_MODE (SUBREG_REG (x)))) != 0)
41634190 return tem;
41644191
4192+ /* If the SUBREG is wider than a word, the above test will fail.
4193+ For example, we might have a SImode SUBREG of a DImode SUBREG_REG
4194+ for a 16 bit target, or a DImode SUBREG of a TImode SUBREG_REG for
4195+ a 32 bit target. We still can - and have to - handle this
4196+ for non-paradoxical subregs of CONST_INTs. */
4197+ if (regno >= FIRST_PSEUDO_REGISTER && reg_renumber[regno] < 0
4198+ && reg_equiv_constant[regno] != 0
4199+ && GET_CODE (reg_equiv_constant[regno]) == CONST_INT
4200+ && (GET_MODE_SIZE (GET_MODE (x))
4201+ < GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))))
4202+ {
4203+ int shift = SUBREG_WORD (x) * BITS_PER_WORD;
4204+ if (WORDS_BIG_ENDIAN)
4205+ shift = (GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (x)))
4206+ - GET_MODE_BITSIZE (GET_MODE (x))
4207+ - shift);
4208+ /* Here we use the knowledge that CONST_INTs have a
4209+ HOST_WIDE_INT field. */
4210+ if (shift >= HOST_BITS_PER_WIDE_INT)
4211+ shift = HOST_BITS_PER_WIDE_INT - 1;
4212+ return GEN_INT (INTVAL (reg_equiv_constant[regno]) >> shift);
4213+ }
4214+
41654215 if (regno >= FIRST_PSEUDO_REGISTER && reg_renumber[regno] < 0
41664216 && reg_equiv_constant[regno] != 0
41674217 && GET_MODE (reg_equiv_constant[regno]) == VOIDmode)
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -3108,30 +3108,21 @@ eliminate_regs (x, mem_mode, insn, storing)
31083108 int x_size = GET_MODE_SIZE (GET_MODE (x));
31093109 int new_size = GET_MODE_SIZE (GET_MODE (new));
31103110
3111- /* When asked to spill a partial word subreg, we need to go
3112- ahead and spill the whole thing against the possibility
3113- that we reload the whole reg and find garbage at the top. */
3114- if (storing
3115- && GET_CODE (new) == MEM
3116- && x_size < new_size
3117- && ((x_size + UNITS_PER_WORD-1) / UNITS_PER_WORD
3118- == (new_size + UNITS_PER_WORD-1) / UNITS_PER_WORD))
3119- return new;
3120- else if (GET_CODE (new) == MEM
3121- && x_size <= new_size
3122-#ifdef LOAD_EXTEND_OP
3123- /* On these machines we will be reloading what is
3124- inside the SUBREG if it originally was a pseudo and
3125- the inner and outer modes are both a word or
3126- smaller. So leave the SUBREG then. */
3127- && ! (GET_CODE (SUBREG_REG (x)) == REG
3128- && x_size <= UNITS_PER_WORD
3129- && new_size <= UNITS_PER_WORD
3130- && x_size > new_size
3131- && INTEGRAL_MODE_P (GET_MODE (new))
3132- && LOAD_EXTEND_OP (GET_MODE (new)) != NIL)
3111+ if (GET_CODE (new) == MEM
3112+ && ((x_size < new_size
3113+#ifdef WORD_REGISTER_OPERATIONS
3114+ /* On these machines, combine can create rtl of the form
3115+ (set (subreg:m1 (reg:m2 R) 0) ...)
3116+ where m1 < m2, and expects something interesting to
3117+ happen to the entire word. Moreover, it will use the
3118+ (reg:m2 R) later, expecting all bits to be preserved.
3119+ So if the number of words is the same, preserve the
3120+ subreg so that push_reloads can see it. */
3121+ && ! ((x_size-1)/UNITS_PER_WORD == (new_size-1)/UNITS_PER_WORD)
31333122 #endif
3134- )
3123+ )
3124+ || (x_size == new_size))
3125+ )
31353126 {
31363127 int offset = SUBREG_WORD (x) * UNITS_PER_WORD;
31373128 enum machine_mode mode = GET_MODE (x);
@@ -3271,12 +3262,6 @@ eliminate_regs (x, mem_mode, insn, storing)
32713262 && GET_CODE (insn) != INSN_LIST)
32723263 emit_insn_after (gen_rtx (CLOBBER, VOIDmode, SET_DEST (x)), insn);
32733264
3274- /* If SET_DEST was a partial-word subreg, NEW0 may have been widened
3275- to spill the entire register (see SUBREG case above). If the
3276- widths of SET_DEST and NEW0 no longer match, adjust NEW1. */
3277- if (GET_MODE (SET_DEST (x)) != GET_MODE (new0))
3278- new1 = gen_rtx (SUBREG, GET_MODE (new0), new1, 0);
3279-
32803265 if (new0 != SET_DEST (x) || new1 != SET_SRC (x))
32813266 return gen_rtx (SET, VOIDmode, new0, new1);
32823267 }