public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeffrey A Law <law@cygnus.com>
To: Greg McGary <greg@mcgary.org>
Cc: gcc@gcc.gnu.org
Subject: Re: MIPS div_trap vs. general conditional traps
Date: Thu, 07 Sep 2000 15:13:00 -0000	[thread overview]
Message-ID: <8419.968364901@upchuck> (raw)
In-Reply-To: <200009062017.NAA06786@kayak.mcgary.org>

  In message < 200009062017.NAA06786@kayak.mcgary.org >you write:
  > I implemented conditional traps for MIPS using the MIPS
  > conditional-trap machine instructions for ISA>=2 and using the MIPS
  > `break' instruction for ISA==1.  I posted the patch last night.
Sounds like a good thing.


  > Since then, I have noticed that the MIPS div_trap also generates
  > TRAP_IFs, but always translates them to conditional branches to MIPS
  > BREAK instructions.  Is there any reason why we shouldn't use
  > conditional-trap machine instructions for div_trap as well, falling
  > back to conditional branches to BREAK only for ISA==1 ?
Because the expansion of division now done by the compiler needed to be
equivalent to what used to be done by the assembler in terms of 
break vs trap.

  > One reason not to do it is that operating systems might expect div
  > traps to come as BREAKs (EXC == 9), rather than as traps (EXC == 13).
Precisely.

  > However, since I doubt that OSes do anything other than terminate the
  > program that gets a div_trap, and BREAK and trap exceptions probably
  > both terminate just as effectively,
You lose the context as to why you had to stop the process.  ie, we use
different break #s for the different reasons why we might stop the
target.

  > For backward compatibility, we could always provide a `-m' option to
  > force branches to BREAKs.
We shouldn't break backwards compatibility to start with.

  > Another reason not to do it, and to favor branches to BREAK even for
  > general conditional traps is if the conditional-trap machine
  > instructions are serializing.  My MIPS manuals are silent on that
  > issue.
No clue on this one.
jeff

  reply	other threads:[~2000-09-07 15:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-06 13:18 Greg McGary
2000-09-07 15:13 ` Jeffrey A Law [this message]
2000-09-07 16:53   ` Greg McGary

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=8419.968364901@upchuck \
    --to=law@cygnus.com \
    --cc=gcc@gcc.gnu.org \
    --cc=greg@mcgary.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).