linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Liu Yu <yu.liu@freescale.com>
To: linuxppc-dev@ozlabs.org
Cc: kumar.gala@freescale.com, Liu Yu <yu.liu@freescale.com>
Subject: [PATCH 1/4] math-emu: Fix single float point division bug
Date: Tue, 28 Oct 2008 11:50:18 +0800	[thread overview]
Message-ID: <1225165821-15998-2-git-send-email-yu.liu@freescale.com> (raw)
In-Reply-To: <1225165821-15998-1-git-send-email-yu.liu@freescale.com>

PowerPC float point division emulation is derived from gcc.
I reported this problem on gcc maillist and got this reply:
http://gcc.gnu.org/ml/gcc/2008-03/msg00543.html

Since UDIV_NEEDS_NORMALIZATION is not used by kernel, we should use
_FP_DIV_MEAT_1_udiv_norm to make sure the single float point
is normalized before udiv_qrnnd.

Signed-off-by: Liu Yu <yu.liu@freescale.com>
---
 arch/powerpc/include/asm/sfp-machine.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/include/asm/sfp-machine.h b/arch/powerpc/include/asm/sfp-machine.h
index ced34f1..da12ea7 100644
--- a/arch/powerpc/include/asm/sfp-machine.h
+++ b/arch/powerpc/include/asm/sfp-machine.h
@@ -82,7 +82,7 @@
 #define _FP_MUL_MEAT_S(R,X,Y)   _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
 #define _FP_MUL_MEAT_D(R,X,Y)   _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
 
-#define _FP_DIV_MEAT_S(R,X,Y)	_FP_DIV_MEAT_1_udiv(S,R,X,Y)
+#define _FP_DIV_MEAT_S(R,X,Y)	_FP_DIV_MEAT_1_udiv_norm(S,R,X,Y)
 #define _FP_DIV_MEAT_D(R,X,Y)	_FP_DIV_MEAT_2_udiv(D,R,X,Y)
 
 /* These macros define what NaN looks like. They're supposed to expand to
-- 
1.5.4

  reply	other threads:[~2008-10-28  3:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-28  3:50 [Patch 0/4] math-emu Liu Yu
2008-10-28  3:50 ` Liu Yu [this message]
2008-10-28  3:50   ` [PATCH 2/4] math-emu: Adopt new version of _FP_CHOOSENAN Liu Yu
2008-10-28  3:50     ` [PATCH 3/4] math-emu: Remove redundant 'ret' Liu Yu
2008-10-28  3:50       ` [PATCH 4/4] Add SPE/EFP math emulation for E500v1/v2 processors Liu Yu
2008-11-06  4:05         ` Kumar Gala
2008-11-06  4:05       ` [PATCH 3/4] math-emu: Remove redundant 'ret' Kumar Gala
2008-11-06  4:05     ` [PATCH 2/4] math-emu: Adopt new version of _FP_CHOOSENAN Kumar Gala
2008-11-06  4:03   ` [PATCH 1/4] math-emu: Fix single float point division bug Kumar Gala

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=1225165821-15998-2-git-send-email-yu.liu@freescale.com \
    --to=yu.liu@freescale.com \
    --cc=kumar.gala@freescale.com \
    --cc=linuxppc-dev@ozlabs.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 NNTP newsgroup(s).