From: Richard Henderson <rth@twiddle.net>
To: "Joseph S. Myers" <joseph@codesourcery.com>
Cc: libc-ports@sourceware.org
Subject: Re: Make ARM fesetenv (FE_NOMASK_ENV) detect failure (bug 14866)
Date: Wed, 21 Nov 2012 22:17:00 -0000 [thread overview]
Message-ID: <50AD52DA.402@twiddle.net> (raw)
In-Reply-To: <Pine.LNX.4.64.1211212204540.11924@digraph.polyomino.org.uk>
On 11/21/2012 02:08 PM, Joseph S. Myers wrote:
> On Wed, 21 Nov 2012, Richard Henderson wrote:
>
>> On 11/21/2012 12:28 PM, Joseph S. Myers wrote:
>>> + if (envp == FE_NOMASK_ENV)
>>> + {
>>> + /* VFPv3 and VFPv4 do not support trapping exceptions, so
>>> + test whether the relevant bits were set and fail if
>>> + not. */
>>> + _FPU_GETCW (temp);
>>> + if ((temp & _FPU_IEEE) != _FPU_IEEE)
>>> + return 1;
>>> + }
>>
>> Why test vs FE_NOMASK_ENV explicitly? In theory the exception value
>> could have come from just about anywhere.
>
> The fesetenv argument must either be one of the macros from fenv.h, or an
> environment previously obtained from one of the fenv.h functions in the
> same execution of the same program (and in the latter case, if these bits
> are set it means the processor supports them).
>
Yeah, but the fine point of "same execution same program" could easily be
missed. I was thinking of a distributed system containing a mix of VFPv2/v3
processors, in which fenv_t values were shared across nodes.
Not so very likely, but why not program more robustly? Especially if, as I
suspect, the more robust formulation actually results in fewer insns?
r~
prev parent reply other threads:[~2012-11-21 22:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-21 20:28 Joseph S. Myers
2012-11-21 21:57 ` Richard Henderson
2012-11-21 22:09 ` Joseph S. Myers
2012-11-21 22:17 ` Richard Henderson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50AD52DA.402@twiddle.net \
--to=rth@twiddle.net \
--cc=joseph@codesourcery.com \
--cc=libc-ports@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).