[PATCH] PPC fenv fixes. 3rd update

Steven Munroe munroesj@us.ibm.com
Thu Apr 5 22:00:00 GMT 2007


Richard Henderson wrote:
> On Wed, Mar 28, 2007 at 10:44:56AM -0500, Steven Munroe wrote:
>   
>>     performance penalty (but have no other visible effect).  */
>>  extern const fenv_t *__fe_nomask_env (void);
>>  # define FE_NOMASK_ENV	(__fe_nomask_env ())
>> +
>> +/* Floating-point environment with all exceptions disabled.  */
>> +extern const fenv_t *__fe_mask_env (void);
>> +# define FE_MASK_ENV	(__fe_mask_env ())
>>     
>
> This is incorrect.  The mere evaluation of FE_NOMASK_ENV/FE_MASK_ENV
> should have no effect at all.  This stuff should be delayed until
> the environment is actually installed.
>
> You should be using magic numbers, like in the i386 port.
>
>   
Upated the patch to define FE_NOMASK_ENV as FE_ENABLED_ENV and
FE_MASK_ENV as FE_DFL_ENV. On PPC we can't use magic numbers because
fesetenv takes (fenc_t *envp).

This change delays any change to the env until the application calls
fedisblxcpt(), feholdexcpt(), feholdexcept(), fesetenv(), or
feupdateenv(). Those functions will call __fe_mask_env() or
__fe_nomask_env() as appropriate.



-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ppc-fenv-20070405.txt
URL: <http://sourceware.org/pipermail/libc-hacker/attachments/20070405/64a70352/attachment.txt>


More information about the Libc-hacker mailing list