diff options
author | Franz Sirl <Franz.Sirl-kernel@lauterbach.com> | 2003-06-18 06:19:01 +0000 |
---|---|---|
committer | Franz Sirl <sirl@gcc.gnu.org> | 2003-06-18 06:19:01 +0000 |
commit | b9599e46750a224af6a6ed88da8e2abb5acee9ee (patch) | |
tree | 18888b6b819a10ee8067654168736653e4f6127c | |
parent | 903caebf4947dd73a50f7e8405c4290f1c626081 (diff) | |
download | gcc-b9599e46750a224af6a6ed88da8e2abb5acee9ee.zip gcc-b9599e46750a224af6a6ed88da8e2abb5acee9ee.tar.gz gcc-b9599e46750a224af6a6ed88da8e2abb5acee9ee.tar.bz2 |
rs6000.c (init_cumulative_args): Add and handle LIBCALL argument.
2003-06-18 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
* config/rs6000/rs6000.c (init_cumulative_args): Add and handle LIBCALL
argument.
(function_arg): Handle CALL_LIBCALL flag.
* config/rs6000/rs6000-protos.h (init_cumulative_args): Update
prototype.
* config/rs6000/rs6000.h (CALL_LIBCALL): New macro.
(INIT_CUMULATIVE_LIBCALL_ARGS): New macro.
(INIT_CUMULATIVE_ARGS): Add LIBCALL argument.
(INIT_CUMULATIVE_INCOMING_ARGS): Likewise.
From-SVN: r68139
-rw-r--r-- | gcc/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000-protos.h | 2 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 10 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.h | 10 |
4 files changed, 27 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5c05442..aa29d39 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2003-06-18 Franz Sirl <Franz.Sirl-kernel@lauterbach.com> + + * config/rs6000/rs6000.c (init_cumulative_args): Add and handle LIBCALL + argument. + (function_arg): Handle CALL_LIBCALL flag. + * config/rs6000/rs6000-protos.h (init_cumulative_args): Update + prototype. + * config/rs6000/rs6000.h (CALL_LIBCALL): New macro. + (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. + (INIT_CUMULATIVE_ARGS): Add LIBCALL argument. + (INIT_CUMULATIVE_INCOMING_ARGS): Likewise. + 2003-06-18 Neil Booth <neil@daikokuya.co.uk> * Makefile.in: Update. diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h index 75f7d90..9c5df76 100644 --- a/gcc/config/rs6000/rs6000-protos.h +++ b/gcc/config/rs6000/rs6000-protos.h @@ -27,7 +27,7 @@ #ifdef RTX_CODE #ifdef TREE_CODE -extern void init_cumulative_args PARAMS ((CUMULATIVE_ARGS *, tree, rtx, int)); +extern void init_cumulative_args PARAMS ((CUMULATIVE_ARGS *, tree, rtx, int, int)); extern void rs6000_va_start PARAMS ((tree, rtx)); #endif /* TREE_CODE */ diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index c2133a8..bc8a5ca 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -3639,11 +3639,12 @@ rs6000_emit_move (dest, source, mode) so we never return a PARALLEL. */ void -init_cumulative_args (cum, fntype, libname, incoming) +init_cumulative_args (cum, fntype, libname, incoming, libcall) CUMULATIVE_ARGS *cum; tree fntype; rtx libname ATTRIBUTE_UNUSED; int incoming; + int libcall; { static CUMULATIVE_ARGS zero_cumulative; @@ -3652,7 +3653,7 @@ init_cumulative_args (cum, fntype, libname, incoming) cum->fregno = FP_ARG_MIN_REG; cum->vregno = ALTIVEC_ARG_MIN_REG; cum->prototype = (fntype && TYPE_ARG_TYPES (fntype)); - cum->call_cookie = CALL_NORMAL; + cum->call_cookie = libcall ? CALL_LIBCALL : CALL_NORMAL; cum->sysv_gregno = GP_ARG_MIN_REG; cum->stdarg = fntype && (TYPE_ARG_TYPES (fntype) != 0 @@ -3901,7 +3902,7 @@ rs6000_spe_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type If this is floating-point and no prototype is specified, we use both an FP and integer register (or possibly FP reg and stack). Library - functions (when TYPE is zero) always have the proper types for args, + functions (when CALL_LIBCALL is set) always have the proper types for args, so we can pass the FP value just in one register. emit_library_function doesn't support PARALLEL anyway. */ @@ -3922,7 +3923,8 @@ function_arg (cum, mode, type, named) { if (abi == ABI_V4 && cum->nargs_prototype < 0 - && type && (cum->prototype || TARGET_NO_PROTOTYPE)) + && (cum->call_cookie & CALL_LIBCALL) == 0 + && (cum->prototype || TARGET_NO_PROTOTYPE)) { /* For the SPE, we need to crxor CR6 always. */ if (TARGET_SPE_ABI) diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index f0c7ef9..8d63a4f 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -1665,6 +1665,7 @@ typedef struct rs6000_stack { #define CALL_V4_CLEAR_FP_ARGS 0x00000002 /* V.4, no FP args passed */ #define CALL_V4_SET_FP_ARGS 0x00000004 /* V.4, FP args were passed */ #define CALL_LONG 0x00000008 /* always call indirect */ +#define CALL_LIBCALL 0x00000010 /* libcall */ /* 1 if N is a possible register number for a function value as seen by the caller. @@ -1743,13 +1744,18 @@ typedef struct rs6000_args For a library call, FNTYPE is 0. */ #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) \ - init_cumulative_args (&CUM, FNTYPE, LIBNAME, FALSE) + init_cumulative_args (&CUM, FNTYPE, LIBNAME, FALSE, FALSE) /* Similar, but when scanning the definition of a procedure. We always set NARGS_PROTOTYPE large so we never return an EXPR_LIST. */ #define INIT_CUMULATIVE_INCOMING_ARGS(CUM,FNTYPE,LIBNAME) \ - init_cumulative_args (&CUM, FNTYPE, LIBNAME, TRUE) + init_cumulative_args (&CUM, FNTYPE, LIBNAME, TRUE, FALSE) + +/* Like INIT_CUMULATIVE_ARGS' but only used for outgoing libcalls. */ + +#define INIT_CUMULATIVE_LIBCALL_ARGS(CUM, MODE, LIBNAME) \ + init_cumulative_args (&CUM, NULL_TREE, LIBNAME, FALSE, TRUE) /* Update the data in CUM to advance over an argument of mode MODE and data type TYPE. |