From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 0duaKq0Aq2APRAAAWB0awg (envelope-from ) for ; Sun, 23 May 2021 21:26:05 -0400 Received: by simark.ca (Postfix, from userid 112) id 9F5FD1F11C; Sun, 23 May 2021 21:26:05 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 0A1201E01F for ; Sun, 23 May 2021 21:26:05 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AF7713857405; Mon, 24 May 2021 01:26:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AF7713857405 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1621819564; bh=2F1nX59aEXZo2G3PAK057iicwWZ7c4iG6YdVuarkZOI=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=RZ7QnNq3jvvigLZmZelEEuXGXy5tqLPMQunP2F4RHh6PXoIIILHjICTj05Q5eZ7Ds VczOEl402gypVifFlBZApxmzVrdaNhOnjunW1Zi3GcxMOJYBKP8hLS55UepVG44KWf SRXyim7ftyA4v/hChVLsMx2RGaDMQr2INkyV4juY= Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 0F96C385481D for ; Mon, 24 May 2021 01:26:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0F96C385481D Received: from vapier (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 14584340B9E; Mon, 24 May 2021 01:26:00 +0000 (UTC) Date: Sun, 23 May 2021 21:26:00 -0400 To: Faraz Shahbazker Subject: Re: [EXTERNAL]Re: [PATCH 2/5] sim: Factor out NaN handling in floating point operations Message-ID: Mail-Followup-To: Faraz Shahbazker , gdb-patches@sourceware.org, "Maciej W . Rozycki" , Chao-ying Fu References: <20210520074554.1465327-1-fshahbazker@wavecomp.com> <20210520074554.1465327-3-fshahbazker@wavecomp.com> <7c9257fe-d83c-17ed-7de7-e47a3f3f1998@wavecomp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <7c9257fe-d83c-17ed-7de7-e47a3f3f1998@wavecomp.com> X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mike Frysinger via Gdb-patches Reply-To: Mike Frysinger Cc: Chao-ying Fu , gdb-patches@sourceware.org, "Maciej W . Rozycki" Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 23 May 2021 12:02, Faraz Shahbazker wrote: > On 5/22/21 6:55 AM, Mike Frysinger wrote: > > so some of the logic you replaced below do: > > if (sim_fpu_is_qnan (l)) > > { > > *f = *l; > > return 0; > > } > > if (sim_fpu_is_qnan (r)) > > { > > *f = *r; > > return 0; > > } > > > > but others do: > > if (sim_fpu_is_qnan (l)) > > { > > *f = *l; > > f->class = sim_fpu_class_qnan; > > return 0; > > } > > if (sim_fpu_is_qnan (r)) > > { > > *f = *r; > > f->class = sim_fpu_class_qnan; > > return 0; > > } > > > > it seems like we should have been consistently doing the latter ? > > Isn't the extra assignment redundant? If sim_fpu_is_qnan(l), then > l->class == sim_fpu_class_qnan, and so *f = *l is sufficient. > > Only sNaN-handling needs the extra assignment because it has to be > downgraded to qNaN. gotcha, sounds good. so the old code that was assigning the class didn't need to, and you're cleaning that up. -mike