From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27860 invoked by alias); 21 Nov 2012 22:17:06 -0000 Received: (qmail 27850 invoked by uid 22791); 21 Nov 2012 22:17:04 -0000 X-SWARE-Spam-Status: No, hits=-5.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-ia0-f169.google.com (HELO mail-ia0-f169.google.com) (209.85.210.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 21 Nov 2012 22:17:00 +0000 Received: by mail-ia0-f169.google.com with SMTP id r4so6545531iaj.0 for ; Wed, 21 Nov 2012 14:17:00 -0800 (PST) Received: by 10.50.188.167 with SMTP id gb7mr979385igc.66.1353536220208; Wed, 21 Nov 2012 14:17:00 -0800 (PST) Received: from anchor.twiddle.home (50-194-63-110-static.hfc.comcastbusiness.net. [50.194.63.110]) by mx.google.com with ESMTPS id c3sm877153igj.1.2012.11.21.14.16.59 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 14:16:59 -0800 (PST) Message-ID: <50AD52DA.402@twiddle.net> Date: Wed, 21 Nov 2012 22:17:00 -0000 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121029 Thunderbird/16.0.2 MIME-Version: 1.0 To: "Joseph S. Myers" CC: libc-ports@sourceware.org Subject: Re: Make ARM fesetenv (FE_NOMASK_ENV) detect failure (bug 14866) References: <50AD4E38.4010301@twiddle.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org X-SW-Source: 2012-11/txt/msg00105.txt.bz2 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~