From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from elaine.keithp.com (home.keithp.com [63.227.221.253]) by sourceware.org (Postfix) with ESMTPS id 603DB388A414 for ; Tue, 27 Oct 2020 18:22:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 603DB388A414 Received: from localhost (localhost [127.0.0.1]) by elaine.keithp.com (Postfix) with ESMTP id 5BCFA3F2DD86; Tue, 27 Oct 2020 11:22:06 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at keithp.com Received: from elaine.keithp.com ([127.0.0.1]) by localhost (elaine.keithp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id oHh36lC5P-AD; Tue, 27 Oct 2020 11:22:06 -0700 (PDT) Received: from keithp.com (koto.keithp.com [10.0.0.2]) by elaine.keithp.com (Postfix) with ESMTPSA id 0613E3F2DD71; Tue, 27 Oct 2020 11:22:06 -0700 (PDT) Received: by keithp.com (Postfix, from userid 1000) id D80EC1582210; Tue, 27 Oct 2020 11:22:05 -0700 (PDT) From: "Keith Packard" To: Kito Cheng , newlib@sourceware.org Cc: Kito Cheng Subject: Re: [PATCH 2/2] RISC-V: Implment finite and fpclassify In-Reply-To: <20201027061958.83712-2-kito.cheng@sifive.com> References: <20201027061958.83712-1-kito.cheng@sifive.com> <20201027061958.83712-2-kito.cheng@sifive.com> Date: Tue, 27 Oct 2020 11:22:05 -0700 Message-ID: <87361zfs1e.fsf@keithp.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, 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: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2020 18:22:08 -0000 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Kito Cheng writes: > +#if defined(__riscv_flen) && __riscv_flen >=3D 64 > +#include "riscv_math.h" > +int finite(double x) > +{ > + long fclass =3D _fclass_d (x); > + return (fclass & FCLASS_INF) =3D=3D 0; > +} This also needs to check for FCLASS_NAN: return (class & (FCLASS_INF|FCLASS_NAN)) =3D=3D 0; Same for finitef =2D-=20 =2Dkeith --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEw4O3eCVWE9/bQJ2R2yIaaQAAABEFAl+YZU0ACgkQ2yIaaQAA ABEm5BAAsSDyG8Vbc6DXppzrqjP17jRjMEOpPy+apBeVTBm9fygOgHcKP2ZUxsWL Ie1EFIeJ/CbKXYSfl7BWFsiRmqRAMGzn/Thfol7tgfSnBFGhinBJ+dIsNyfhyNAe b4U0fF64YFI8D6f5ahRI0S7HHp1YguzoylK111TsVu7+X4Dy3FiALiZrBXxaWhjE xjUo9lxRSjcv6jJK6GrUgKUa48qR/Jd0vCJ4rndYoJAwo0seXdEJ3BCbzT5MJ7mc 7qCuoGBgkAiozekluviX4OGfU86BHu1wX5e6rcCW49FRjg0cZBdu6+FCrYTXNQMT h19jGgVM/tPS+7fvRAH81MjswftLAQK7nDvICYVXGQ8VHhA5PPdD7vA6y5SSHOg5 MJ5LitUzVVFQ3s9KcR19iGrUAyZnZ2m8CxKyXaPAN1NVbM9LbHaVe4pH9bTPjBN1 NKgEqstNos756xX0ynQX7UsAzKatsQVH0CaBC1Lbq51oscq+2saW8+ANAJu9XFtk MQ5E2ADqlIi6kZYWn3aGsiGqTye2of4eYpc80U4iIi3AGuFMIwlV8A3KMzAvo87B K1LCzHhAUWAsGFhnK/Ray2o1ZZoO1lw21ufgQqHdawGThZWSTiy9X1SJTkSvkNzt ewJrWLFmHRmMOV9TgOIc9R+7vmZwgNLh75a8tuVf3vI1MqFISQw= =Rt1H -----END PGP SIGNATURE----- --=-=-=--