aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Ellcey <sje@cup.hp.com>2004-10-06 16:07:03 +0000
committerSteve Ellcey <sje@gcc.gnu.org>2004-10-06 16:07:03 +0000
commitd13256a357157ac785b5b3b17e742ca5b1a62fb3 (patch)
tree8c42196e78b6f1f024ae1d75e8392b43aa7ac016
parentfbdad37d8558c4167831992c25481528d3142a64 (diff)
downloadgcc-d13256a357157ac785b5b3b17e742ca5b1a62fb3.zip
gcc-d13256a357157ac785b5b3b17e742ca5b1a62fb3.tar.gz
gcc-d13256a357157ac785b5b3b17e742ca5b1a62fb3.tar.bz2
ia64.h (FUNCTION_ARG_BOUNDARY): Change macro to call ia64_function_arg_boundary.
* config/ia64/ia64.h (FUNCTION_ARG_BOUNDARY): Change macro to call ia64_function_arg_boundary. * config/ia64/ia64-protos.h (ia64_function_arg_boundary): New. * config/ia64/ia64.c (ia64_function_arg_boundary): New. (ia64_function_arg_advance): Do not put 128 bit floats into FP registers. From-SVN: r88608
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/config/ia64/ia64-protos.h1
-rw-r--r--gcc/config/ia64/ia64.c34
-rw-r--r--gcc/config/ia64/ia64.h10
4 files changed, 43 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 71d6d1b..560e4cd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2004-10-06 Steve Ellcey <sje@cup.hp.com>
+
+ * config/ia64/ia64.h (FUNCTION_ARG_BOUNDARY): Change macro to
+ call ia64_function_arg_boundary.
+ * config/ia64/ia64-protos.h (ia64_function_arg_boundary): New.
+ * config/ia64/ia64.c (ia64_function_arg_boundary): New.
+ (ia64_function_arg_advance): Do not put 128 bit floats into
+ FP registers.
+
2004-10-06 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* builtins.c (expand_builtin_strcpy): Delete duplicate code.
diff --git a/gcc/config/ia64/ia64-protos.h b/gcc/config/ia64/ia64-protos.h
index 19e1335..ab5062c 100644
--- a/gcc/config/ia64/ia64-protos.h
+++ b/gcc/config/ia64/ia64-protos.h
@@ -77,6 +77,7 @@ extern int ia64_function_arg_partial_nregs (CUMULATIVE_ARGS *,
enum machine_mode, tree, int);
extern void ia64_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
tree, int);
+extern int ia64_function_arg_boundary (enum machine_mode, tree);
extern void ia64_asm_output_external (FILE *, tree, const char *);
#endif /* TREE_CODE */
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index b51cc7a..69339d8 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -3325,10 +3325,11 @@ ia64_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
cum->fp_regs = fp_regs;
}
- /* Integral and aggregates go in general registers. If we have run out of
- FR registers, then FP values must also go in general registers. This can
- happen when we have a SFmode HFA. */
- else if (! FLOAT_MODE_P (mode) || cum->fp_regs == MAX_ARGUMENT_SLOTS)
+ /* Integral and aggregates go in general registers. So do TFmode FP values.
+ If we have run out of FR registers, then other FP values must also go in
+ general registers. This can happen when we have a SFmode HFA. */
+ else if (mode == TFmode || mode == TCmode
+ || (! FLOAT_MODE_P (mode) || cum->fp_regs == MAX_ARGUMENT_SLOTS))
cum->int_regs = cum->words;
/* If there is a prototype, then FP values go in a FR register when
@@ -3351,6 +3352,31 @@ ia64_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
}
}
+/* Arguments with alignment larger than 8 bytes start at the next even
+ boundary. On ILP32 HPUX, TFmode arguments start on next even boundery
+ even though their normal alignment is 8 bytes. See ia64_function_arg. */
+
+int
+ia64_function_arg_boundary (enum machine_mode mode, tree type)
+{
+
+ if (mode == TFmode && TARGET_HPUX && TARGET_ILP32)
+ return PARM_BOUNDARY * 2;
+
+ if (type)
+ {
+ if (TYPE_ALIGN (type) > PARM_BOUNDARY)
+ return PARM_BOUNDARY * 2;
+ else
+ return PARM_BOUNDARY;
+ }
+
+ if (GET_MODE_BITSIZE (mode) > PARM_BOUNDARY)
+ return PARM_BOUNDARY * 2;
+ else
+ return PARM_BOUNDARY;
+}
+
/* Variable sized types are passed by reference. */
/* ??? At present this is a GCC extension to the IA-64 ABI. */
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index 58304a9..aab51f8 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -1376,15 +1376,11 @@ do { \
/* If defined, a C expression that gives the alignment boundary, in bits, of an
argument with the specified mode and type. */
-/* Arguments with alignment larger than 8 bytes start at the next even
- boundary. See ia64_function_arg. */
+/* Return the alignment boundary in bits for an argument with a specified
+ mode and type. */
#define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \
- (((TYPE) ? (TYPE_ALIGN (TYPE) > 8 * BITS_PER_UNIT) \
- : (((((MODE) == BLKmode \
- ? int_size_in_bytes (TYPE) : GET_MODE_SIZE (MODE)) \
- + UNITS_PER_WORD - 1) / UNITS_PER_WORD) > 1)) \
- ? 128 : PARM_BOUNDARY)
+ ia64_function_arg_boundary (MODE, TYPE)
/* A C expression that is nonzero if REGNO is the number of a hard register in
which function arguments are sometimes passed. This does *not* include