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>
Subject: Re: [PATCH v4 2/5] nds32: Support FP emulation
Date: Mon, 26 Nov 2018 09:23:10 +0800 [thread overview]
Message-ID: <20181126012310.GA26621@andestech.com> (raw)
In-Reply-To: <f0d20a4682b740659f28184c1278ae7d@AcuMS.aculab.com>
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.
> If it doesn't generate denormalised results (but does detect them)
> then I assume it never generates FP values with exponent zero.
> (So the gap around zero is even larger than it would be if exponent
> zero values had a hidden bit.)
> So is it really worth doing anything other than treating
> denormalised values as zero?
>
> David
>
Sorry, I can't fully understand what you mean, but we really have
encountered the above two cases in some testsuites such as glibc testsuite.
Hence we implement a FPU emulator in this commit which will recalculate the
instructions again by software to enhance the precision.
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)
>
next prev parent reply other threads:[~2018-11-26 1:23 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 [this message]
2018-11-26 10:18 ` David Laight
2018-11-27 2:46 ` Vincent Chen
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=20181126012310.GA26621@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox