public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* mips tls with -mlong64/-mgp32
@ 2007-05-10 20:46 DJ Delorie
  2007-05-10 21:24 ` Daniel Jacobowitz
  0 siblings, 1 reply; 38+ messages in thread
From: DJ Delorie @ 2007-05-10 20:46 UTC (permalink / raw)
  To: gcc-patches


If TLS pointers are 64 bits but GP registers are 32 bits, the TLS load
needs to be split.  This means we need to support offsetted GOT
addresses, at least for TLS (perhaps for more, but this is the only
one that causes a failure in the testsuite - gcc.dg/tls/nonpic.c)

This results in code like this, which the assembler seems to be ok
with:

        lw      $3,%tprel_lo(e1+4)($2)
        lw      $2,%tprel_lo(e1)($2)

This is similar to the change I made to s390 last October.  Only
lightly tested (else you'd have to wait a week or so for dg results).
Ok?  Should other symbols be similarly offsettable?

	* config/mips/mips.c (mips_symbolic_constant_p): Allow TPREL
	offset-by-4 so we can split DImode GOT loads.

Index: mips.c
===================================================================
--- mips.c	(revision 124522)
+++ mips.c	(working copy)
@@ -1413,20 +1413,23 @@ mips_symbolic_constant_p (rtx x, enum mi
 	 address, and we will apply a 16-bit offset after loading it.
 	 If the symbol is local, the linker should provide enough local
 	 GOT entries for a 16-bit offset, but larger offsets may lead
 	 to GOT overflow.  */
       return SMALL_INT (offset);
 
+    case SYMBOL_TPREL:
+      if (GET_CODE (offset) == CONST_INT
+	  && INTVAL (offset) == 4)
+	return true;
     case SYMBOL_GOT_DISP:
     case SYMBOL_GOTOFF_DISP:
     case SYMBOL_GOTOFF_CALL:
     case SYMBOL_GOTOFF_LOADGP:
     case SYMBOL_TLSGD:
     case SYMBOL_TLSLDM:
     case SYMBOL_DTPREL:
-    case SYMBOL_TPREL:
     case SYMBOL_GOTTPREL:
     case SYMBOL_TLS:
     case SYMBOL_HALF:
       return false;
     }
   gcc_unreachable ();

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

end of thread, other threads:[~2007-05-19 14:57 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-10 20:46 mips tls with -mlong64/-mgp32 DJ Delorie
2007-05-10 21:24 ` Daniel Jacobowitz
2007-05-10 21:27   ` DJ Delorie
2007-05-10 21:38     ` Daniel Jacobowitz
2007-05-11  1:07       ` DJ Delorie
2007-05-11  3:24         ` Daniel Jacobowitz
2007-05-11  7:22         ` Rask Ingemann Lambertsen
2007-05-11  7:31           ` Andrew Pinski
2007-05-11 11:47           ` Daniel Jacobowitz
2007-05-11 12:17             ` DJ Delorie
2007-05-11 12:16     ` Richard Sandiford
2007-05-11 12:24       ` DJ Delorie
2007-05-11 12:54         ` Richard Sandiford
2007-05-11 13:07           ` DJ Delorie
2007-05-11 13:16             ` Paolo Bonzini
2007-05-11 13:19             ` Richard Sandiford
2007-05-11 13:33               ` Daniel Jacobowitz
2007-05-11 13:43                 ` Richard Sandiford
2007-05-15 20:39                   ` DJ Delorie
2007-05-17 19:12                   ` DJ Delorie
2007-05-17 19:28                     ` Richard Sandiford
2007-05-17 19:50                       ` DJ Delorie
2007-05-17 20:02                         ` Richard Sandiford
2007-05-17 20:05                           ` Richard Sandiford
2007-05-17 20:07                             ` DJ Delorie
2007-05-17 20:10                           ` DJ Delorie
2007-05-17 20:12                             ` Richard Sandiford
2007-05-17 20:56                               ` DJ Delorie
2007-05-17 21:35                                 ` Richard Sandiford
2007-05-17 23:08                                   ` DJ Delorie
2007-05-18  7:02                                     ` Richard Sandiford
2007-05-18  9:58                                       ` Richard Sandiford
2007-05-18 21:23                                       ` DJ Delorie
2007-05-19  6:33                                         ` Richard Sandiford
2007-05-19 14:51                                           ` DJ Delorie
2007-05-19  7:33                                         ` Richard Sandiford
2007-05-19 14:57                                           ` DJ Delorie
2007-05-17 20:13                           ` DJ Delorie

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).