aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBen Elliston <bje@au.ibm.com>2006-02-07 02:28:56 +0000
committerBen Elliston <bje@gcc.gnu.org>2006-02-07 13:28:56 +1100
commita81083b271b2d449c93b2ddb02d2b00594e11525 (patch)
treed22ee65d9cb484c31ff7ebb9a9131aff62b0ab6f /gcc
parent5fd231d2c77a4f400a0caf4cced86b253495bc07 (diff)
downloadgcc-a81083b271b2d449c93b2ddb02d2b00594e11525.zip
gcc-a81083b271b2d449c93b2ddb02d2b00594e11525.tar.gz
gcc-a81083b271b2d449c93b2ddb02d2b00594e11525.tar.bz2
i386.c (ix86_scalar_mode_supported_p): New.
* config/i386/i386.c (ix86_scalar_mode_supported_p): New. (TARGET_SCALAR_MODE_SUPPORTED_P): Define hook. (classify_argument): Handle SDmode, DDmode, TDmode for 64-bit. (ix86_return_in_memory): Handle TDmode. (ix86_libcall_value): Handle SDmode, DDmode, TDmode. (ix86_value_regno): Return non-TDmode decimal float modes in %eax. From-SVN: r110684
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/config/i386/i386.c32
2 files changed, 41 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f9848cd..6e5ca82 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2006-02-07 Ben Elliston <bje@au.ibm.com>
+
+ * config/i386/i386.c (ix86_scalar_mode_supported_p): New.
+ (TARGET_SCALAR_MODE_SUPPORTED_P): Define hook.
+ (classify_argument): Handle SDmode, DDmode, TDmode for 64-bit.
+ (ix86_return_in_memory): Handle TDmode.
+ (ix86_libcall_value): Handle SDmode, DDmode, TDmode.
+ (ix86_value_regno): Return non-TDmode decimal float modes in %eax.
+
2006-02-06 Richard Sandiford <richard@codesourcery.com>
* reorg.c (dbr_schedule): Use dump_file instead of file.
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 27b42ea..f4eb04e 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -1099,6 +1099,7 @@ static tree ix86_build_builtin_va_list (void);
static void ix86_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode,
tree, int *, int);
static tree ix86_gimplify_va_arg (tree, tree, tree *, tree *);
+static bool ix86_scalar_mode_supported_p (enum machine_mode);
static bool ix86_vector_mode_supported_p (enum machine_mode);
static int ix86_address_cost (rtx);
@@ -1327,6 +1328,9 @@ static section *x86_64_elf_select_section (tree decl, int reloc,
#undef TARGET_GIMPLIFY_VA_ARG_EXPR
#define TARGET_GIMPLIFY_VA_ARG_EXPR ix86_gimplify_va_arg
+#undef TARGET_SCALAR_MODE_SUPPORTED_P
+#define TARGET_SCALAR_MODE_SUPPORTED_P ix86_scalar_mode_supported_p
+
#undef TARGET_VECTOR_MODE_SUPPORTED_P
#define TARGET_VECTOR_MODE_SUPPORTED_P ix86_vector_mode_supported_p
@@ -3070,6 +3074,14 @@ classify_argument (enum machine_mode mode, tree type,
/* Classification of atomic types. */
switch (mode)
{
+ case SDmode:
+ case DDmode:
+ classes[0] = X86_64_SSE_CLASS;
+ return 1;
+ case TDmode:
+ classes[0] = X86_64_SSE_CLASS;
+ classes[1] = X86_64_SSEUP_CLASS;
+ return 2;
case DImode:
case SImode:
case HImode:
@@ -3813,6 +3825,9 @@ ix86_return_in_memory (tree type)
if (mode == XFmode)
return 0;
+ if (mode == TDmode)
+ return 1;
+
if (size > 12)
return 1;
return 0;
@@ -3878,6 +3893,9 @@ ix86_libcall_value (enum machine_mode mode)
case DFmode:
case DCmode:
case TFmode:
+ case SDmode:
+ case DDmode:
+ case TDmode:
return gen_rtx_REG (mode, FIRST_SSE_REG);
case XFmode:
case XCmode:
@@ -3909,6 +3927,10 @@ ix86_value_regno (enum machine_mode mode, tree func, tree fntype)
if (mode == TImode || (VECTOR_MODE_P (mode) && GET_MODE_SIZE (mode) == 16))
return FIRST_SSE_REG;
+ /* Decimal floating point values can go in %eax, unlike other float modes. */
+ if (DECIMAL_FLOAT_MODE_P (mode))
+ return 0;
+
/* Most things go in %eax, except (unless -mno-fp-ret-in-387) fp values. */
if (!SCALAR_FLOAT_MODE_P (mode) || !TARGET_FLOAT_RETURNS_IN_80387)
return 0;
@@ -18441,6 +18463,16 @@ ix86_expand_reduc_v4sf (rtx (*fn) (rtx, rtx, rtx), rtx dest, rtx in)
emit_insn (fn (dest, tmp2, tmp3));
}
+/* Target hook for scalar_mode_supported_p. */
+static bool
+ix86_scalar_mode_supported_p (enum machine_mode mode)
+{
+ if (DECIMAL_FLOAT_MODE_P (mode))
+ return true;
+ else
+ return default_scalar_mode_supported_p (mode);
+}
+
/* Implements target hook vector_mode_supported_p. */
static bool
ix86_vector_mode_supported_p (enum machine_mode mode)