Commit 643ff988 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcp: Add _Dscale implementation.

parent aa612612
......@@ -2891,14 +2891,14 @@
@ stub _Cosh
@ extern _Denorm
@ stub _Dnorm
@ stub _Dscale
@ cdecl _Dscale(ptr long)
@ cdecl _Dtest(ptr)
@ extern _Eps
@ stub _Exp
@ stub _FCosh
@ extern _FDenorm
@ stub _FDnorm
@ stub _FDscale
@ cdecl _FDscale(ptr long)
@ cdecl _FDtest(ptr)
@ extern _FEps
@ stub _FExp
......@@ -2919,7 +2919,7 @@
@ extern _Inf
@ stub _LCosh
@ extern _LDenorm
@ stub _LDscale
@ cdecl _LDscale(ptr long) _Dscale
@ cdecl _LDtest(ptr) _Dtest
@ extern _LEps
@ stub _LExp
......
......@@ -3743,7 +3743,7 @@
@ stub _Dint
@ stub _Dnorm
@ cdecl _Do_call(ptr)
@ stub _Dscale
@ cdecl _Dscale(ptr long)
@ stub _Dtento
@ cdecl _Dtest(ptr)
@ stub _Dunscale
......@@ -3753,7 +3753,7 @@
@ extern _FDenorm
@ stub _FDint
@ stub _FDnorm
@ stub _FDscale
@ cdecl _FDscale(ptr long)
@ stub _FDtento
@ cdecl _FDtest(ptr)
@ stub _FDunscale
......@@ -3789,7 +3789,7 @@
@ stub _LCosh
@ extern _LDenorm
@ stub _LDint
@ stub _LDscale
@ cdecl _LDscale(ptr long) _Dscale
@ stub _LDtento
@ cdecl _LDtest(ptr) _Dtest
@ stub _LDunscale
......
......@@ -3684,7 +3684,7 @@
@ stub _Dint
@ stub _Dnorm
@ cdecl _Do_call(ptr)
@ stub _Dscale
@ cdecl _Dscale(ptr long)
@ stub _Dtento
@ cdecl _Dtest(ptr)
@ stub _Dunscale
......@@ -3694,7 +3694,7 @@
@ extern _FDenorm
@ stub _FDint
@ stub _FDnorm
@ stub _FDscale
@ cdecl _FDscale(ptr long)
@ stub _FDtento
@ cdecl _FDtest(ptr)
@ stub _FDunscale
......@@ -3732,7 +3732,7 @@
@ stub _LCosh
@ extern _LDenorm
@ stub _LDint
@ stub _LDscale
@ cdecl _LDscale(ptr long) _Dscale
@ stub _LDtento
@ cdecl _LDtest(ptr) _Dtest
@ stub _LDunscale
......
......@@ -86,6 +86,7 @@ static void (CDECL *p__Call_once)(int *once, void (CDECL *func)(void));
static void (CDECL *p__Call_onceEx)(int *once, void (CDECL *func)(void*), void *argv);
static void (CDECL *p__Do_call)(void *this);
static short (__cdecl *p__Dtest)(double *d);
static short (__cdecl *p__Dscale)(double *d, int exp);
/* filesystem */
static ULONGLONG(__cdecl *p_tr2_sys__File_size)(char const*);
......@@ -139,6 +140,8 @@ static BOOL init(void)
"_Do_call");
SET(p__Dtest,
"_Dtest");
SET(p__Dscale,
"_Dscale");
if(sizeof(void*) == 8) { /* 64-bit initialization */
SET(p_tr2_sys__File_size,
"?_File_size@sys@tr2@std@@YA_KPEBD@Z");
......@@ -461,6 +464,56 @@ static void test__Dtest(void)
ok(ret == FP_NAN, "_Dtest(NAN) returned %x\n", ret);
}
static void test__Dscale(void)
{
double d;
short ret;
d = 0;
ret = p__Dscale(&d, 0);
ok(d == 0, "d = %f\n", d);
ok(ret == FP_ZERO, "ret = %x\n", ret);
d = 0;
ret = p__Dscale(&d, 1);
ok(d == 0, "d = %f\n", d);
ok(ret == FP_ZERO, "ret = %x\n", ret);
d = 0;
ret = p__Dscale(&d, -1);
ok(d == 0, "d = %f\n", d);
ok(ret == FP_ZERO, "ret = %x\n", ret);
d = 1;
ret = p__Dscale(&d, 0);
ok(d == 1, "d = %f\n", d);
ok(ret == FP_NORMAL, "ret = %x\n", ret);
d = 1;
ret = p__Dscale(&d, 1);
ok(d == 2, "d = %f\n", d);
ok(ret == FP_NORMAL, "ret = %x\n", ret);
d = 1;
ret = p__Dscale(&d, -1);
ok(d == 0.5, "d = %f\n", d);
ok(ret == FP_NORMAL, "ret = %x\n", ret);
d = 1;
ret = p__Dscale(&d, -99999);
ok(d == 0, "d = %f\n", d);
ok(ret == FP_ZERO, "ret = %x\n", ret);
d = 1;
ret = p__Dscale(&d, 999999);
ok(d == INFINITY, "d = %f\n", d);
ok(ret == FP_INFINITE, "ret = %x\n", ret);
d = NAN;
ret = p__Dscale(&d, 1);
ok(ret == FP_NAN, "ret = %x\n", ret);
}
static void test_tr2_sys__File_size(void)
{
ULONGLONG val;
......@@ -1001,6 +1054,7 @@ START_TEST(msvcp120)
test__Call_once();
test__Do_call();
test__Dtest();
test__Dscale();
test_tr2_sys__File_size();
test_tr2_sys__Equivalent();
......
......@@ -3684,7 +3684,7 @@
@ stub _Dint
@ stub _Dnorm
@ cdecl _Do_call(ptr) msvcp120._Do_call
@ stub _Dscale
@ cdecl _Dscale(ptr long) msvcp120._Dscale
@ stub _Dtento
@ cdecl _Dtest(ptr) msvcp120._Dtest
@ stub _Dunscale
......@@ -3694,7 +3694,7 @@
@ extern _FDenorm msvcp120._FDenorm
@ stub _FDint
@ stub _FDnorm
@ stub _FDscale
@ cdecl _FDscale(ptr long) msvcp120._FDscale
@ stub _FDtento
@ cdecl _FDtest(ptr) msvcp120._FDtest
@ stub _FDunscale
......@@ -3732,7 +3732,7 @@
@ stub _LCosh
@ extern _LDenorm msvcp120._LDenorm
@ stub _LDint
@ stub _LDscale
@ cdecl _LDscale(ptr long) msvcp120._LDscale
@ stub _LDtento
@ cdecl _LDtest(ptr) msvcp120._LDtest
@ stub _LDunscale
......
......@@ -4257,14 +4257,14 @@
@ stub _Cosh
@ extern _Denorm _Denorm
@ stub _Dnorm
@ stub _Dscale
@ cdecl _Dscale(ptr long)
@ cdecl _Dtest(ptr)
@ extern _Eps _Eps
@ stub _Exp
@ stub _FCosh
@ extern _FDenorm _FDenorm
@ stub _FDnorm
@ stub _FDscale
@ cdecl _FDscale(ptr long)
@ cdecl _FDtest(ptr)
@ extern _FEps _FEps
@ stub _FExp
......@@ -4281,7 +4281,7 @@
@ extern _Inf _Inf
@ stub _LCosh
@ extern _LDenorm _LDenorm
@ stub _LDscale
@ cdecl _LDscale(ptr long) _Dscale
@ cdecl _LDtest(ptr) _Dtest
@ extern _LEps _LEps
@ stub _LExp
......
......@@ -5043,14 +5043,14 @@
@ stub _Cosh
@ extern _Denorm
@ stub _Dnorm
@ stub _Dscale
@ cdecl _Dscale(ptr long)
@ cdecl _Dtest(ptr)
@ extern _Eps
@ stub _Exp
@ stub _FCosh
@ extern _FDenorm
@ stub _FDnorm
@ stub _FDscale
@ cdecl _FDscale(ptr long)
@ cdecl _FDtest(ptr)
@ extern _FEps
@ stub _FExp
......@@ -5068,7 +5068,7 @@
@ extern _Inf
@ stub _LCosh
@ extern _LDenorm
@ stub _LDscale
@ cdecl _LDscale(ptr long) _Dscale
@ cdecl _LDtest(ptr) _Dtest
@ extern _LEps
@ stub _LExp
......
......@@ -5097,14 +5097,14 @@
@ stub _Cosh
@ extern _Denorm
@ stub _Dnorm
@ stub _Dscale
@ cdecl _Dscale(ptr long)
@ cdecl _Dtest(ptr)
@ extern _Eps
@ stub _Exp
@ stub _FCosh
@ extern _FDenorm
@ stub _FDnorm
@ stub _FDscale
@ cdecl _FDscale(ptr long)
@ cdecl _FDtest(ptr)
@ extern _FEps
@ stub _FExp
......@@ -5124,7 +5124,7 @@
@ extern _Inf
@ stub _LCosh
@ extern _LDenorm
@ stub _LDscale
@ cdecl _LDscale(ptr long) _Dscale
@ cdecl _LDtest(ptr) _Dtest
@ extern _LEps
@ stub _LExp
......
......@@ -5703,7 +5703,7 @@
@ stub _Cosh
@ extern _Denorm
@ stub _Dnorm
@ stub _Dscale
@ cdecl _Dscale(ptr long)
@ stub _Dtentox
@ cdecl _Dtest(ptr)
@ stub _Dunscale
......@@ -5712,7 +5712,7 @@
@ stub _FCosh
@ extern _FDenorm
@ stub _FDnorm
@ stub _FDscale
@ cdecl _FDscale(ptr long)
@ stub _FDtentox
@ cdecl _FDtest(ptr)
@ stub _FDunscale
......@@ -5734,7 +5734,7 @@
@ extern _Inf
@ stub _LCosh
@ extern _LDenorm
@ stub _LDscale
@ cdecl _LDscale(ptr long) _Dscale
@ stub _LDtentox
@ cdecl _LDtest(ptr) _Dtest
@ stub _LDunscale
......
......@@ -2260,3 +2260,17 @@ short __cdecl _FDtest(float *x)
{
return dclass(*x);
}
/* _Dscale */
short __cdecl _Dscale(double *x, int exp)
{
*x *= pow(2, exp);
return dclass(*x);
}
/* _FDscale */
short __cdecl _FDscale(float *x, int exp)
{
*x *= pow(2, exp);
return dclass(*x);
}
......@@ -6479,14 +6479,14 @@
@ stub _Cosh
@ extern _Denorm
@ stub _Dnorm
@ stub _Dscale
@ cdecl _Dscale(ptr long)
@ cdecl _Dtest(ptr)
@ extern _Eps
@ stub _Exp
@ stub _FCosh
@ extern _FDenorm
@ stub _FDnorm
@ stub _FDscale
@ cdecl _FDscale(ptr long)
@ cdecl _FDtest(ptr)
@ extern _FEps
@ stub _FExp
......@@ -6506,7 +6506,7 @@
@ extern _Inf
@ stub _LCosh
@ extern _LDenorm
@ stub _LDscale
@ cdecl _LDscale(ptr long) _Dscale
@ cdecl _LDtest(ptr) _Dtest
@ extern _LEps
@ stub _LExp
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment