[PATCH v3] ucrtbase: added function implementation for get_FMA3_enable and set_FMA3_enable

daXcoRe daxcore at online.de
Mon Feb 3 10:25:48 CST 2020


Hi,

> I guess it will be good enough to fix the proton bug.

I think so too.

The only think is, I have no idea how big the performance lag will be, if fma3 is disabled but the cpu supports this.

BR.


03.02.2020 16:30:04 Piotr Caban <piotr.caban at gmail.com>:

> Hi Rosa,
> 
> On 2/2/20 4:51 PM, Rosa Hase wrote:
> 
> > + #if defined(_WIN64) && _MSVCR_VER>=120
> > + #if !defined(__FMA__) && defined(__AVX2__)
> > + #define __FMA__ 1
> > 
> The __FMA__ and __AVX2__ is only defined when compilation with this
> instructions is enabled (e.g. -mfma option). It's also said that you
> should never define them yourself.
> 
> 
> > /*********************************************************************
> > * _set_FMA3_enable (MSVCR120.@)
> > */
> > int CDECL MSVCRT__set_FMA3_enable(int flag)
> > {
> > - FIXME("(%x) stub\n", flag);
> > - return 0;
> > + fma3_enabled = flag && fma3_supported;
> > + return fma3_enabled;
> > 
> This is only checking if wine was compiled using -mfma or -mavx option.
> This function should check processor capabilities instead and switch to
> different math functions implementation. Taking in account that we don't
> provide math function implementation using fma3 instructions it's
> probably best to leave _set_FMA3_enable function as is.
> 
> A fake implementation of _get_FMA3_enable may look like this:
> +/*********************************************************************
> + * _get_FMA3_enable (MSVCR120.@)
> + */
> +int CDECL MSVCRT__get_FMA3_enable(void)
> +{
> + FIXME("() stub\n");
> + return 0;
> +}
> I guess it will be good enough to fix the proton bug.
> 
> Thanks,
> Piotr
> 




More information about the wine-devel mailing list