Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5129719imu; Sun, 25 Nov 2018 17:25:06 -0800 (PST) X-Google-Smtp-Source: AFSGD/UQjhRd1N9K5bNGNBhGCDVpkHTS1lgdfog3+EE5LqrymiqYTPxNqL+NCDvLYJSnauIPwa8u X-Received: by 2002:a63:e711:: with SMTP id b17mr22087899pgi.363.1543195506682; Sun, 25 Nov 2018 17:25:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543195506; cv=none; d=google.com; s=arc-20160816; b=KNzlrJ1jLOsTrvWcTYtD6E8t3P0+7TKtyMaRrwW3PUueSYDLoC8bqpcrnTZQ4+5Sfj 3kTYdaYe2/POhD6CTMQzgXE8AKpWdzwSl69UiNJMdC2kXDHcnm3iRPz5x6/9pcucb8ox iXDB5m+y5hafBDNd1CZes/GHYWGydF17oHk3lEBWE/AIe7KoqxOo1LbJC4G8IbrVpYTy L8emE28kB42DPslxxDH6mrQyfaxyO46TvSsfdNpaD4mItq7O1wKxVS3ZuenGIYYx+/OJ gsMlOsVg9qvrocUdCqzzgQfF5WizFLjlt3BPEAVCjd4E6xBTaCVoNjme3k/ZvipztlP9 ZkMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=aFhejUYLjH+GvCKmJrkeJqrqR0AdpXcrRqBn8iKIOtU=; b=tSUa3uCEWjcBUVr6NAYd/HXJOlOrw8q7OPvvchp7pIZZlXrj0T8gmVVzBDUbdchDQX LKNF1wXq2m8NQHYa9IdajbY2PcRP4oURdkx2y7Mm2oBH7SyhtpANpr9Y5oDFuI8ES8uq cQHXTT+4LT033w++sJsZDfym6doMe7abJ+kBe9HoTp7ywg0FeJ01v5X+86KDwiAlgAng Gg4vUZOqN2Ht6xV9bW6zLqxl5U6wXoeZXt1Hu/rJWHiHgZrQ7jf1gM+F+UwBgIKsC0OR CreHFc6/B9PZPrV+VH8heH+IQuk+KlHtIgn+7ScoXpPy3p1DUpf3Fc7wauidI/wFB90r 31gw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c132si49954638pga.597.2018.11.25.17.24.36; Sun, 25 Nov 2018 17:25:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726124AbeKZMQE (ORCPT + 99 others); Mon, 26 Nov 2018 07:16:04 -0500 Received: from 59-120-53-16.HINET-IP.hinet.net ([59.120.53.16]:11840 "EHLO ATCSQR.andestech.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726079AbeKZMQE (ORCPT ); Mon, 26 Nov 2018 07:16:04 -0500 Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) by ATCSQR.andestech.com with ESMTP id wAQ1M9h6037983; Mon, 26 Nov 2018 09:22:09 +0800 (GMT-8) (envelope-from vincentc@andestech.com) Received: from andestech.com (10.0.15.65) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.123.3; Mon, 26 Nov 2018 09:23:13 +0800 Date: Mon, 26 Nov 2018 09:23:10 +0800 From: Vincent Chen To: David Laight CC: "green.hu@gmail.com" , "arnd@arndb.de" , "linux-kernel@vger.kernel.org" , "Nick Chun-Ming Hu(?????????)" , Subject: Re: [PATCH v4 2/5] nds32: Support FP emulation Message-ID: <20181126012310.GA26621@andestech.com> References: <1542856478-795-1-git-send-email-vincentc@andestech.com> <1542856478-795-3-git-send-email-vincentc@andestech.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [10.0.15.65] X-DNSRBL: X-MAIL: ATCSQR.andestech.com wAQ1M9h6037983 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) >