From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 7gM3JpZfqGDVCwAAWB0awg (envelope-from ) for ; Fri, 21 May 2021 21:34:14 -0400 Received: by simark.ca (Postfix, from userid 112) id 8E5381F11C; Fri, 21 May 2021 21:34:14 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.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 A3BAF1E813 for ; Fri, 21 May 2021 21:34:13 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EEABD3857C7A; Sat, 22 May 2021 01:34:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EEABD3857C7A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1621647253; bh=gtqZo/w+BgDRZEx30njMq8qIVAGV/AKNVENCr/B7qh8=; 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=cPt9ifF1u/EWurhilHE1988lWeAM6AwITLIx7yc/3Rs6jBTof1MkrY6T0hg+s/2ds rns/k4J+Qn+6HjVt9CvnNJ50qzsnnJCqF1IXwcKXWBeDT7mupm5QgsTLRnKJcDgxWV Dnp2RX8YnOVonXlOIvdKyQuEb9ThDmJfw/SQ2TUw= 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 To: Faraz Shahbazker 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-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 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