Linux PARISC architecture development
 help / color / mirror / Atom feed
From: Carlos O'Donell <carlos@baldric.uwo.ca>
To: John David Anglin <dave@hiauly1.hia.nrc.ca>
Cc: parisc-linux@lists.parisc-linux.org, tausq@debian.org,
	Jim Hull <jim_hull@hp.com>
Subject: Re: [parisc-linux] glibc 2.3.1 - It's alive! - patches
Date: Wed, 13 Nov 2002 14:22:10 -0500	[thread overview]
Message-ID: <20021113192210.GC4970@systemhalted> (raw)
In-Reply-To: <200211121544.gACFi8Na004766@hiauly1.hia.nrc.ca>

On Tue, Nov 12, 2002 at 10:44:07AM -0500, John David Anglin wrote:
> > > __asm__ __volatile__ ("fmpy,dbl %1,%%fr0,%0\n\t"
> > > 			/* FIXME: is this a proper trap barrier? */
> > > 			"fcpy,dbl %%fr0,%%fr0" : "=f" (d) : "0"(d));

So really the fix is to spill into a third register or a memory location
in order to:

1) Prevent reordering and subsequent discard of the insn
2) Trigger the trap since the result of the register is needed

> 1) You probably want to clear the T bit at the beginning of the
>    routine.  This will ensure that you get the correct exception
>    when the first one is raised.  The only way to do this without
>    potentially causing a pending trap to trigger is with a double
>    word store to floating-point register 0.  You can't read register
>    0 before the write without potentially triggering a trap, so
>    you need to know what the current state should be.  See page
>    10-5 of the PA2 arch manual.

Okie, lets see if I have this right:

1) Routine starts
2) Clear T by reading fr0 and writing back with T=0
	= All other pending delayed exceptions are nulled
3) Setup an exception to occur based on requirements
	= insn writes to dX
4) Trap barrier
	= insn where dX is copied to dY (dX!=dY)

> 2) A fcpy insn should raise an exception if it depends on the
>    result of a pending trapping insn (the current code doesn't).
>    It would be best to not use register 0 or the source register
>    for the destination register since in theory the processor
>    would then know the operation is a nop.  Then, the insn could
>    be reordered or discarded.  The fcpy insn is nice since it
>    is non-arithmetic and doesn't cause an invalid operation
>    exception when a NaN is copied.  The fcmp insn isn't quite
>    as nice since it will generate an invalid operation when one
>    of the values is a signaling NaN, or if the low-order bit
>    of the condition code is 1 and one of the values is an NaN.

I liked the fcpy specifically for that reason. It doesn't itself cause a
recursive triggering of more delayed exceptions, eventually filling the
exception queue and delivering an exception anyway ;)

c.

  parent reply	other threads:[~2002-11-13 19:22 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-11  1:05 [parisc-linux] glibc 2.3.1 - It's alive! - patches Carlos O'Donell
2002-11-11  1:19 ` John David Anglin
2002-11-11 17:12   ` Carlos O'Donell
2002-11-11 17:36     ` John David Anglin
2002-11-11 18:00       ` Matthew Wilcox
2002-11-11 18:20         ` Carlos O'Donell
2002-11-11 18:58           ` Carlos O'Donell
2002-11-11 20:42       ` Carlos O'Donell
2002-11-11 20:57         ` John David Anglin
2002-11-11 21:17           ` Carlos O'Donell
2002-11-11 21:33             ` John David Anglin
2002-11-12  5:31               ` [parisc-linux] simple testcase for binutils visibility problem Randolph Chung
2002-11-12  5:58                 ` John David Anglin
2002-11-11 21:16         ` [parisc-linux] glibc 2.3.1 - It's alive! - patches Carlos O'Donell
2002-11-11 22:36           ` John David Anglin
2002-11-11 22:44             ` Carlos O'Donell
2002-11-11 22:53               ` John David Anglin
2002-11-11 23:27                 ` Carlos O'Donell
2002-11-12  0:22                   ` John David Anglin
2002-11-12  1:23                     ` Carlos O'Donell
2002-11-12  4:13                   ` John David Anglin
2002-11-12 15:44                     ` John David Anglin
2002-11-12 17:42                       ` Jim Hull
2002-11-12 17:53                         ` John David Anglin
2002-11-12 18:43                           ` Jim Hull
2002-11-12 19:02                             ` John David Anglin
2002-11-12 19:31                               ` Jim Hull
2002-11-12 19:38                                 ` John David Anglin
2002-11-13 19:22                       ` Carlos O'Donell [this message]
2002-11-13 20:16                         ` John David Anglin
2002-11-17 21:54           ` John David Anglin
2002-11-18 16:12             ` Carlos O'Donell
2002-11-18 17:42               ` John David Anglin
2002-11-18 19:30                 ` Carlos O'Donell
2002-11-18 19:44                   ` John David Anglin
2002-11-11  1:21 ` Matthew Wilcox
2002-11-11  1:32   ` John David Anglin
2002-11-11  1:49     ` Carlos O'Donell
2002-11-11  3:45       ` John David Anglin
2002-11-11  4:26         ` John David Anglin
2002-11-11 15:03           ` Carlos O'Donell
2002-11-11 15:47             ` John David Anglin
2002-11-11 16:26               ` Carlos O'Donell
2002-11-11 17:25                 ` John David Anglin
2002-11-11 17:37                   ` Carlos O'Donell
2002-11-11 17:46                     ` John David Anglin

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=20021113192210.GC4970@systemhalted \
    --to=carlos@baldric.uwo.ca \
    --cc=dave@hiauly1.hia.nrc.ca \
    --cc=jim_hull@hp.com \
    --cc=parisc-linux@lists.parisc-linux.org \
    --cc=tausq@debian.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