All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Weeks <greg.weeks@timesys.com>
To: Dan Malek <dan@embeddededge.com>
Cc: Kumar Gala <kumar.gala@freescale.com>,
	LKML <linux-kernel@vger.kernel.org>,
	LinuxPPC-dev Development <linuxppc-dev@lists.linuxppc.org>
Subject: Re: [BUG] PPC math-emu multiply problem
Date: Fri, 30 Jul 2004 10:45:28 -0400	[thread overview]
Message-ID: <410A5F08.90103@timesys.com> (raw)
In-Reply-To: <A46787F8-E194-11D8-B8DB-003065F9B7DC@embeddededge.com>

Dan Malek wrote:

>
> On Jul 29, 2004, at 10:06 AM, Kumar Gala wrote:
>
>>
>> On Jul 29, 2004, at 8:14 AM, Greg Weeks wrote:
>>
>>> I'm seeing what appears to be a bug in the ppc kernel trap math
>>> emulator. An extreme case for multiplies isn't working the way gcc
>>> soft-float or hardware floating point is.
>>
>
> I'm not surprised.  I lifted this code from Sparc, glibc, and adapted
> it as best I could for PPC years ago for the 8xx.  I was happy when
> it appeared to work for the general cases. :-)
>
> Due to its overhead, I never expected it to be _the_ solution for
> processors that don't have floating point hardware.  Recompiling
> the libraries with soft-float and using that option when compiling
> is the way to go.

OK, this patch fixes my multiply problem with the LSB test. I still need 
to test to make sure I didn't break anything else, but it appears the 
rounding is only used when converting back to IEEE format. Is there some 
reason this is something really dumb to do?

Signed-off-by: Greg Weeks <greg.weeks@timesys.com> under TS0087

--- tanith-linux-2.6.6/arch/ppc/math-emu/soft-fp.h.orig    2004-07-30 
10:31:34.000000000 -0400
+++ tanith-linux-2.6.6/arch/ppc/math-emu/soft-fp.h    2004-07-30 
10:31:57.000000000 -0400
@@ -15,7 +15,7 @@
 # define FP_RND_PINF        2
 # define FP_RND_MINF        3
 #ifndef FP_ROUNDMODE
-# define FP_ROUNDMODE        FP_RND_NEAREST
+# define FP_ROUNDMODE        FP_RND_ZERO
 #endif
 #endif


  parent reply	other threads:[~2004-07-30 14:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-29 13:14 [BUG] PPC math-emu multiply problem Greg Weeks
2004-07-29 14:06 ` Kumar Gala
2004-07-29 14:26   ` Greg Weeks
2004-07-29 19:22   ` Dan Malek
2004-07-29 19:47     ` La Monte H.P. Yarroll
2004-07-30 14:45     ` Greg Weeks [this message]
2004-07-30 15:23       ` Greg Weeks
2004-08-09 16:56         ` Tom Rini
2004-08-09 17:42           ` Dan Malek
2004-08-09 22:18             ` La Monte H.P. Yarroll
2004-08-09 22:23             ` Tom Rini
2004-08-16 13:02               ` Greg Weeks
2004-08-16 14:48                 ` Tom Rini
2004-08-16 18:28                   ` Greg Weeks
2004-08-16 18:35                     ` Tom Rini

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=410A5F08.90103@timesys.com \
    --to=greg.weeks@timesys.com \
    --cc=dan@embeddededge.com \
    --cc=kumar.gala@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.linuxppc.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.