From aa2b9a65fc42fa553908c5128e1ffadbd8c7ab74 Mon Sep 17 00:00:00 2001 From: thorpej Date: Mon, 4 Nov 2002 03:38:32 +0000 Subject: [PATCH] Add SGI-compatible ta0-ta3 register names. These allow one to write asm code which can be built easily in old-ABI and new-ABI environemnts. In old-ABI, they map to t4-t7, and in new-ABI, they map to a4-a7. This means that t0-t3,ta0-ta3,t8,t9 are available in both ABIs. Because ta0-ta3 overlap with arg regs (albeit arg slots which are usually unused), they should be used only if t0-t3,t8,t9 isn't enough. --- sys/arch/mips/include/regdef.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/sys/arch/mips/include/regdef.h b/sys/arch/mips/include/regdef.h index 3616e5e66716..49e947ac093b 100644 --- a/sys/arch/mips/include/regdef.h +++ b/sys/arch/mips/include/regdef.h @@ -1,4 +1,4 @@ -/* $NetBSD: regdef.h,v 1.9 2002/11/02 02:00:17 thorpej Exp $ */ +/* $NetBSD: regdef.h,v 1.10 2002/11/04 03:38:32 thorpej Exp $ */ /* * Copyright (c) 1992, 1993 @@ -88,4 +88,24 @@ #define s8 $30 /* one more callee saved */ #define ra $31 /* return address */ +/* + * These are temp registers whose names can be used in either the old + * or new ABI, although they map to different physical registers. In + * the old ABI, they map to t4-t7, and in the new ABI, they map to a4-a7. + * + * Because they overlap with the last 4 arg regs in the new ABI, ta0-ta3 + * should be used only when we need more than t0-t3. + */ +#if defined(__mips_n32) || defined(__mips_n64) +#define ta0 $8 +#define ta1 $9 +#define ta2 $10 +#define ta3 $11 +#else +#define ta0 $12 +#define ta1 $13 +#define ta2 $14 +#define ta3 $15 +#endif /* __mips_n32 || __mips_n64 */ + #endif /* _MIPS_REGDEF_H */