Hi Bruno,

Bruno Haible <[email protected]> writes:

> Collin Funk wrote:
>> But, I think most of my issues came from trying to implement 'fegetenv'
>> and 'fesetenv'.
>
> Well, you started with the wrong module. Because the module
> 'fenv-environment' depends on 'fenv-exceptions-tracking-c99'
> and 'fenv-exceptions-trapping', you need to have these two working
> before you can tackle the module 'fenv-environment'. So, it's
> best to work bottom-up:
>   1. fenv-h
>   2. fenv-rounding
>   3. fenv-exceptions-tracking-c99, fenv-exceptions-tracking-c23.
>   4. fenv-exceptions-trapping
>   5. fenv-exceptions-state-c99, fenv-exceptions-state-c23.
>   6. fenv-environment

Makes sense. I just created a testdir of
'gnulib-tool --list | grep fenv' so my testing was not very organized.

>> -# if defined _MSC_VER
>> +# if defined _MSC_VER || (defined __MINGW32__ && FE_INVALID != 0x01)
>>  /* The MSVC header files have different values for the floating-point 
>> exceptions
>>     than all the other platforms.  Define some handy macros for conversion.  
>> */
>>  #  define exceptions_to_x86hardware(exceptions) \
>
> That was a step in the right direction.

Cool, glad something from my testing was useful.

I remember having something similar for fenv-except-*.c. For the most
part just moving the 'exceptions_to_x86hardware (...)' out of the
'#if defined _MSC_VER'.

> I've completed the port and found that the following configuration variables
> need to be set in order to work around mingw 13 bugs:
>   gl_cv_func_fesetexceptflag_works1="guessing no"
>   gl_cv_func_fesetenv_works="guessing no"
>   gl_cv_func_feholdexcept_works="guessing no"
>   gl_cv_func_feeupdateenv_works="guessing no"
>
>
> In summary, the mingw approach that considers both the 387 unit and the
> SSE floating-point unit basically works. But, as usual with mingw, it
> comes with bugs:
>   - The older mingw bugs in this area are still present.
>   - They added two new bugs.

Thanks! I'll have a look at your changes to fenv-env.c and the Intel
manual again to hopefully improve my understanding of floating point.

Collin

Reply via email to