在 2019/2/25 22:41, Liu Hao 写道:
> 在 2019/2/25 19:27, Zidane Sama 写道:
>> After this commit:
>>
>> [e98d80] (2.0 kB) by  Kai Tietz
>> Add a fix for working fesetenv in libquadmath-library
>>
>> fesetenv was broken and do not sets new fpu state because it's now
>> overwrites new env state by fnstenv.
>>
>> And this patch must fix it by store only mxcsr and load its afterwards:
>>
>> diff --git a/mingw-w64-crt/misc/fesetenv.c b/mingw-w64-crt/misc/fesetenv.c
>> index f998017b..07035c66 100644
>> --- a/mingw-w64-crt/misc/fesetenv.c
>> +++ b/mingw-w64-crt/misc/fesetenv.c
>> @@ -66,8 +66,7 @@ int fesetenv (const fenv_t * envp)
>>      {
>>        fenv_t env = *envp;
>>        int _mxcsr;
>> -      __asm__ ("fnstenv %0\n"
>> -           "stmxcsr %1" : "=m" (*&env), "=m" (*&_mxcsr));
>> +      __asm__ ("stmxcsr %0" : "=m" (*&_mxcsr));
>>        /*_mxcsr = ((int)envp->__unused0 << 16) | (int)envp->__unused1;
>> *//* mxcsr low and high */
>>        env.__unused0 = 0xffff;
>>        env.__unused1 = 0xffff;
>>
>>
>>
> 
> This seems a good catch.
> 
> However I think the `STMXCSR` instruction should follow
> `__mingw_has_sse()`, although CPUs without SSE are rare. I propose
> another patch to address this issue.
> 
> 
>

Ping?  Do you have any testcases related to this issue? Please notice
that without any response we will not act on this.


-- 
Best regards,
LH_Mouse

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to