fegetexceptflag() question for ppc

Ulrich Drepper drepper@redhat.com
Thu Dec 4 06:36:00 GMT 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Geoff Keating wrote:

> On powerpc, the representation is defined to be in the format of the
> FP environment register with bits other than those specified by
> 'excepts' having undefined values.

Exactly.  Indicated by flags, and nothing else.


> and these are the only routines that interpret a fexcept_t.  So
> there's no way a conforming program can tell that fegetexceptflag is
> returning more information than requested.

Of course there is.

If one exception is requested with fegetexceptflag and then fesetexcept
restores a more general set using fesetexceptflag, only the one
exception which fegetexceptflag returned must be set and testable via
fetestexcept after the fesetexceptflag call.


  fegetexceptflag (&ex, FE_INVALID);
  fesetexceptflag (&ex, FE_ALL_EXCEPT);
  r = fetestexcept (FE_DIVBYZERO);

r must always be zero afterwards.  This is what the other archs do and
ppc must follow.

- -- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/ztWh2ijCOnn/RHQRArPcAJ0eOQX8Nyt/GcsLpxXmklKIduwE2gCgou/W
Fk30B12Am7FONNiK7KRklJ8=
=WllT
-----END PGP SIGNATURE-----



More information about the Libc-alpha mailing list