All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent Chen <vincentc@andestech.com>
To: David Laight <David.Laight@ACULAB.COM>
Cc: "green.hu@gmail.com" <green.hu@gmail.com>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Nick Chun-Ming Hu(?????????)" <nickhu@andestech.com>,
	"deanbo422@gmail.com" <deanbo422@gmail.com>
Subject: Re: [PATCH v4 2/5] nds32: Support FP emulation
Date: Tue, 27 Nov 2018 10:46:38 +0800	[thread overview]
Message-ID: <20181127024638.GA6633@andestech.com> (raw)
In-Reply-To: <3dcd9764570e4565911b74b08513e2d3@AcuMS.aculab.com>

On Mon, Nov 26, 2018 at 06:18:01PM +0800, David Laight wrote:
> From: Vincent Chen
> > Sent: 26 November 2018 01:23
> > On Fri, Nov 23, 2018 at 06:53:37PM +0800, David Laight wrote:
> > > From: Vincent Chen
> > > > Sent: 22 November 2018 03:15
> > > >
> > > > The Andes FPU coprocessor does not support denormalized number handling.
> > > > According to the specification, FPU generates a denorm input exception
> > > > that requires the kernel to deal with this instrution operation when it
> > > > encounters denormalized operands. Hence an nds32 FPU ISA emulator in the
> > > > kernel is required to meet requirement.
> > >
> > > What does the FPU generate for results near zero?
> > 
> > 1. The calculation result is a denormalized number
> > Depending on the state of underflow trap, the FPU will raise an underflow
> > exception or flash the result to zero.
> > 
> > 2. One of the operands is a denormalized number
> > Depending on the state of the flash-to-zero mode, the FPU will raise a
> > denormalized input exception, which is a specific exception of the nds FPU,
> > or directly treats the operand as 0.
> 
> You didn't mention (1) in the commit message.
>
  I use two commits to complete the implementation of the FPU emulator in
  this patch set. The handling for (1) case is in another patch, "nds32:
  support denormalized result through FP emulator". Sorry, the above
  description may be misleading.
 
> It ought to be possibly for the exception routine to rescale the values,
> re-issue the same FP instruction, then scale the result.
> 
> 	David
> 
  
  I Agree. The scheme is common when dealing with denormalized numbers,
  including the softfp module of the kernel used in this patchset.

> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)
> 

  reply	other threads:[~2018-11-27  2:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-22  3:14 [PATCH v4 0/5] nds32 FPU port Vincent Chen
2018-11-22  3:14 ` [PATCH v4 1/5] nds32: " Vincent Chen
2018-11-22  3:14 ` [PATCH v4 2/5] nds32: Support FP emulation Vincent Chen
2018-11-23 10:53   ` David Laight
2018-11-26  1:23     ` Vincent Chen
2018-11-26 10:18       ` David Laight
2018-11-27  2:46         ` Vincent Chen [this message]
2018-11-22  3:14 ` [PATCH v4 3/5] nds32: support denormalized result through FP emulator Vincent Chen
2018-11-22  3:14 ` [PATCH v4 4/5] math-emu/op-2.h: Use statement expressions to prevent negative constant shift Vincent Chen
2018-11-22  3:14 ` [PATCH v4 5/5] math-emu/soft-fp.h: (_FP_ROUND_ZERO) cast 0 to void to fix warning Vincent Chen
2018-11-22 10:21 ` [PATCH v4 0/5] nds32 FPU port Greentime Hu

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=20181127024638.GA6633@andestech.com \
    --to=vincentc@andestech.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=arnd@arndb.de \
    --cc=deanbo422@gmail.com \
    --cc=green.hu@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickhu@andestech.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 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.