Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp166803imu; Mon, 26 Nov 2018 18:54:08 -0800 (PST) X-Google-Smtp-Source: AFSGD/WvNTJaiKC+KeHSPAKzeeBHwjDF29PKjoz5YB7DROSZHp7vBMwMoFs94vxIFianQSbCHSoK X-Received: by 2002:a63:3e05:: with SMTP id l5mr25736555pga.96.1543287248590; Mon, 26 Nov 2018 18:54:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543287248; cv=none; d=google.com; s=arc-20160816; b=vdf79w1loz34B0P71IpQ1SIOVj+j/QxvF11kd3PqKqsj59hOTzcEpFxOiOJOHJyDP2 GcpGmQsn9tyC+1pdZMg/lJyARMqRdrobRwMzDA1XxalG0P9V7MQjq26sxdRdlyI8ygSr DpOvt9IPDyljJVs7KdKwcEWEYObm92PrB+D0KEgfNyUGqRPdYG3q/I29TpdNHf1/MYs1 M+uFjal66loU66bw1pdyUh0r7BbubkmkcksthfbPsJUvrKVm/Jmai2DijSWiu+pm7ZZF X8YTRkB3QtMdjqXuiiM5t38EYveIpw2vicm+nhPQNl1u/EQn5s4z9ru7y24lhwOQNY8I CjVw== 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=rnS6cy+jzVxdH0FchTmsPbWGSjDzNR0vPsH5MlH27pQ=; b=Rf/vhSrUrxAz/OXcY3NNDawPq+lDQSaKH/TBvLNvsJW0mZEb3EyKoZNiDOBnrbMgDN 2cFK6sEE7ZsyhvT4mD7c3ECyO7JbHa2OwJtWeVGlYqvX+2NHYBAQ0C5W3mVCvZmbZ3CD lpve42SZIBQjNNgjYB4iZ+kuCHUX0XfptM6pGboH1wSkQKlY+d11+NFA8pFQwPRJSDte lDLHvlW9S6T50Z9VHp7s1h9uz9ADsMZKfNExf27F/f16GNkt3c0RUYlC6KPog1VxGdSN jOiH6GkeKvwACQ1uvNHbQfGnIAFCOK67d99xGbmUsplbUVqpn//8yu/CgGlEBIM6ITwL 07UA== 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 23si2585504pfz.20.2018.11.26.18.53.53; Mon, 26 Nov 2018 18:54:08 -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 S1728346AbeK0NnV (ORCPT + 99 others); Tue, 27 Nov 2018 08:43:21 -0500 Received: from 59-120-53-16.HINET-IP.hinet.net ([59.120.53.16]:13852 "EHLO ATCSQR.andestech.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727621AbeK0NnV (ORCPT ); Tue, 27 Nov 2018 08:43:21 -0500 Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) by ATCSQR.andestech.com with ESMTP id wAR2jTVY024938; Tue, 27 Nov 2018 10:45:29 +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; Tue, 27 Nov 2018 10:46:41 +0800 Date: Tue, 27 Nov 2018 10:46:38 +0800 From: Vincent Chen To: David Laight CC: "green.hu@gmail.com" , "arnd@arndb.de" , "linux-kernel@vger.kernel.org" , "Nick Chun-Ming Hu(?????????)" , "deanbo422@gmail.com" Subject: Re: [PATCH v4 2/5] nds32: Support FP emulation Message-ID: <20181127024638.GA6633@andestech.com> References: <1542856478-795-1-git-send-email-vincentc@andestech.com> <1542856478-795-3-git-send-email-vincentc@andestech.com> <20181126012310.GA26621@andestech.com> <3dcd9764570e4565911b74b08513e2d3@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <3dcd9764570e4565911b74b08513e2d3@AcuMS.aculab.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [10.0.15.65] X-DNSRBL: X-MAIL: ATCSQR.andestech.com wAR2jTVY024938 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) >