This is the mail archive of the
mailing list for the GCC project.
Re: [MIPS64] Problems when Passing TImode Parameters in EABI
- From: "Chao-ying Fu" <fu at mips dot com>
- To: "Richard Sandiford" <richard at codesourcery dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>, "Thekkath, Radhika" <radhika at mips dot com>, "Stephens, Nigel" <nigel at mips dot com>
- Date: Fri, 6 Oct 2006 14:32:15 -0700
- Subject: Re: [MIPS64] Problems when Passing TImode Parameters in EABI
- References: <3CB54817FDF733459B230DD27C690CEC012BB144@Exchange.mips.com> <firstname.lastname@example.org> <email@example.com>
- Reply-to: "Chao-ying Fu" <fu at mips dot com>
Thanks for the patch! But from this patch, TImode parameters will be
passed by reference. Could we test 64-bit targets and
TImode to return false, so that TImode parameters can be passed by value?
----- Original Message -----
From: "Richard Sandiford" <firstname.lastname@example.org>
To: "Fu, Chao-Ying" <email@example.com>
Cc: <firstname.lastname@example.org>; "Thekkath, Radhika" <email@example.com>;
"Stephens, Nigel" <firstname.lastname@example.org>
Sent: Thursday, October 05, 2006 3:20 PM
Subject: Re: [MIPS64] Problems when Passing TImode Parameters in EABI
> Richard Sandiford <email@example.com> writes:
> > "Fu, Chao-Ying" <firstname.lastname@example.org> writes:
> >> I think there is a bug in mips_pass_by_reference when the mips abi
> >> is EABI to pass TImode parameters.
> > Good catch.
> >> Does someone know how to pass TImode parameters in EABI? Thanks!
> > I imagine this case wasn't specifically considered. The EABI calls
> > for double-word integers to be passed by value on 32-bit targets,
> > so if 128-bit integers had been considered, I imagine the EABI
> > would call for them to be handled in the same way on 64-bit targets.
> > As it is, the EABI uses stack passing as the fallback case for
> > "parameters not otherwise handled above". So I think the type
> > != NULL case is doing the right thing. Sticking with it also
> > has the advantage that it wouldn't break backward compatiblity
> > for cases that currently work. I don't think this particular
> > case has ever worked for libcalls.
> > I'll whip up a patch tonight. I imagine this is also the reason for the
> > gcc.dg/torture/fp-int-convert-timode.c failures on mipsisa64-elf, which
> > I haven't had the spare time to look at yet.
> It was. I've committed the patch below after testing on mipsisa64-elf.
> It fixes the gcc.dg/torture/fp-int-convert-timode.c and gcc.dg/ftrapv-2.c
> failures for 64-bit multilibs.
> * config/mips/mips.c (mips_pass_by_reference): Do not return false
> for EABI if type is NULL. Use a size check based on GET_MODE_SIZE
> Index: gcc/config/mips/mips.c
> --- gcc/config/mips/mips.c (revision 117451)
> +++ gcc/config/mips/mips.c (working copy)
> @@ -7556,10 +7556,10 @@ mips_pass_by_reference (CUMULATIVE_ARGS
> int size;
> /* ??? How should SCmode be handled? */
> - if (type == NULL_TREE || mode == DImode || mode == DFmode)
> + if (mode == DImode || mode == DFmode)
> return 0;
> - size = int_size_in_bytes (type);
> + size = type ? int_size_in_bytes (type) : GET_MODE_SIZE (mode);
> return size == -1 || size > UNITS_PER_WORD;