Re: [PATCH] libm fixes for 16-bit targets
Corinna Vinschen <[email protected]>
| Newsgroups | gmane.comp.lib.newlib |
|---|---|
| Message-ID | <[email protected]> |
On Aug 31 23:30, [email protected] wrote: > Hi, > > Attached are a couple of patches to libm to fix warnings when compiling for > 16-bit targets. > > The first in e_scalb.c calls scalbln instead of scalbn, as 65000 is out of > range for an 'int'. > > +#if INT_MAX == 32767 > + if ( fn > 65000.0) return scalbln(x, 65000); > + if (-fn > 65000.0) return scalbln(x,-65000); > +#else > if ( fn > 65000.0) return scalbn(x, 65000); > if (-fn > 65000.0) return scalbn(x,-65000); > +#endif > > The second in math_config.h (issignalingf_inline) fixes the signed overflow > warning that occurs. > > - return 2 * (ix ^ 0x00400000) > 2u * 0x7fc00000; > + return 2 * (ix ^ 0x00400000) > 0xFF800000u; > > Although I hope I'm not missing something subtle with the mixing of the > types there. > > Cheers, > Jon > Pushed. Thanks, Corinna -- Corinna Vinschen Cygwin Maintainer Red Hat
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAluM5gwACgkQ9TYGna5E T6BXpxAAoNAe2vgZVSnTNWpYvGaPYE0RAk8Y0lobsIq0Ei1LIQFkbbJK+0/MZbcJ UdZih5cFn1rmsM0QFF1iuvJYXMdp7Zz61u811fYzaAqfqK37NSbcekZYSoQr7rKn TpJyrYx5NTiQEJC640k59dN5FDiHZFOx7byiR+V6r9mChPHWlh+Eakrbu+ASLpO2 GzxSlAjq88gmGdC6pZ0l/DWY3Vju+Rzt335aR6PJFM0NhdxYi3oQ+fbudg8OMrsL SKKg2w6RO+puTY9swgbaGqYPB4K5deo89KphgeCSlLxEm9VdEBPn8QtH3O6ZbV6a SnrEYIcyhT+GwYA3COfhdQPgnihDHiCcpoM5n2fXExmGpPGIV66NaxxM/dtQrpJ7 kQQMSkk5qmRnNKAWy8kGmfQR/Tv09ewChgmeUdtPSeKsiHE0AVnViNE7ZUZKTFS2 x5q3MyjDs/QcDXav9BLfY1WGfgyF6La3qLYWbqgbXdXmLQo6ckmhTHZkJP3XCLGL Erehah4dRpZtxZVJaxXyK42WkAwwuu//pV30sKz4xRCfWZ9qjMSmhTwnvcMJYBv9 4ASJTqSogpoUBcnz9DimUPuobI5OZjcnrjWuT6OZBLTPtnIZnqkmK6JddhxLFPdj TyDnuaP+94CmT/za++kX71BRUgRhEX3MBXo7LQA1RvV9bShAZ5g= =jGzO -----END PGP SIGNATURE-----