This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Make ARM fesetenv (FE_NOMASK_ENV) detect failure (bug 14866)


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.

This would seem to do the same thing with fewer assumptions:

  if (temp & _FPU_IEEE)
    {
      unsigned temp2;
      _FPU_GETCW (temp2);
      if (temp != temp2)
        return 1;
    }


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]