This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[meissner@cygnus.com: Re: Mips: Disallow -mgp32 -mfp64]
- To: gcc-patches at gcc dot gnu dot org
- Subject: [meissner@cygnus.com: Re: Mips: Disallow -mgp32 -mfp64]
- From: Michael Meissner <meissner at cygnus dot com>
- Date: Mon, 17 Sep 2001 13:31:55 -0400
I had the CC address wrong.
----- Forwarded message from Michael Meissner <meissner@cygnus.com> -----
Date: Mon, 17 Sep 2001 13:29:50 -0400
From: Michael Meissner <meissner@cygnus.com>
To: Jonathan Larmour <jlarmour@redhat.com>
Cc: meissner@redhat.com, gcc-patches@sources.redhat.com
Subject: Re: Mips: Disallow -mgp32 -mfp64
Message-ID: <20010917132950.A23498@cse.cygnus.com>
User-Agent: Mutt/1.2.5i
On Mon, Sep 17, 2001 at 05:40:27PM +0100, Jonathan Larmour wrote:
> In article <200109110447.f8B4lgp08693@tiktok.cygnus.com> you write:
> >This patch disallows -mgp32 (assume GPRs are 32-bits) and -mfp64
> >(assume FPRs are 64-bits), since 64-bit FPRs are a MIPS 3 feature, and
> >all MIPS3 machines have 64 bit GPR registers. It also prevents the
> >compiler from tripping over problems in moving 64-bit values in the
> >FPR registers to the GPR registers (if the compiler needed to do this,
> >it would have to store the value into memory and then reload with 2
> >loads, since there aren't instructions to transfer just the upper
> >32-bits). I cleared with Eric Christopher before applying the patch,
> >and built a mips tool chain with it.
>
> All MIPS 3 machines may have 64-bit GPRs/FPRs, but that doesn't
> prevent you compiling with -mgp32 (otherwise, why does the option
> exist orthogonally to setting the ISA)? We have used the equivalent
> of -mips3 -mgp32 -mfp64 successfully, although the OS had to save
> the full 64-bits on context swaps. If values were stored to memory
> as you describe, even that would not be required.
If you want to have the ISA limit the size of int/long/pointer on MIPS3
systems, you should use -mlong32 and not -mgp32. This allows the compiler to
still access the 64-bit register, while still using 32-bit int/long/pointer.
The -mgp32 option exists to allow you to describe new Mips2-like machines that
only have 32-bit registers. Note, there is no PSW-type bit that says GPRs are
to be treated as 32-bits (like there is for the floating point registers).
> What is technically wrong with -mips3 -mgp32 -mfp64?
You cannot move 64-bit values from GPR registers directly to FPR registers, and
similarly you cannot move 64-bit FPR registers to GPR registers. This shows up
in supporting varargs, as well as compiler aborts in some cases when it is
reloading registers, since it can't do the above moves. If we had another
month or so we could fix all of the problems (using memory to move between FPRs
and GPRs), but it didn't seem reasonable to spend the amount of time to support
this corner case.
--
Michael Meissner, Red Hat, Inc. (GCC group)
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work: meissner@redhat.com phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org fax: +1 978-692-4482
----- End forwarded message -----
--
Michael Meissner, Red Hat, Inc. (GCC group)
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work: meissner@redhat.com phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org fax: +1 978-692-4482