From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 2F1883858039 for ; Wed, 2 Feb 2022 03:47:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2F1883858039 Received: by smtp.gentoo.org (Postfix, from userid 559) id 14EB73431DA; Wed, 2 Feb 2022 03:47:24 +0000 (UTC) Date: Tue, 1 Feb 2022 22:47:23 -0500 From: Mike Frysinger To: Dragan Mladjenovic Cc: gdb-patches@sourceware.org, "Maciej W . Rozycki" , Chao-ying Fu , Faraz Shahbazker Subject: Re: [PATCH v4 4/4] sim: mips: Add simulator support for mips32r6/mips64r6 Message-ID: Mail-Followup-To: Dragan Mladjenovic , gdb-patches@sourceware.org, "Maciej W . Rozycki" , Chao-ying Fu , Faraz Shahbazker References: <20220201125302.30137-1-Dragan.Mladjenovic@syrmia.com> <20220201125302.30137-5-Dragan.Mladjenovic@syrmia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="v72bJShFsPM3V24X" Content-Disposition: inline In-Reply-To: <20220201125302.30137-5-Dragan.Mladjenovic@syrmia.com> X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_NUMSUBJECT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Wed, 02 Feb 2022 03:47:27 -0000 --v72bJShFsPM3V24X Content-Type: text/plain; charset=utf-8 Content-Disposition: inline On 01 Feb 2022 13:53, Dragan Mladjenovic wrote: > +static void update_fcsr (sim_cpu *, address_word , sim_fpu_status); no space before the , > +static const int sim_fpu_class_mips_mapping[] = { > + FP_R6CLASS_SNAN, /* SIM_FPU_IS_SNAN = 1, Noisy not-a-number */ > + FP_R6CLASS_QNAN, /* SIM_FPU_IS_QNAN = 2, Quiet not-a-number */ > + FP_R6CLASS_NEGINF, /* SIM_FPU_IS_NINF = 3, -infinity */ > + FP_R6CLASS_POSINF, /* SIM_FPU_IS_PINF = 4, +infinity */ > + FP_R6CLASS_NEGNORM, /* SIM_FPU_IS_NNUMBER = 5, -num - [-MAX .. -MIN] */ > + FP_R6CLASS_POSNORM, /* SIM_FPU_IS_PNUMBER = 6, +num - [+MIN .. +MAX] */ > + FP_R6CLASS_NEGSUB, /* SIM_FPU_IS_NDENORM = 7, -denorm - (MIN .. 0) */ > + FP_R6CLASS_POSSUB, /* SIM_FPU_IS_PDENORM = 8, +denorm - (0 .. MIN) */ > + FP_R6CLASS_NEGZERO, /* SIM_FPU_IS_NZERO = 9, -0 */ > + FP_R6CLASS_POSZERO /* SIM_FPU_IS_PZERO = 10, +0 */ > +}; 2 space indent, not tab > +uint64_t > +fp_classify (sim_cpu *cpu, > + address_word cia, > + uint64_t op, > + FP_formats fmt) > +{ > + sim_fpu wop; > + > + /* The format type has already been checked: */ > + switch (fmt) > + { > + case fmt_single: > + sim_fpu_32to (&wop, op); > + break; > + case fmt_double: > + sim_fpu_64to (&wop, op); > + break; > + default: > + sim_io_error (SD, "Bad switch\n"); > + } i don't understand what the comment is trying to say > +/* Common FMAC code for .s, .d. Defers setting FCSR to caller. */ 2 spaces after . at end of sentences > +static sim_fpu_status > +inner_fmac (int (*sim_fpu_op) (sim_fpu *, const sim_fpu *, const sim_fpu *), > + uint64_t op1, > + uint64_t op2, > + uint64_t op3, > + sim_fpu_round round, > + sim_fpu_denorm denorm, > + FP_formats fmt, > + uint64_t *result) > +{ > ... > + default: > + fprintf (stderr, "Bad switch\n"); > abort (); > + break; > + } > + > + *result = t64; > + return status; > +} > + > +static uint64_t > +fp_fmac (sim_cpu *cpu, > + address_word cia, > + int (*sim_fpu_op) (sim_fpu *, const sim_fpu *, const sim_fpu *), > + uint64_t op1, > + uint64_t op2, > + uint64_t op3, > + FP_formats fmt) > +{ > ... > + switch (fmt) > + { > + case fmt_single: > + case fmt_double: > + status = inner_fmac (sim_fpu_op, op1, op2, op3, round, > + denorm, fmt, &result); pass |cpu| to inner_mac so it can use sim_io_error -mike --v72bJShFsPM3V24X Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEuQK1JxMl+JKsJRrUQWM7n+g39YEFAmH5/soACgkQQWM7n+g3 9YEGlQ//Qrq6AFJ1cfoIYioVWHa7nIpnVjh7HXS7qiEZccloh0cP5tL0lwnCpWwL g23xCBshsyv+SJWdLVDw5jAw0wsTWglAHOvYEUVNHI4hVvvwBIEFoS0j4eOcTSws md/tT+zTskLk/f68J4FMk2YzdJOqw3VAlPhqqtdqCgG7F2sjIfqSLgfluCvyBsA2 hXBV1P4BsK78r5/GcYu/frr581DqpocveL3qRuWL9HJ5V0M8BU+8ylOPMG6ywprP KZV0E2/s3jPQbS9kayNLKjuQ6aEq7J2cvJoZvYhwRaWzAOMPN5xo4cmNVf70DLDD mCMYn4QqMOwgUTmcsY8BgMcYF1nvTkQYgr5N/d1XUBEhoqE1TK41hy/7cvE0Q8c5 eulOnfON8pUJRY5yBu9+cCCRVfBakgoNxaMa3CSRRtjd+jNWVfjOwSHyTxCCLjwu TjuEeU9twKx7im+vEB/ypsHjwfitlg4QL9Hh0DAWIjOzDZJOoixbJak+vi/eRV+y 6SXKOvqtDWeTlHecCqlrkTjpNQpurDIupQHuNgqCSPzT4sTCoKsnqu1tN+13QWs9 KnzyoQxN5hOIjVpU49wvQIHhguObkYN3EQOwW+ZZL9aGaqqpEh6yXSlrl19tA3dP tnL6TkHTpZ9WZXqGTdiiqiiYyM+rEllu49WX8hpdWf1UWT5NVQE= =d/yR -----END PGP SIGNATURE----- --v72bJShFsPM3V24X--