From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 531A2C47082 for ; Wed, 26 May 2021 19:06:20 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D5052610A5 for ; Wed, 26 May 2021 19:06:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D5052610A5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=tachyum.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:50870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llyrC-0001BC-Us for qemu-devel@archiver.kernel.org; Wed, 26 May 2021 15:06:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50714) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llxTU-0004f0-Hz for qemu-devel@nongnu.org; Wed, 26 May 2021 13:37:44 -0400 Received: from mx1.tachyum.com ([66.160.133.170]:5264) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llxTN-00041Q-RZ for qemu-devel@nongnu.org; Wed, 26 May 2021 13:37:40 -0400 Received: by mx1.tachyum.com (Postfix, from userid 1000) id 02F141005691; Wed, 26 May 2021 10:37:34 -0700 (PDT) Received: from THQ-EX1.tachyum.com (unknown [10.7.1.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.tachyum.com (Postfix) with ESMTPS id 762BF1005283 for ; Wed, 26 May 2021 10:37:34 -0700 (PDT) Received: from THQ-EX3.tachyum.com (10.7.1.26) by THQ-EX1.tachyum.com (10.7.1.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Wed, 26 May 2021 10:37:34 -0700 Received: from THQ-EX1.tachyum.com (10.7.1.6) by THQ-EX3.tachyum.com (10.7.1.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Wed, 26 May 2021 10:37:33 -0700 Received: from THQ-EX1.tachyum.com ([10.7.1.6]) by THQ-EX1.tachyum.com ([10.7.1.6]) with mapi id 15.01.2176.014; Wed, 26 May 2021 10:37:33 -0700 From: Michael Morrell To: "qemu-devel@nongnu.org" Subject: Denormal input handling Thread-Topic: Denormal input handling Thread-Index: AddSVLVuQ70cTMk8SjeoZZpZvpdwcw== Date: Wed, 26 May 2021 17:37:33 +0000 Message-ID: <30eafc8be31446f9aecbc40f487467e1@tachyum.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.7.252.4] Content-Type: multipart/alternative; boundary="_000_30eafc8be31446f9aecbc40f487467e1tachyumcom_" MIME-Version: 1.0 Received-SPF: pass client-ip=66.160.133.170; envelope-from=mmorrell@tachyum.com; helo=mx1.tachyum.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 26 May 2021 15:02:53 -0400 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --_000_30eafc8be31446f9aecbc40f487467e1tachyumcom_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I see support in QEMU for architectures which have a denormal input flag bi= t and those that have a "flush inputs to zero" control bit, but the impleme= ntation is not specializable and seems wrong for x86 at least. For example, in sf_canonicalize, if the input is denormal and "flush_inputs= _to_zero" is true, the "input denormal" flag is set and then the value is s= et to a zero value, and if the input is denormal and "flush_inputs_to_zero"= is false, then the input is simply normalized. I think the behavior should be for denormal inputs that if "flush_inputs_to= _zero" is true, then the value is set to zero; and if "flush_inputs_to_zero= " is false, set the "input denormal" flag and normalize the input. This matches what x86 does (I'm not sure about other architectures). Am I missing something? If not, I can work on a patch (there are several p= laces which check "flush_inputs_to_zero" which will need to be changed). Michael --_000_30eafc8be31446f9aecbc40f487467e1tachyumcom_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I see support in QEMU for architectures which have a= denormal input flag bit and those that have a "flush inputs to zero&q= uot; control bit, but the implementation is not specializable and seems wro= ng for x86 at least.

 

For example, in sf_canonicalize, if the input is den= ormal and "flush_inputs_to_zero" is true, the "input denorma= l" flag is set and then the value is set to a zero value, and if the i= nput is denormal and "flush_inputs_to_zero" is false, then the input is simply normalized.

 

I think the behavior should be for denormal inputs t= hat if "flush_inputs_to_zero" is true, then the value is set to z= ero; and if "flush_inputs_to_zero" is false, set the "input = denormal" flag and normalize the input.

 

This matches what x86 does (I'm not sure about other= architectures).

 

Am I missing something?  If not, I can work on = a patch (there are several places which check "flush_inputs_to_zero&qu= ot; which will need to be changed).

  Michael

--_000_30eafc8be31446f9aecbc40f487467e1tachyumcom_--