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 266463857C7A for ; Sat, 22 May 2021 01:34:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 266463857C7A 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 CDBA3340C23; Sat, 22 May 2021 01:34:09 +0000 (UTC) Date: Fri, 21 May 2021 21:34:08 -0400 From: Mike Frysinger To: Faraz Shahbazker Cc: gdb-patches@sourceware.org, "Maciej W . Rozycki" , Chao-ying Fu Subject: Re: [PATCH 3/5] sim: Add partial support for IEEE 754-2008 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-4-fshahbazker@wavecomp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210520074554.1465327-4-fshahbazker@wavecomp.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_NUMSUBJECT, 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:34:12 -0000 On 20 May 2021 13:15, Faraz Shahbazker wrote: just nits > --- a/sim/common/sim-fpu.c > +++ b/sim/common/sim-fpu.c > > +/* NaN handling specific to min/max operations. */ > + > +INLINE_SIM_FPU (int) > +sim_fpu_minmax_nan (sim_fpu *f, const sim_fpu *l, const sim_fpu *r) > +{ > + if (sim_fpu_is_snan (l) > + || sim_fpu_is_snan (r) > + || sim_fpu_is_ieee754_1985 ()) > + return sim_fpu_op_nan (f, l, r); > + else > + /* if sim_fpu_is_ieee754_2008() > + && ((sim_fpu_is_qnan (l) || sim_fpu_is_qnan (r))) */ i know it's a comment, but we want the correct style either way /* if (sim_fpu_is_ieee754_2008 () && (sim_fpu_is_qnan (l) || sim_fpu_is_qnan (r))) */ > + { > + /* In IEEE754-2008: > + * "minNum/maxNum is ... the canonicalized number if one > + * operand is a number and the other a quiet NaN." */ don't want the leading * in multiline comment blocks. two spaces before the trailing */. > + if (sim_fpu_is_qnan (l)) > + *f = *r; > + else if (sim_fpu_is_qnan (r)) > + *f = *l; should the else be a comment too ? > +INLINE_SIM_FPU (int) > +sim_fpu_is_un (const sim_fpu *l, > + const sim_fpu *r) > > +INLINE_SIM_FPU (int) > +sim_fpu_is_or (const sim_fpu *l, > + const sim_fpu *r) > > +INLINE_SIM_FPU (int) > +sim_fpu_un (int *is, > + const sim_fpu *l, > + const sim_fpu *r) bad indentation on these. you could just unwrap them. > +{ > + if (sim_fpu_is_nan (l) || sim_fpu_is_nan (r)) > + { > + *is = 1; > + return 0; > + } bad indentation > + /* Invert result */ period & two spaces at the end > + *is = (*is) ? 0 : 1; simpler ? *is = !*is; > +INLINE_SIM_FPU(int) > +sim_fpu_classify(const sim_fpu *f) space before the ( -mike