Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5571424imu; Mon, 26 Nov 2018 02:18:59 -0800 (PST) X-Google-Smtp-Source: AFSGD/XHJPSwE4uxU6oq7LfXlNaUoYKhazd4N3UBZgji9zrRbNTSYCFE0BjWQpWJ4zmLeDrPLVqR X-Received: by 2002:a63:e4d:: with SMTP id 13mr22553304pgo.369.1543227539919; Mon, 26 Nov 2018 02:18:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543227539; cv=none; d=google.com; s=arc-20160816; b=Tdi6iCBCTJGymOGJ8xA29ca5sBAKbEgTm9lnXfXiGSYkCIPHolHCDa4A5SAjqYKV2y A64ATHhRj7qkz0ynkbFvr2aROlP6NwmsHUf2WtUpHuUJf9V+aKc90+Vo/NZJ0RMY1m7E OQnR48KC/z/sCu7ct5CclXfv5q0r1Uddajezt6zzoJ6xy7728A6HMwKmuLLUV3Khr2UI gHROMfZbs2OcV+fxQ3ZgP7vMTdmv0lS1wJsA1McXHc/gGPu2cKJ6BvR0nfY+MemGX5gs ChKdQFMqW32a2bw9Y9Pw0c8/4ip5wNx52iiQFN3uDwcz4kbFM5XtJe4OBKrWAMKCnzCK OzqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=KyClqdSdCYiyaqZ2oaD7R41tvZSwvGJmf7Qq59lqpuU=; b=Cp2TfhdmdvKHa/IHzI8DZVD8tMtmjYKc0AJ4upcyUxs1crXiOvV1pUlulLMZeqmDQ0 nIpwgvnoj2vcTDiSg+tYqLBGJlYc3Jw9gISG4wdSw7MUurg/OhHGQVTKLNwwjj59bzTs jrMWscL69/nTlmh/858zzNCp/UVUuFOMTPyj9uezUZ13FEYgD33VphoxiWLb1s41BZjv zwuVImR143nX/BU7QxVBDkim7hvLhAJ/973sR2ZSzZrhFshvGGrrXr66vm70OTnNIRAk U9X9o20R8cq7GWolwR2x0KUC9608Tnmqh3Dne0shJxhgDQoaEbOzr19L2HYAA6g9qFZ+ RacQ== 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 l9si44770091pgj.543.2018.11.26.02.18.42; Mon, 26 Nov 2018 02:18:59 -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 S1726491AbeKZVLf convert rfc822-to-8bit (ORCPT + 99 others); Mon, 26 Nov 2018 16:11:35 -0500 Received: from eu-smtp-delivery-151.mimecast.com ([146.101.78.151]:27797 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726203AbeKZVLe (ORCPT ); Mon, 26 Nov 2018 16:11:34 -0500 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-175-kIAkIFYwObWRNAG--sWTnA-1; Mon, 26 Nov 2018 10:17:53 +0000 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b::d117) by AcuMS.aculab.com (fd9f:af1c:a25b::d117) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 26 Nov 2018 10:18:01 +0000 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Mon, 26 Nov 2018 10:18:01 +0000 From: David Laight To: 'Vincent Chen' 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 Thread-Topic: [PATCH v4 2/5] nds32: Support FP emulation Thread-Index: AQHUghG4/qfbmySOskGwd6CmLmV7sqVdK4IggAQdiQCAAJRa0A== Date: Mon, 26 Nov 2018 10:18:01 +0000 Message-ID: <3dcd9764570e4565911b74b08513e2d3@AcuMS.aculab.com> References: <1542856478-795-1-git-send-email-vincentc@andestech.com> <1542856478-795-3-git-send-email-vincentc@andestech.com> <20181126012310.GA26621@andestech.com> In-Reply-To: <20181126012310.GA26621@andestech.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-MC-Unique: kIAkIFYwObWRNAG--sWTnA-1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. It ought to be possibly for the exception routine to rescale the values, re-issue the same FP instruction, then scale the result. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)