msvcrt: Import frexpf implementation from musl.
Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
81c58e7d49
commit
411b6f5842
|
@ -1611,10 +1611,28 @@ float CDECL floorf( float x )
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
* frexpf (MSVCRT.@)
|
* frexpf (MSVCRT.@)
|
||||||
|
*
|
||||||
|
* Copied from musl: src/math/frexpf.c
|
||||||
*/
|
*/
|
||||||
float CDECL frexpf( float x, int *exp )
|
float CDECL frexpf( float x, int *e )
|
||||||
{
|
{
|
||||||
return unix_funcs->frexpf( x, exp );
|
UINT32 ux = *(UINT32*)&x;
|
||||||
|
int ee = ux >> 23 & 0xff;
|
||||||
|
|
||||||
|
if (!ee) {
|
||||||
|
if (x) {
|
||||||
|
x = frexpf(x * 0x1p64, e);
|
||||||
|
*e -= 64;
|
||||||
|
} else *e = 0;
|
||||||
|
return x;
|
||||||
|
} else if (ee == 0xff) {
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
*e = ee - 0x7e;
|
||||||
|
ux &= 0x807ffffful;
|
||||||
|
ux |= 0x3f000000ul;
|
||||||
|
return *(float*)&ux;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
|
|
|
@ -94,14 +94,6 @@ static float CDECL unix_fmaf( float x, float y, float z )
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************
|
|
||||||
* frexpf
|
|
||||||
*/
|
|
||||||
static float CDECL unix_frexpf( float x, int *exp )
|
|
||||||
{
|
|
||||||
return frexpf( x, exp );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
* hypot
|
* hypot
|
||||||
*/
|
*/
|
||||||
|
@ -273,7 +265,6 @@ static const struct unix_funcs funcs =
|
||||||
unix_exp2,
|
unix_exp2,
|
||||||
unix_exp2f,
|
unix_exp2f,
|
||||||
unix_fmaf,
|
unix_fmaf,
|
||||||
unix_frexpf,
|
|
||||||
unix_hypot,
|
unix_hypot,
|
||||||
unix_hypotf,
|
unix_hypotf,
|
||||||
unix_lgamma,
|
unix_lgamma,
|
||||||
|
|
|
@ -28,7 +28,6 @@ struct unix_funcs
|
||||||
double (CDECL *exp2)(double x);
|
double (CDECL *exp2)(double x);
|
||||||
float (CDECL *exp2f)(float x);
|
float (CDECL *exp2f)(float x);
|
||||||
float (CDECL *fmaf)(float x, float y, float z);
|
float (CDECL *fmaf)(float x, float y, float z);
|
||||||
float (CDECL *frexpf)(float x, int *exp);
|
|
||||||
double (CDECL *hypot)(double x, double y);
|
double (CDECL *hypot)(double x, double y);
|
||||||
float (CDECL *hypotf)(float x, float y);
|
float (CDECL *hypotf)(float x, float y);
|
||||||
double (CDECL *lgamma)(double x);
|
double (CDECL *lgamma)(double x);
|
||||||
|
|
Loading…
Reference in New Issue