Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: cgd@broadcom.com
To: "Andrew Cagney" <ac131313@redhat.com>
Cc: "Kevin Buettner" <kevinb@redhat.com>, gdb-patches@sources.redhat.com
Subject: Re: [WIP/RFC] MIPS registers overhaul
Date: Mon, 16 Jun 2003 18:06:00 -0000	[thread overview]
Message-ID: <yov565n5yk1a.fsf@ldt-sj3-010.sj.broadcom.com> (raw)
In-Reply-To: <3EEBCD84.6010005@redhat.com>

At Sat, 14 Jun 2003 21:36:04 -0400, Andrew Cagney wrote:
> Chris?

Sorry, I must have missed that msg...  8-)


> That isn't quite the detail I was looking for.  Does the code need to 
> look like:
> 
> save::
> 	save FSR
> 	if (FSR & FR)
   *** when FR == 1, it's 32 64-bit registers.  so, invert.
> 	  save 32x32 FP
   *** or, save 16 (even) 64-bit FP registers, if MIPS2 or later.
   *** in fact, on MIPS2 and later, better to do that, since it'll be
   *** more efficient (fewer instructions).
> 	else
> 	  save 32x64 FP
> 
> restore::
> 	restore FSR
> 	if (FSR & FR)
> 	  restore 32x32 FP
> 	else
> 	  restore 32x64 FP
> 
> that is, the FSR[FR] bit (wonder if I've got the names right) needs to 
> set/clear the FR bit before it even starts to consider saving/restoring 
> the other registers.

It's Status:FR (or, SR:FR, but i prefer to call the regs by their
proper names 8-).  (also, "or, use notation of your choice."  8-)

(it's in the normal CP0 status register, not in any of the FPU control
registers.  all of the latter are user-accessable, but Status:FR is
not.)


> The reverse operation:
> 
> save::
> 	save FSR
> 	make FP registers 64 bit
> 	save 32x64 FP
> 
> restore::
> 	// assume FSR[FR] set to 64 bit mode
> 	restore 32x64 FP
> 	restore FSR
> 
> operation not being valid.

So, I looked at the specifications, and I don't couldn't find any
place where this is defined by the current architecture to be
UNPREDICTABLE, but i may have missed it.

I would expect -- but haven't checked -- that this would work as well.
Looking at the diagrams in the MIPS32 and MIPS64 specs which try to
explain opration behaviour w/ the various FR modes, I think i'd
*expect* it to work.

Based on the diagrams in the manuals, I'd *expect* that if you do
this, the even registers would contain all of the data used in FR=0
mode, and the odd registers would contain... whatever they were
initialized with when FR was set to 0 initially.

Personally, I wouldn't do this.  8-)


Note also that some processors do have ... interesting hazards when
changing Status:FR modes, too.  If one can keep the number of FR mode
changes to a minimum one can also reduce the number of
hazard-avoidance sequences needed.  In the former example, you do one
Status:FR set per save/restore.  In the latter, you do two.


cgd
--
Chris Demetriou                                            Broadcom Corporation
Principal Design Engineer                     Broadband Processor Business Unit
  Any opinions expressed in this message are mine, not necessarily Broadcom's.



  reply	other threads:[~2003-06-16 18:06 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-10  0:25 Kevin Buettner
2003-05-10 20:30 ` Andrew Cagney
2003-05-10 20:40   ` Daniel Jacobowitz
2003-05-14 22:00   ` Kevin Buettner
     [not found]     ` <mailpost.1052949911.28802@news-sj1-1>
2003-05-14 23:35       ` cgd
2003-05-15  0:07         ` Kevin Buettner
2003-05-15  0:15           ` Daniel Jacobowitz
2003-05-15 22:01     ` Kevin Buettner
2003-05-16  3:24       ` Andrew Cagney
2003-05-16  4:00     ` Andrew Cagney
2003-05-16 17:20       ` Kevin Buettner
     [not found]       ` <mailpost.1053057614.17325@news-sj1-1>
2003-05-16 22:25         ` cgd
     [not found]           ` <mailpost.1053123913.16634@news-sj1-1>
2003-05-16 22:50             ` cgd
2003-05-16 23:05               ` Kevin Buettner
     [not found]                 ` <mailpost.1053126410.17856@news-sj1-1>
2003-05-16 23:24                   ` cgd
2003-05-17  0:41                     ` Kevin Buettner
2003-05-17 20:59                       ` Daniel Jacobowitz
2003-05-20 20:18                         ` Always remote: " Andrew Cagney
2003-05-20 20:26                           ` Daniel Jacobowitz
     [not found]                       ` <mailpost.1053132070.20348@news-sj1-1>
2003-05-20 20:37                         ` cgd
2003-05-20 20:51                           ` Kevin Buettner
2003-05-20 20:52                           ` Andrew Cagney
2003-05-20 21:57                             ` cgd
2003-05-21 15:34                               ` Andrew Cagney
2003-05-21 15:41                                 ` Daniel Jacobowitz
2003-05-21 16:38                                   ` Andrew Cagney
2003-05-21 16:58                                     ` Daniel Jacobowitz
2003-05-21 18:32                                       ` Kevin Buettner
2003-05-21 19:15                                         ` Andrew Cagney
2003-05-21 19:45                                           ` Kevin Buettner
2003-05-22  0:32                                           ` Daniel Jacobowitz
2003-05-23 18:39                                             ` Andrew Cagney
2003-05-23 19:02                                               ` Daniel Jacobowitz
2003-05-23 20:45                                                 ` Andrew Cagney
2003-05-20 20:25               ` Andrew Cagney
2003-05-20 20:32                 ` cgd
2003-05-21 15:40                   ` Andrew Cagney
2003-06-15  1:44                     ` Andrew Cagney
2003-06-16 18:06                       ` cgd [this message]
2003-06-16 18:47                         ` Andrew Cagney
2003-06-15 17:23                   ` Andrew Cagney
2003-06-16 20:06                     ` cgd
2003-06-16 20:41                       ` Andrew Cagney
     [not found]                         ` <mailpost.1055796186.4097@news-sj1-1>
2003-06-17  5:04                           ` cgd
2003-06-17 14:27                             ` Andrew Cagney
     [not found]                               ` <mailpost.1055860052.3406@news-sj1-1>
2003-06-17 16:27                                 ` cgd
2003-05-21 20:58 David Anderson

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=yov565n5yk1a.fsf@ldt-sj3-010.sj.broadcom.com \
    --to=cgd@broadcom.com \
    --cc=ac131313@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kevinb@redhat.com \
    /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