Re: [PATCH 3/3] Add i386 and x86_64 fenv support from Cygwin.

Corinna Vinschen <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
On Aug 28 11:57, Joel Sherrill wrote:
> On Wed, Aug 28, 2019 at 10:41 AM Corinna Vinschen <[email protected]> wrote:
> > > +/*  The <fenv.h> header shall define the following constant, which
> > > +   represents the default floating-point environment (that is, the one
> > > +   installed at program startup) and has type pointer to const-qualified
> > > +   fenv_t. It can be used as an argument to the functions within the
> > > +   <fenv.h> header that manage the floating-point environment.  */
> > > +
> > > +extern const fenv_t *_fe_dfl_env;
> > > +#define FE_DFL_ENV (_fe_dfl_env)
> >
> > These can go away, right?  They are already defined in
> > newlib/libc/include/sys/fenv.h.
> 
> Each architecture overrides sys/fenv.h. There is no sharing of
> libc/include/sys/fenv.h
> with a functional implementation.

Miscomprehension on my side, sorry.

> > > +/*  Returns the currently selected precision, represented by one of the
> > > +   values of the defined precision macros.  */
> > > +int
> > > +fegetprec (void)
> > > +{
> > > [...]
> > > +int
> > > +fesetprec (int prec)
> > > +{
> > > [...]
> > > +#endif
> >
> > Uh oh.  What about _feinitialise()?  Cygwin calls this function
> > right from the initial code, but is it really the right thing
> > to enforce this for all i386/x86_64 targets?
> >
> > Any idea how we can generate the default environment on the fly
> > while maintaining backward compat on Cygwin?
> 
> Cygwin, libgloss, and RTEMS could call this I suppose. But each OS would have
> to do their own thing.
> 
> Should be really be called from the beginning of each thread? Otherwise,
> things are inconsistent.

What about initializing on the fly at the start of each affected function?
If we find a nice way to do that I'd also push that chage into Cygwin.
There's no obvious reason that we actually *have* to initalize the
fp environment in each process.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAl1nhrwACgkQ9TYGna5E
T6Ah9A/8CrPLWujQFxY8P3xFrLxDQ3SfS7jG3lacZRqROq+/TPVyg+FQa0IFu2OM
wASkyLcbxofGFHBpGqeHEb3QhxLvFHgRbgrPVJ+XzlwafA4/VZKdipc0ks2+YTgf
k2WJU0tXgg8q99iQ8WGqIBQ/28X0vShBropfbmkKD2cwqcALVjmA/sjuWbvEhG8f
ccFBZIjxdC7ledcHyYOCnOeiosLtSbjrvZY/ZK/SPI7i2g6aFayI1Vlymy3dqKNT
nAV4ELwNY35R/v831Sz93nBwYk0KIH9/g+UhnKjXLcEPydIlptR/j5S3kPuiNjat
1IaYFY25XTGFYcNlFBf4ixkCHYmfyxeWxnP9m8y8zxda5MiZiWk+UZMxxF86e1Rz
5oQVpxDf7MDkJ4M6jqSo+v/BeYh0A9tT4hdJqGRi7tU1zoKLRQzPe3eXbDJaYEwT
oNFISP/M7yj/Z5Cyq2sI6p1uGDJGKqerZTtgSYT6bfVwQqN3bczw8uZw/CxMDRa+
Q5a4G0t1vTNUkFTTpvdf3QPiSuVGOSpzkZjJswupiFRaJfcexileqhN+KEbB4glQ
/XauGnzT5JeIRV1ARUwSH0nZ3HVfTjHys7Gqw+Pb5BWod8tLmjN8qAYuzFbwChtN
o8S08Pn6+Shhv7EA1834/WTZ7YPxL26QGe7MKFJKyHF78hbPlEg=
=3mLb
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.