]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rs6000.h (FUNCTION_ARG_PADDING): Define.
authorDavid Edelsohn <edelsohn@mhpcc.edu>
Sat, 20 Dec 1997 15:11:26 +0000 (15:11 +0000)
committerJeff Law <law@gcc.gnu.org>
Sat, 20 Dec 1997 15:11:26 +0000 (08:11 -0700)
        * rs6000.h (FUNCTION_ARG_PADDING): Define.
        * rs6000.c (function_arg_padding): New function.

From-SVN: r17162

gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.h

index 06911c39a86860d953b914ca77c59735a8d5e655..7f55170485c0ce5e42e2ac4e84c0e087ceb3f105 100644 (file)
@@ -1,3 +1,8 @@
+Sat Dec 20 16:14:50 1997  David Edelsohn  <edelsohn@mhpcc.edu>
+
+       * rs6000.h (FUNCTION_ARG_PADDING): Define.
+       * rs6000.c (function_arg_padding): New function.
+
 Sat Dec 20 13:36:06 1997  Paul Eggert  <eggert@twinsun.com>
                           Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
                           H.J. Lu  (hjl@gnu.org)
index 6c50f6233c789475222c0326ebd540947f51937a..f5c47738c9064e2305f3688930a617dfb3100d4a 100644 (file)
@@ -1167,6 +1167,35 @@ init_cumulative_args (cum, fntype, libname, incoming)
     }
 }
 \f
+/* If defined, a C expression which determines whether, and in which
+   direction, to pad out an argument with extra space.  The value
+   should be of type `enum direction': either `upward' to pad above
+   the argument, `downward' to pad below, or `none' to inhibit
+   padding.
+
+   For the AIX ABI structs are always stored left shifted in their
+   argument slot.  */
+
+enum direction
+function_arg_padding (mode, type)
+     enum machine_mode mode;
+     tree type;
+{
+  if (type && TREE_CODE (type) == RECORD_TYPE)
+    {
+      return upward;
+    }
+
+  /* This is the default definition.  */
+  return (! BYTES_BIG_ENDIAN
+          ? upward
+          : ((mode == BLKmode
+              ? (type && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
+                 && int_size_in_bytes (type) < (PARM_BOUNDARY / BITS_PER_UNIT))
+              : GET_MODE_BITSIZE (mode) < PARM_BOUNDARY)
+             ? downward : upward));
+}
+
 /* If defined, a C expression that gives the alignment boundary, in bits,
    of an argument with the specified mode and type.  If it is not defined, 
    PARM_BOUNDARY is used for all arguments.
index 3e7b932ffb2f6a235303604ad83d21b3258d9bd0..b16a5300012f7025dfe4e03597cf8b7a7decf72f 100644 (file)
@@ -1461,6 +1461,15 @@ typedef struct rs6000_args
 #define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \
   function_arg_pass_by_reference(&CUM, MODE, TYPE, NAMED)
 
+/* If defined, a C expression which determines whether, and in which
+   direction, to pad out an argument with extra space.  The value
+   should be of type `enum direction': either `upward' to pad above
+   the argument, `downward' to pad below, or `none' to inhibit
+   padding.  */
+
+#define FUNCTION_ARG_PADDING(MODE, TYPE) \
+  function_arg_padding (MODE, TYPE)
+
 /* If defined, a C expression that gives the alignment boundary, in bits,
    of an argument with the specified mode and type.  If it is not defined,
    PARM_BOUNDARY is used for all arguments.  */