aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1994-10-17 16:29:38 -0700
committerJim Wilson <wilson@gcc.gnu.org>1994-10-17 16:29:38 -0700
commitce883c1f8461b2f9ecf3004ebd626b0cd5c93e35 (patch)
tree5c697eac470b10da90d1434577b1f11bc173d74f
parent686667bf14b391ecac8082cd4fd91b418c236546 (diff)
downloadgcc-ce883c1f8461b2f9ecf3004ebd626b0cd5c93e35.zip
gcc-ce883c1f8461b2f9ecf3004ebd626b0cd5c93e35.tar.gz
gcc-ce883c1f8461b2f9ecf3004ebd626b0cd5c93e35.tar.bz2
(va_arg): Add little endian mips3 support.
From-SVN: r8296
-rw-r--r--gcc/ginclude/va-mips.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/gcc/ginclude/va-mips.h b/gcc/ginclude/va-mips.h
index 8eeb3ea..33774dc 100644
--- a/gcc/ginclude/va-mips.h
+++ b/gcc/ginclude/va-mips.h
@@ -59,11 +59,24 @@ void va_end (__gnuc_va_list); /* Defined in libgcc.a */
/* We cast to void * and then to TYPE * because this avoids
a warning about increasing the alignment requirement. */
+/* The __mips==3 cases are reversed from the 32 bit cases, because the standard
+ 32 bit calling convention left-aligns all parameters smaller than a word,
+ whereas the __mips==3 calling convention does not (and hence they are
+ right aligned). */
#if __mips==3
+#ifdef __MIPSEB__
#define va_arg(__AP, __type) \
- ((__type *) (void *) (__AP = (char *) ((((int)__AP + 8 - 1) & -8) \
- + __va_rounded_size (__type))))[-1]
+ ((__type *) (void *) (__AP = (char *) ((((int)__AP + 8 - 1) & -8) \
+ + __va_rounded_size (__type))))[-1]
#else
+#define va_arg(__AP, __type) \
+ ((__AP = (char *) ((((int)__AP + 8 - 1) & -8) \
+ + __va_rounded_size (__type))), \
+ *(__type *) (void *) (__AP - __va_rounded_size (__type)))
+#endif
+
+#else /* not __mips==3 */
+
#ifdef __MIPSEB__
/* For big-endian machines. */
#define va_arg(__AP, __type) \