1991-12-15 14:56:55 -05:00
/* stdarg.h for GNU.
Note that the type used in va_arg is supposed to match the
actual type * * after default promotions * * .
Thus , va_arg ( . . . , short ) is not valid . */
# ifndef _STDARG_H
1992-10-30 04:38:54 -05:00
# ifndef _ANSI_STDARG_H_
1992-06-26 04:44:34 -04:00
# ifndef __need___va_list
1991-12-15 14:56:55 -05:00
# define _STDARG_H
1992-10-30 04:38:54 -05:00
# define _ANSI_STDARG_H_
1992-10-21 18:56:02 -04:00
# endif /* not __need___va_list */
1992-06-26 04:44:34 -04:00
# undef __need___va_list
1991-12-15 14:56:55 -05:00
1993-03-24 17:41:53 -05:00
# ifdef __clipper__
1996-10-03 18:31:13 -04:00
# include "va-clipper.h"
1993-03-24 17:41:53 -05:00
# else
1991-12-15 14:56:55 -05:00
# ifdef __m88k__
1996-10-03 18:31:13 -04:00
# include "va-m88k.h"
1991-12-15 14:56:55 -05:00
# else
# ifdef __i860__
1996-10-03 18:31:13 -04:00
# include "va-i860.h"
1991-12-15 14:56:55 -05:00
# else
1992-07-08 10:36:26 -04:00
# ifdef __hppa__
1996-10-03 18:31:13 -04:00
# include "va-pa.h"
1992-01-30 15:37:09 -05:00
# else
# ifdef __mips__
1996-10-03 18:31:13 -04:00
# include "va-mips.h"
1992-01-30 15:37:09 -05:00
# else
1992-03-04 16:58:05 -05:00
# ifdef __sparc__
1996-10-03 18:31:13 -04:00
# include "va-sparc.h"
1992-03-04 16:58:05 -05:00
# else
1992-05-05 13:27:49 -04:00
# ifdef __i960__
1996-10-03 18:31:13 -04:00
# include "va-i960.h"
1992-05-05 13:27:49 -04:00
# else
1992-08-14 15:35:36 -04:00
# ifdef __alpha__
1996-10-03 18:31:13 -04:00
# include "va-alpha.h"
1992-08-14 15:35:36 -04:00
# else
1996-07-08 16:29:33 -04:00
# if defined (__H8300__) || defined (__H8300H__) || defined (__H8300S__)
1996-10-03 18:31:13 -04:00
# include "va-h8300.h"
1993-08-26 17:57:10 -04:00
# else
1996-08-17 21:31:48 -04:00
# if defined (__PPC__) && (defined (_CALL_SYSV) || defined (_WIN32))
1996-10-03 18:31:13 -04:00
# include "va-ppc.h"
1995-08-13 18:19:33 -04:00
# else
1997-09-09 18:21:04 -04:00
# ifdef __arc__
# include "va-arc.h"
# else
1997-04-07 18:31:52 -04:00
# ifdef __M32R__
# include "va-m32r.h"
# else
1996-03-06 19:59:13 -05:00
# ifdef __sh__
1996-10-03 18:31:13 -04:00
# include "va-sh.h"
1996-03-06 19:59:13 -05:00
# else
stdarg.h: Include va-mn10300.h.
* ginclude/stdarg.h: Include va-mn10300.h.
* ginclude/varargs.h: Likewise.
* ginclude/va-mn10300.h: New file.
* mn10300/mn10300.c (expand_prologue): If current_function_varargs is
nonzero, then flush d0/d1 back into the stack.
(mn10300_builtin_saveregs): New function.
(function_arg, function_arg_partial_nregs): New functions.
(initial_offset): Tweak now that the RP save area is allocated
and deallocated around each call again.
* mn10300/mn10300.h (FIRST_PARM_OFFSET): Now 4.
(FRAME_POINTER_REQUIRED): Require a frame pointer for all non-leaf
functions.
(REG_PARM_STACK_SPACE): Now 8 bytes.
(FUNCTION_ARG_REGNO_P): Update for new parameter passing conventions.
(CUMULATIVE_ARGS, INIT_CUMULATIVE_ARGS): Likewise.
(FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Likewise.
(FUNCTION_ARG_PARTIAL_NREGS): Likewise.
(TRAMPOLINE_TEMPLATE): Don't clobber d0 anymore.
(TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE): Corresponding changes.
(EXPAND_BUILTIN_SAVEREGS): Define.
* mn10300/mn10300.md (call, call_value patterns): Allocate and
deallocate a stack slot for the return pointer around each call.
* mn10300/mn10300.h (RTX_COSTS): Refine.
(CASE_VALUES_THRESHHOLD, NO_FUNCTION_CSE): Likewise.
* mn10300/mn10300.c (output_tst): New function.
* mn10300/mn10300.md (movdi, movdf): Improve code to load constants
into registers.
(tst insns): Use output_tst to optimize some cases. Add versions to
encourage more zero extensions instead of sign extensions of HImode
and QImode values.
(divsi3, udivsi3): Remove patterns. Replaced by...
(divmodsi4, udivmodsi4): New expanders/patterns.
(andsi3): Optimize "and" operations with certain constants.
From-SVN: r13827
1997-04-01 20:33:45 -05:00
# ifdef __mn10300__
# include "va-mn10300.h"
# else
1997-06-23 13:30:34 -04:00
# ifdef __mn10200__
# include "va-mn10200.h"
# else
1997-09-05 13:43:51 -04:00
# ifdef __v850__
# include "va-v850.h"
# else
1998-09-19 17:27:09 -04:00
# if defined (_TMS320C4x) || defined (_TMS320C3x)
# include <va-c4x.h>
# else
1991-12-15 14:56:55 -05:00
1992-06-26 04:44:34 -04:00
/* Define __gnuc_va_list. */
1992-02-21 02:00:55 -05:00
1992-06-26 04:44:34 -04:00
# ifndef __GNUC_VA_LIST
# define __GNUC_VA_LIST
1997-12-16 15:00:15 -05:00
# if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX) || defined(__NetBSD__)
1992-06-26 04:44:34 -04:00
typedef char * __gnuc_va_list ;
1992-06-01 15:08:29 -04:00
# else
1992-06-26 04:44:34 -04:00
typedef void * __gnuc_va_list ;
1992-06-01 15:08:29 -04:00
# endif
1992-06-26 04:44:34 -04:00
# endif
/* Define the standard macros for the user,
if this invocation was from the user program . */
1992-07-02 20:30:05 -04:00
# ifdef _STDARG_H
1991-12-15 14:56:55 -05:00
/* Amount of space required in an argument list for an arg of type TYPE.
TYPE may alternatively be an expression whose type is used . */
1994-04-06 06:51:28 -04:00
# if defined(sysV68)
# define __va_rounded_size(TYPE) \
( ( ( sizeof ( TYPE ) + sizeof ( short ) - 1 ) / sizeof ( short ) ) * sizeof ( short ) )
# else
1991-12-15 14:56:55 -05:00
# define __va_rounded_size(TYPE) \
( ( ( sizeof ( TYPE ) + sizeof ( int ) - 1 ) / sizeof ( int ) ) * sizeof ( int ) )
1994-04-06 06:51:28 -04:00
# endif
1991-12-15 14:56:55 -05:00
# define va_start(AP, LASTARG) \
1994-03-23 17:19:23 -05:00
( AP = ( ( __gnuc_va_list ) __builtin_next_arg ( LASTARG ) ) )
1991-12-15 14:56:55 -05:00
1992-11-30 18:06:23 -05:00
# undef va_end
1992-06-26 04:44:34 -04:00
void va_end ( __gnuc_va_list ) ; /* Defined in libgcc.a */
1995-02-24 21:35:35 -05:00
# define va_end(AP) ((void)0)
1991-12-15 14:56:55 -05:00
1992-09-15 01:08:02 -04:00
/* We cast to void * and then to TYPE * because this avoids
a warning about increasing the alignment requirement . */
1992-11-30 18:06:23 -05:00
1997-11-02 16:19:36 -05:00
# if (defined (__arm__) && ! defined (__ARMEB__)) || defined (__i386__) || defined (__i860__) || defined (__ns32000__) || defined (__vax__)
1992-11-30 18:06:23 -05:00
/* This is for little-endian machines; small args are padded upward. */
1991-12-15 14:56:55 -05:00
# define va_arg(AP, TYPE) \
1992-09-28 17:16:00 -04:00
( AP = ( __gnuc_va_list ) ( ( char * ) ( AP ) + __va_rounded_size ( TYPE ) ) , \
1992-09-15 01:08:02 -04:00
* ( ( TYPE * ) ( void * ) ( ( char * ) ( AP ) - __va_rounded_size ( TYPE ) ) ) )
1992-11-30 18:06:23 -05:00
# else /* big-endian */
/* This is for big-endian machines; small args are padded downward. */
# define va_arg(AP, TYPE) \
( AP = ( __gnuc_va_list ) ( ( char * ) ( AP ) + __va_rounded_size ( TYPE ) ) , \
1995-04-30 08:11:09 -04:00
* ( ( TYPE * ) ( void * ) ( ( char * ) ( AP ) \
- ( ( sizeof ( TYPE ) < __va_rounded_size ( char ) \
? sizeof ( TYPE ) : __va_rounded_size ( TYPE ) ) ) ) ) )
1992-11-30 18:06:23 -05:00
# endif /* big-endian */
1997-03-26 07:34:03 -05:00
/* Copy __gnuc_va_list into another variable of this type. */
# define __va_copy(dest, src) (dest) = (src)
1992-06-26 04:44:34 -04:00
# endif /* _STDARG_H */
1991-12-15 14:56:55 -05:00
1998-09-19 17:27:09 -04:00
# endif /* not TMS320C3x or TMS320C4x */
1997-09-05 13:43:51 -04:00
# endif /* not v850 */
1997-06-23 13:30:34 -04:00
# endif /* not mn10200 */
stdarg.h: Include va-mn10300.h.
* ginclude/stdarg.h: Include va-mn10300.h.
* ginclude/varargs.h: Likewise.
* ginclude/va-mn10300.h: New file.
* mn10300/mn10300.c (expand_prologue): If current_function_varargs is
nonzero, then flush d0/d1 back into the stack.
(mn10300_builtin_saveregs): New function.
(function_arg, function_arg_partial_nregs): New functions.
(initial_offset): Tweak now that the RP save area is allocated
and deallocated around each call again.
* mn10300/mn10300.h (FIRST_PARM_OFFSET): Now 4.
(FRAME_POINTER_REQUIRED): Require a frame pointer for all non-leaf
functions.
(REG_PARM_STACK_SPACE): Now 8 bytes.
(FUNCTION_ARG_REGNO_P): Update for new parameter passing conventions.
(CUMULATIVE_ARGS, INIT_CUMULATIVE_ARGS): Likewise.
(FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Likewise.
(FUNCTION_ARG_PARTIAL_NREGS): Likewise.
(TRAMPOLINE_TEMPLATE): Don't clobber d0 anymore.
(TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE): Corresponding changes.
(EXPAND_BUILTIN_SAVEREGS): Define.
* mn10300/mn10300.md (call, call_value patterns): Allocate and
deallocate a stack slot for the return pointer around each call.
* mn10300/mn10300.h (RTX_COSTS): Refine.
(CASE_VALUES_THRESHHOLD, NO_FUNCTION_CSE): Likewise.
* mn10300/mn10300.c (output_tst): New function.
* mn10300/mn10300.md (movdi, movdf): Improve code to load constants
into registers.
(tst insns): Use output_tst to optimize some cases. Add versions to
encourage more zero extensions instead of sign extensions of HImode
and QImode values.
(divsi3, udivsi3): Remove patterns. Replaced by...
(divmodsi4, udivmodsi4): New expanders/patterns.
(andsi3): Optimize "and" operations with certain constants.
From-SVN: r13827
1997-04-01 20:33:45 -05:00
# endif /* not mn10300 */
1996-03-06 19:59:13 -05:00
# endif /* not sh */
1997-04-07 18:31:52 -04:00
# endif /* not m32r */
1997-09-09 18:21:04 -04:00
# endif /* not arc */
1995-08-13 18:19:33 -04:00
# endif /* not powerpc with V.4 calling sequence */
1993-08-26 17:57:10 -04:00
# endif /* not h8300 */
1992-08-14 15:35:36 -04:00
# endif /* not alpha */
1992-05-05 13:27:49 -04:00
# endif /* not i960 */
1992-03-04 16:58:05 -05:00
# endif /* not sparc */
1992-01-30 15:37:09 -05:00
# endif /* not mips */
1992-07-08 10:36:26 -04:00
# endif /* not hppa */
1991-12-15 14:56:55 -05:00
# endif /* not i860 */
# endif /* not m88k */
1993-03-24 17:41:53 -05:00
# endif /* not clipper */
1992-06-26 04:44:34 -04:00
# ifdef _STDARG_H
/* Define va_list, if desired, from __gnuc_va_list. */
1992-07-28 16:47:17 -04:00
/* We deliberately do not define va_list when called from
stdio . h , because ANSI C says that stdio . h is not supposed to define
va_list . stdio . h needs to have access to that data type ,
but must not use that name . It should use the name __gnuc_va_list ,
which is safe because it is reserved for the implementation . */
1992-06-26 04:44:34 -04:00
# ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */
# undef _VA_LIST
# endif
1992-07-07 23:06:31 -04:00
# ifdef _BSD_VA_LIST
# undef _BSD_VA_LIST
# endif
1997-06-22 06:29:26 -04:00
# if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST))
1992-10-17 03:39:31 -04:00
/* SVR4.2 uses _VA_LIST for an internal alias for va_list,
1993-04-04 03:17:15 -04:00
so we must avoid testing it and setting it here .
SVR4 uses _VA_LIST as a flag in stdarg . h , but we should
have no conflict with that . */
1992-10-17 03:39:31 -04:00
# ifndef _VA_LIST_
# define _VA_LIST_
1993-05-16 00:30:47 -04:00
# ifdef __i860__
1993-05-17 13:56:32 -04:00
# ifndef _VA_LIST
1993-05-16 00:30:47 -04:00
# define _VA_LIST va_list
# endif
1993-05-17 13:56:32 -04:00
# endif /* __i860__ */
1992-10-17 03:39:31 -04:00
typedef __gnuc_va_list va_list ;
1997-06-22 06:29:26 -04:00
# ifdef _SCO_DS
# define __VA_LIST
# endif
1992-10-17 03:39:31 -04:00
# endif /* _VA_LIST_ */
1996-01-15 20:59:42 -05:00
# else /* not __svr4__ || _SCO_DS */
1992-10-17 03:39:31 -04:00
1992-11-10 10:27:21 -05:00
/* The macro _VA_LIST_ is the same thing used by this file in Ultrix.
But on BSD NET2 we must not test or define or undef it .
( Note that the comments in NET 2 ' s ansi . h
are incorrect for _VA_LIST_ - - see stdio . h ! ) */
1995-04-13 08:50:20 -04:00
# if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT)
/* The macro _VA_LIST_DEFINED is used in Windows NT 3.5 */
1995-02-21 18:53:15 -05:00
# ifndef _VA_LIST_DEFINED
1992-06-26 04:44:34 -04:00
/* The macro _VA_LIST is used in SCO Unix 3.2. */
# ifndef _VA_LIST
1993-02-26 19:47:05 -05:00
/* The macro _VA_LIST_T_H is used in the Bull dpx2 */
# ifndef _VA_LIST_T_H
1992-06-26 04:44:34 -04:00
typedef __gnuc_va_list va_list ;
1993-02-26 19:47:05 -05:00
# endif /* not _VA_LIST_T_H */
1992-10-30 04:38:54 -05:00
# endif /* not _VA_LIST */
1995-02-21 18:53:15 -05:00
# endif /* not _VA_LIST_DEFINED */
1995-04-13 08:50:20 -04:00
# if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__))
# define _VA_LIST_
# endif
# ifndef _VA_LIST
# define _VA_LIST
# endif
# ifndef _VA_LIST_DEFINED
# define _VA_LIST_DEFINED
# endif
# ifndef _VA_LIST_T_H
# define _VA_LIST_T_H
# endif
# endif /* not _VA_LIST_, except on certain systems */
1992-10-31 16:40:51 -05:00
1993-04-04 03:17:15 -04:00
# endif /* not __svr4__ */
1992-10-17 03:39:31 -04:00
1991-12-15 14:56:55 -05:00
# endif /* _STDARG_H */
1992-06-26 04:44:34 -04:00
1992-10-30 04:38:54 -05:00
# endif /* not _ANSI_STDARG_H_ */
1992-06-26 04:44:34 -04:00
# endif /* not _STDARG_H */