public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: "Jürgen Urban" <JuergenUrban@gmx.de>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: Support for MIPS r5900
Date: Mon, 07 Jan 2013 17:15:00 -0000	[thread overview]
Message-ID: <50EB0294.8070600@redhat.com> (raw)
In-Reply-To: <20130106225645.190700@gmx.net>

On 01/06/2013 03:56 PM, "JÃŒrgen Urban" wrote:
> Hello,
>
> I created a patch from scratch to support MIPS r5900 used in the
> Playstation 2, but I have some problems with it. The attached patch
> only works with the latest binutils from CVS. The binutils forces the
> compiler to use r5900 compatible instructions which is good to find
> errors in the GCC. Later I will try to submit a patch here, but first
> I need some help. The MIPS r5900 supports 32 bit, 64 bit and 128 bit
> data accesses on a 32 Bit address bus. It supports instructions from
> MIPS ISA I, II, III, IV and has additional instructions, but none of
> them are complete. On each ISA level there are instructions missing.
> It can run MIPS ABI o32, n32 and o64 code, as long as unsupported
> instructions are not used or emulated by the operating system and the
> addresses keep in the first 32 bit. My patch adds support for r5900
> and tries to disable the following unsupported instructions: ll, sc,
> dmult, ddiv, cvt.w.s, 64 bit FPU instructions. ll and sc is disabled
> with "-mno-llsc" and works. cvt.w.s is replaced by trunc.w.s. This
> seems to work. I disabled 64 bit FPU instructions by "-msoft-float".
> This works, but using "-msingle-float" fails. This would be the
> better configuration. There are still 64 bit FPU instructions used
> (e.g. "dmfc1   $2,$f0" when using "long double" multiplication). So
> "-msingle-float" doesn't seem to work on generic mips64-linux-gnu. I
> tried to disable dmult and ddiv (see mips.md). Disabling worked, but
> now muldi3 calls itself in libgcc2. I thought this should work,
> because I got this working with GCC 4.3, but the latest GCC version
> is a problem. multi3 is calling muldi3, so that muldi3 should be able
> to use mulsi3, because it is the same C code in libgcc2. Can someone
> get me some hints or comments? How can this be debugged?
>
> Does someone know how to enable TImode in MIPS ABI o32 (this doesn't
> need to use the 128 bit instructions at the moment)? There is some
> old code for the Playstation 2 which needs this. I know that TImode
> is supported in ABI n32, but some code uses also the 32 bit FPU and
> FPU registers are not available with "-msoft-float" in inline
> assembler.
>
> What is the best way to change the alignment to 128 bit for all
> structures and stack in any MIPS ABI? Much old code for the
> Playstation 2 expects this.
Hmm, I did a R5900 port back in the late 90s...  Did that port never get 
contributed (yes, my memory is that bad these days)

As far as getting TI mode working, IIRC I did a configury hack of some 
sort to force using a 64bit host wide integer, that in turn made it 
possible to support TImode as a pair of 64bit HWIs.

As far as aligning structures and the stack, GCC has a standard set of 
macros to define structure & stack alignment.

Jeff

  reply	other threads:[~2013-01-07 17:15 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-06 22:57 "Jürgen Urban"
2013-01-07 17:15 ` Jeff Law [this message]
2013-01-07 20:44   ` Richard Sandiford
2013-01-07 21:52 ` Richard Sandiford
2013-01-08  0:23   ` Maciej W. Rozycki
2013-01-08  7:28     ` Richard Sandiford
2013-01-08 17:24       ` Maciej W. Rozycki
2013-01-08 18:25         ` Richard Sandiford
2013-01-08 22:34     ` "Jürgen Urban"
2013-01-10 23:25       ` Maciej W. Rozycki
2013-01-11  9:49         ` Richard Sandiford
2013-01-11 16:55           ` Maciej W. Rozycki
2013-01-13 14:16         ` "Jürgen Urban"
2013-01-14 18:42           ` Maciej W. Rozycki
2013-01-17 22:21             ` "Jürgen Urban"
2013-01-17 23:23               ` Maciej W. Rozycki
2013-01-19 10:53                 ` Richard Sandiford
2013-01-20 21:43                 ` "Jürgen Urban"
2013-01-08  4:22   ` Jeff Law
2013-01-08  7:22     ` Richard Sandiford
2013-01-08 22:49       ` "Jürgen Urban"
2013-01-09  5:25         ` Jeff Law
2013-01-10 22:59           ` "Jürgen Urban"
2013-01-11  4:41             ` Jeff Law
2013-01-08  7:16   ` Richard Sandiford
2013-01-08 21:30   ` "Jürgen Urban"

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50EB0294.8070600@redhat.com \
    --to=law@redhat.com \
    --cc=JuergenUrban@gmx.de \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).