public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [patch] adjust libgloss addresses for 64-bit
@ 2005-04-14 22:08 Eric Christopher
  2005-04-14 22:38 ` Thiemo Seufer
  0 siblings, 1 reply; 21+ messages in thread
From: Eric Christopher @ 2005-04-14 22:08 UTC (permalink / raw)
  To: newlib, binutils; +Cc: cgd

Here's another shot at this. The problem that we encounter is that for
64-bit addresses "la" (or dla for that matter) does not sign extend the
constant passed in the case of:

la $2,0x80000000

leaving us with a zero-extended value in a register which is
unpredictable as far as the standard (and at least one chip out there)
is concerned. One option would be to modify the assembler to
automatically sign-extend when in the presence of constants that are
smaller than a single register.

Not a bad idea, but we should also just be precise in what we pass as
well. Since gas will accept sign extended constants from la when we're
using a 64-bit pointers we can probably get by with this patch as well.
The issue of whether or not to automagically sign extend when we load
addresses is a separate one I think really in this case.

Thoughts?

-eric

2005-04-12  Eric Christopher  <echristo@redhat.com>

        * mips/regs.S: For __mips64 sign-extend K0BASE. Clean
	up K1BASE_ADDR handling.

Index: mips/regs.S
===================================================================
RCS file: /cvs/src/src/libgloss/mips/regs.S,v
retrieving revision 1.3
diff -u -p -r1.3 regs.S
--- mips/regs.S 3 Apr 2004 01:02:51 -0000       1.3
+++ mips/regs.S 14 Apr 2005 22:04:32 -0000
@@ -53,15 +53,16 @@
 #define fp1    $f1

 /* Useful memory constants: */
-#define K0BASE         0x80000000
 #ifndef __mips64
+#define K0BASE          0x80000000
 #define K1BASE         0xA0000000
 #define K0BASE_ADDR    ((char *)K0BASE)
 #define K1BASE_ADDR    ((char *)K1BASE)
 #else
-#define K1BASE         0xFFFFFFFFA0000000LL
+#define K0BASE          0xFFFFFFFF80000000
+#define K1BASE         0xFFFFFFFFA0000000
 #define K0BASE_ADDR    ((char *)0xFFFFFFFF80000000LL)
-#define K1BASE_ADDR    ((char *)K1BASE)
+#define K1BASE_ADDR    ((char *)0xFFFFFFFFA0000000LL)
 #endif

 #define PHYS_TO_K1(a)   ((unsigned)(a) | K1BASE)


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

end of thread, other threads:[~2005-04-18 19:32 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-14 22:08 [patch] adjust libgloss addresses for 64-bit Eric Christopher
2005-04-14 22:38 ` Thiemo Seufer
2005-04-15 10:32   ` Maciej W. Rozycki
2005-04-15 11:28     ` Thiemo Seufer
2005-04-15 16:50       ` Eric Christopher
2005-04-15 19:37         ` Thiemo Seufer
2005-04-15 16:50     ` Eric Christopher
2005-04-15 17:03       ` Maciej W. Rozycki
2005-04-15 17:07         ` Eric Christopher
2005-04-18 12:46           ` Maciej W. Rozycki
2005-04-15 17:18         ` Thiemo Seufer
2005-04-15 17:35           ` Paul Koning
2005-04-15 18:56             ` Maciej W. Rozycki
2005-04-15 19:25               ` Paul Koning
2005-04-15 19:28               ` Paul Koning
2005-04-15 19:35                 ` Thiemo Seufer
2005-04-16 10:26                   ` Richard Sandiford
2005-04-15 20:57               ` cgd
2005-04-18 12:58                 ` Maciej W. Rozycki
2005-04-18 19:32                   ` Eric Christopher
2005-04-16 10:31               ` Richard Sandiford

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