linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Michel Dänzer" <michdaen@iiic.ethz.ch>
To: Keith Whitwell <keith_whitwell@yahoo.com>
Cc: linuxppc-dev@lists.linuxppc.org, devel@xfree86.org,
	Brian Paul <brian_e_paul@yahoo.com>,
	"mesa3d-dev@lists.sourceforge.net"
	<mesa3d-dev@lists.sourceforge.net>,
	"Torrey T. Lyons" <torrey@mrcla.com>
Subject: Re: PPC FPU handling [was: Re: NaN patch]
Date: 19 Nov 2001 18:02:18 +0100	[thread overview]
Message-ID: <1006189338.32090.0.camel@pismo> (raw)
In-Reply-To: <3BFA7A67.79E95609@yahoo.com>


On Tue, 2001-11-20 at 16:44, Keith Whitwell wrote:
> Keith Whitwell wrote:
> >
>
> > >
> > > I'd consider adding NaN-checking code to the indirect rendering path,
> > > since it's slow anyway but am hesitant to add it to client-side (and
> > > hardware) code for performance reasons.
> > >
> >
> > Well rather than doing this, can we isolate where the bug is and wrap that
> > section in START_FAST_MATH/END_FAST_MATH.  I'm pretty sure this sort of
> > explicit NaN checking isn't in the SI, and if you think about what code is in
> > the indirect path but not the direct path, it doesn't add up to much -
> > certainly not worth this heavyhanded approach.  Alternately there might be
> > some code that could be slightly tweaked to avoid the crashes.
> >
>
> OK.  There is no implementation of START_FAST_MATH/END_FAST_MATH for PPC (this
> is a macintosh-specific problem).

No, it's not. :) But it's funny you mention this, the following code in
mmath.h doesn't look right to me:

/* The mac float really is a float, with the same precision as a
 * single precision 387 float.
 */
#if defined(macintosh)
#define HAVE_FAST_MATH
#endif


Shouldn't that rather be #if defined(__powerpc__) ?


>  One is required for this and every
> architecture which runs Mesa, otherwise there is a need for a check on every
> single float that comes into the api, which is in the squillions.  Have a look
> at mmath.h in xc/extras/Mesa/src, and try and do something similar.
>
> The big requirement is to turn off the ieee inf/nan exceptions (on the x86 we
> also stop the fpu keeping excess precision).  Turn the exceptions off in
> START_FAST_MATH (and back to their original state in END_FAST_MATH) and your
> problem should go away.  The documentation of these macros only talks about
> precision in 3.4.2, but is accurate in 4.0.


Also, further down:

#if defined(__i386__) || defined(__sparc__) || defined(__s390x__) || \
    ( defined(__alpha__) && ( defined( __IEEE_FLOAT ) || !defined( VMS )
) )
#define USE_IEEE
#define IEEE_ONE 0x3f7f0000
#endif


Shouldn't these be defined for __powerpc__ too, or isn't the PPC FPU
IEEE conformant (or what do these defines mean anyway)?


Looking forward to any insights...


--
Earthling Michel Dänzer (MrCooper)/ Debian GNU/Linux (powerpc) developer
XFree86 and DRI project member   /  CS student, Free Software enthusiast

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

           reply	other threads:[~2001-11-19 17:02 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <3BFA7A67.79E95609@yahoo.com>]

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=1006189338.32090.0.camel@pismo \
    --to=michdaen@iiic.ethz.ch \
    --cc=brian_e_paul@yahoo.com \
    --cc=devel@xfree86.org \
    --cc=keith_whitwell@yahoo.com \
    --cc=linuxppc-dev@lists.linuxppc.org \
    --cc=mesa3d-dev@lists.sourceforge.net \
    --cc=torrey@mrcla.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;
as well as URLs for NNTP newsgroup(s).