This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

mips64 n32/n64 register naming conventions


Since n32 and n64 use registers $8-$11 as additional argument-passing
registers, instead of as temporaries, the naming conventions have
changed.  This patch adjusts the macros used to map the mnemonics to
the hardware register numbers, and makes up for (ab)uses of the old
names in a few assembly files.  Ok to install?

Index: ChangeLog
2003-03-14  Alexandre Oliva  <aoliva at redhat dot com>

	* sysdeps/mips/memcpy.S: Map t0-3 to a4-7 on new abis.
	* sysdeps/mips/memset.S: Likewise.
	* sysdeps/mips/sys/regdef.h: Alias a4-7 or t0-3 to $8-11
	depending on the ABI.

Index: sysdeps/mips/memcpy.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/mips/memcpy.S,v
retrieving revision 1.2
diff -u -p -r1.2 memcpy.S
--- sysdeps/mips/memcpy.S 14 Mar 2003 03:59:37 -0000 1.2
+++ sysdeps/mips/memcpy.S 14 Mar 2003 04:52:03 -0000
@@ -40,6 +40,19 @@
 #  define SWLO	swl		/* low part is left in little-endian	*/
 #endif
 
+#ifndef t0
+# define t0 a4
+#endif
+#ifndef t1
+# define t1 a5
+#endif
+#ifndef t2
+# define t2 a6
+#endif
+#ifndef t3
+# define t3 a7
+#endif
+
 ENTRY (memcpy)
 	.set	noreorder
 
Index: sysdeps/mips/memset.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/mips/memset.S,v
retrieving revision 1.2
diff -u -p -r1.2 memset.S
--- sysdeps/mips/memset.S 14 Mar 2003 03:59:37 -0000 1.2
+++ sysdeps/mips/memset.S 14 Mar 2003 04:52:03 -0000
@@ -34,6 +34,13 @@
 # define SWHI	swr		/* high part is right in little-endian	*/
 #endif
 
+#ifndef t0
+# define t0 a4
+#endif
+#ifndef t1
+# define t1 a5
+#endif
+
 ENTRY (memset)
 	.set	noreorder
 
Index: sysdeps/mips/sys/regdef.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/mips/sys/regdef.h,v
retrieving revision 1.2
diff -u -p -r1.2 regdef.h
--- sysdeps/mips/sys/regdef.h 6 Jul 2001 04:56:01 -0000 1.2
+++ sysdeps/mips/sys/regdef.h 14 Mar 2003 04:52:03 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ralf Baechle <ralf at gnu dot org>.
 
@@ -31,10 +31,17 @@
 #define a1      $5
 #define a2      $6
 #define a3      $7
+#if _MIPS_SIM != _MIPS_SIM_ABI32
+#define a4	$8
+#define a5	$9
+#define a6	$10
+#define a7	$11
+#else /* if _MIPS_SIM == _MIPS_SIM_ABI32 */
 #define t0      $8      /* caller saved */
 #define t1      $9
 #define t2      $10
 #define t3      $11
+#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
 #define t4      $12
 #define t5      $13
 #define t6      $14
-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva at {redhat dot com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva at {lsd dot ic dot unicamp dot br, gnu.org}
Free Software Evangelist                Professional serial bug killer

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]