From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 From: Mike Frysinger To: Faraz Shahbazker Cc: gdb-patches@sourceware.org, "Maciej W . Rozycki" , Chao-ying Fu 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-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Mon, 24 May 2021 01:26:03 -0000 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