public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* RFA: regrename: Don't record high part copies
@ 2002-07-16 11:39 Joern Rennecke
  2002-07-16 13:11 ` Richard Henderson
  0 siblings, 1 reply; 2+ messages in thread
From: Joern Rennecke @ 2002-07-16 11:39 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 107 bytes --]


-- 
--------------------------
SuperH
2430 Aztec West / Almondsbury / BRISTOL / BS32 4AQ
T:+44 1454 462330

[-- Attachment #2: regrename-fix2 --]
[-- Type: text/plain, Size: 1777 bytes --]

Tue Jul 16 19:32:58 2002  J"orn Rennecke <joern.rennecke@superh.com>

	* regrename.c (copy_value): Don't record high part copies.

Index: regrename.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/regrename.c,v
retrieving revision 1.54
diff -p -r1.54 regrename.c
*** regrename.c	16 Jul 2002 10:59:15 -0000	1.54
--- regrename.c	16 Jul 2002 18:32:54 -0000
*************** copy_value (dest, src, vd)
*** 1268,1273 ****
--- 1268,1293 ----
    if (vd->e[sr].mode == VOIDmode)
      set_value_regno (sr, vd->e[dr].mode, vd);
  
+   /* If we are narrowing the the input to a smaller number of hard regs,
+      and it is in big endian, we are really extracting a high part.
+      Since we generally associate a low part of a value with the value itself,
+      we must not do the same for the high part.
+      Note we can still get low parts for the same mode combination through
+      a two-step copy involving differently sized hard regs.
+      Assume hard regs fr* are 32 bits bits each, while r* are 64 bits each:
+      (set (reg:DI r0) (reg:DI fr0))
+      (set (reg:SI fr2) (reg:SI r0))
+      loads the low part of (reg:DI fr0) - i.e. fr1 - into fr2, while:
+      (set (reg:SI fr2) (reg:SI fr0))
+      loads the high part of (reg:DI fr0) into fr2.
+ 
+      We can't properly represent the latter case in our tables, so don't
+      record anything then.  */
+   else if (sn < HARD_REGNO_NREGS (sr, vd->e[sr].mode)
+ 	   && (GET_MODE_SIZE (vd->e[sr].mode) > UNITS_PER_WORD
+ 	       ? WORDS_BIG_ENDIAN : BYTES_BIG_ENDIAN))
+     return;
+ 
    /* If SRC had been assigned a mode narrower than the copy, we can't
       link DEST into the chain, because not all of the pieces of the
       copy came from oldest_regno.  */

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: RFA: regrename: Don't record high part copies
  2002-07-16 11:39 RFA: regrename: Don't record high part copies Joern Rennecke
@ 2002-07-16 13:11 ` Richard Henderson
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2002-07-16 13:11 UTC (permalink / raw)
  To: Joern Rennecke; +Cc: gcc-patches

On Tue, Jul 16, 2002 at 07:38:25PM +0100, Joern Rennecke wrote:
> 	* regrename.c (copy_value): Don't record high part copies.

Ok, except,

> +   else if (sn < HARD_REGNO_NREGS (sr, vd->e[sr].mode)

The next if has "sn > (unsigned int) HARD_REGNO_NREGS";
I assume then that you've added a signed-unsigned comparison
warning for some target.  Please do the same in your hunk.


r~

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-07-16 20:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-16 11:39 RFA: regrename: Don't record high part copies Joern Rennecke
2002-07-16 13:11 ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).