From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 09A653857C7B for ; Sat, 22 May 2021 01:16:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 09A653857C7B 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 40E9D340C19; Sat, 22 May 2021 01:16:36 +0000 (UTC) Date: Fri, 21 May 2021 21:16:35 -0400 From: Mike Frysinger To: Faraz Shahbazker Cc: gdb-patches@sourceware.org, "Maciej W . Rozycki" , Chao-ying Fu Subject: Re: [PATCH 1/5] sim: Allow toggling of quiet NaN-bit semantics 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-2-fshahbazker@wavecomp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210520074554.1465327-2-fshahbazker@wavecomp.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no 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: Sat, 22 May 2021 01:16:39 -0000 On 20 May 2021 13:15, Faraz Shahbazker wrote: > IEEE754-1985 specifies the top bit of the mantissa as an indicator > of signalling vs. quiet NaN, but does not define the precise semantics. > Most architectures treat this bit as indicating quiet NaN, but legacy > (pre-R6) MIPS goes the other way and treats it as signalling NaN. > > This used to be controlled by a macro that was only defined for MIPS. > This patch replaces the macro with a variable to track the current > semantics of the NaN bit and allows differentiation between older > (pre-R6) and and newer MIPS cores. looks good ... minor style nits > --- a/sim/common/sim-fpu.c > +++ b/sim/common/sim-fpu.c > > +/* IEEE 754-1985 specifies the top bit of the mantissa as an indicator > + of signalling vs. quiet NaN, but does not specify the semantics. > + Most architectures treat this bit as quiet NaN, but legacy (pre-R6) > + MIPS goes the other way and treats it as signalling. This variable > + tracks the current semantics of the NaN bit and allows differentiation > + between pre-R6 and R6 MIPS cores. */ > +int sim_fpu_quiet_nan_inverted = 0; we're C11 now, so we can assume stdbool.h. so switch to bool/true/false. > --- a/sim/common/sim-fpu.h > +++ b/sim/common/sim-fpu.h > > +/* Toggle quiet NaN semantics. */ > > +extern int sim_fpu_quiet_nan_inverted; omit the blank line between the two lines -mike