msvcp90: Added complex_float_pow implementation(Fix precision) and tests(Try 4)

YongHao Hu christopherwuy at gmail.com
Fri Aug 29 20:34:47 CDT 2014


Try 5:
        Fix incorrect function in complex_double_pow_ci.(Thanks Piotr)
---
      dlls/msvcp70/msvcp70.spec |   12 ++++----
      dlls/msvcp71/msvcp71.spec |   12 ++++----
      dlls/msvcp80/msvcp80.spec |   12 ++++----
      dlls/msvcp90/math.c       |   48 +++++++++++++++++++++++++++++
      dlls/msvcp90/msvcp90.spec |   12 ++++----
      dlls/msvcp90/tests/misc.c |   74 
+++++++++++++++++++++++++++++++++++++++++++++
      6 files changed, 146 insertions(+), 24 deletions(-)






-------------- next part --------------
diff --git a/dlls/msvcp70/msvcp70.spec b/dlls/msvcp70/msvcp70.spec
index dbd0219..f2022dd 100644
--- a/dlls/msvcp70/msvcp70.spec
+++ b/dlls/msvcp70/msvcp70.spec
@@ -4131,15 +4131,15 @@
 @ stub -arch=win64 ?pow at std@@YA?AV?$complex at M@1 at AEBV21@0 at Z
 @ stub -arch=win32 ?pow at std@@YA?AV?$complex at M@1 at ABV21@ABM at Z
 @ stub -arch=win64 ?pow at std@@YA?AV?$complex at M@1 at AEBV21@AEBM at Z
-@ stub -arch=win32 ?pow at std@@YA?AV?$complex at M@1 at ABV21@H at Z
-@ stub -arch=win64 ?pow at std@@YA?AV?$complex at M@1 at AEBV21@H at Z
+@ cdecl -arch=win32 ?pow at std@@YA?AV?$complex at M@1 at ABV21@H at Z(ptr ptr long) complex_float_pow_ci
+@ cdecl -arch=win64 ?pow at std@@YA?AV?$complex at M@1 at AEBV21@H at Z(ptr ptr long) complex_float_pow_ci
 @ stub -arch=win32 ?pow at std@@YA?AV?$complex at N@1 at ABNABV21@@Z
 @ stub -arch=win64 ?pow at std@@YA?AV?$complex at N@1 at AEBNAEBV21@@Z
 @ stub -arch=win32 ?pow at std@@YA?AV?$complex at N@1 at ABV21@0 at Z
 @ stub -arch=win64 ?pow at std@@YA?AV?$complex at N@1 at AEBV21@0 at Z
 @ stub -arch=win32 ?pow at std@@YA?AV?$complex at N@1 at ABV21@ABN at Z
-@ stub -arch=win64 ?pow at std@@YA?AV?$complex at N@1 at AEBV21@AEBN at Z
-@ stub -arch=win32 ?pow at std@@YA?AV?$complex at N@1 at ABV21@H at Z
+@ cdecl -arch=win64 ?pow at std@@YA?AV?$complex at N@1 at AEBV21@AEBN at Z(ptr ptr long) complex_double_pow_ci
+@ cdecl -arch=win32 ?pow at std@@YA?AV?$complex at N@1 at ABV21@H at Z(ptr ptr long) complex_double_pow_ci
 @ stub -arch=win64 ?pow at std@@YA?AV?$complex at N@1 at AEBV21@H at Z
 @ stub -arch=win32 ?pow at std@@YA?AV?$complex at O@1 at ABOABV21@@Z
 @ stub -arch=win64 ?pow at std@@YA?AV?$complex at O@1 at AEBOAEBV21@@Z
@@ -4147,8 +4147,8 @@
 @ stub -arch=win64 ?pow at std@@YA?AV?$complex at O@1 at AEBV21@0 at Z
 @ stub -arch=win32 ?pow at std@@YA?AV?$complex at O@1 at ABV21@ABO at Z
 @ stub -arch=win64 ?pow at std@@YA?AV?$complex at O@1 at AEBV21@AEBO at Z
-@ stub -arch=win32 ?pow at std@@YA?AV?$complex at O@1 at ABV21@H at Z
-@ stub -arch=win64 ?pow at std@@YA?AV?$complex at O@1 at AEBV21@H at Z
+@ cdecl -arch=win32 ?pow at std@@YA?AV?$complex at O@1 at ABV21@H at Z(ptr ptr long) complex_double_pow_ci
+@ cdecl -arch=win64 ?pow at std@@YA?AV?$complex at O@1 at AEBV21@H at Z(ptr ptr long) complex_double_pow_ci
 @ thiscall -arch=i386 ?pptr@?$basic_streambuf at DU?$char_traits at D@std@@@std@@IBEPADXZ(ptr) basic_streambuf_char_pptr
 @ cdecl -arch=win64 ?pptr@?$basic_streambuf at DU?$char_traits at D@std@@@std@@IEBAPEADXZ(ptr) basic_streambuf_char_pptr
 @ thiscall -arch=i386 ?pptr@?$basic_streambuf at GU?$char_traits at G@std@@@std@@IBEPAGXZ(ptr) basic_streambuf_wchar_pptr
diff --git a/dlls/msvcp71/msvcp71.spec b/dlls/msvcp71/msvcp71.spec
index 3dc82a7..00662cf 100644
--- a/dlls/msvcp71/msvcp71.spec
+++ b/dlls/msvcp71/msvcp71.spec
@@ -440,24 +440,24 @@
 @ cdecl -arch=win64 ??$pow at M@std@@YA?AV?$complex at M@0 at AEBV10@0 at Z(ptr ptr ptr) complex_float_pow
 @ cdecl -arch=win32 ??$pow at M@std@@YA?AV?$complex at M@0 at ABV10@ABM at Z(ptr ptr ptr) complex_float_pow_cf
 @ cdecl -arch=win64 ??$pow at M@std@@YA?AV?$complex at M@0 at AEBV10@AEBM at Z(ptr ptr ptr) complex_float_pow_cf
-@ stub -arch=win32 ??$pow at M@std@@YA?AV?$complex at M@0 at ABV10@H at Z
-@ stub -arch=win64 ??$pow at M@std@@YA?AV?$complex at M@0 at AEBV10@H at Z
+@ cdecl -arch=win32 ??$pow at M@std@@YA?AV?$complex at M@0 at ABV10@H at Z(ptr ptr long) complex_float_pow_ci
+@ cdecl -arch=win64 ??$pow at M@std@@YA?AV?$complex at M@0 at AEBV10@H at Z(ptr ptr long) complex_float_pow_ci
 @ cdecl -arch=win32 ??$pow at N@std@@YA?AV?$complex at N@0 at ABNABV10@@Z(ptr ptr ptr) complex_double_pow_dc
 @ cdecl -arch=win64 ??$pow at N@std@@YA?AV?$complex at N@0 at AEBNAEBV10@@Z(ptr ptr ptr) complex_double_pow_dc
 @ cdecl -arch=win32 ??$pow at N@std@@YA?AV?$complex at N@0 at ABV10@0 at Z(ptr ptr ptr) complex_double_pow
 @ cdecl -arch=win64 ??$pow at N@std@@YA?AV?$complex at N@0 at AEBV10@0 at Z(ptr ptr ptr) complex_double_pow
 @ cdecl -arch=win32 ??$pow at N@std@@YA?AV?$complex at N@0 at ABV10@ABN at Z(ptr ptr ptr) complex_double_pow_cd
 @ cdecl -arch=win64 ??$pow at N@std@@YA?AV?$complex at N@0 at AEBV10@AEBN at Z(ptr ptr ptr) complex_double_pow_cd
-@ stub -arch=win32 ??$pow at N@std@@YA?AV?$complex at N@0 at ABV10@H at Z
-@ stub -arch=win64 ??$pow at N@std@@YA?AV?$complex at N@0 at AEBV10@H at Z
+@ cdecl -arch=win32 ??$pow at N@std@@YA?AV?$complex at N@0 at ABV10@H at Z(ptr ptr long) complex_double_pow_ci
+@ cdecl -arch=win64 ??$pow at N@std@@YA?AV?$complex at N@0 at AEBV10@H at Z(ptr ptr long) complex_double_pow_ci
 @ cdecl -arch=win32 ??$pow at O@std@@YA?AV?$complex at O@0 at ABOABV10@@Z(ptr ptr ptr) complex_double_pow_dc
 @ cdecl -arch=win64 ??$pow at O@std@@YA?AV?$complex at O@0 at AEBOAEBV10@@Z(ptr ptr ptr) complex_double_pow_dc
 @ cdecl -arch=win32 ??$pow at O@std@@YA?AV?$complex at O@0 at ABV10@0 at Z(ptr ptr ptr) complex_double_pow
 @ cdecl -arch=win64 ??$pow at O@std@@YA?AV?$complex at O@0 at AEBV10@0 at Z(ptr ptr ptr) complex_double_pow
 @ cdecl -arch=win32 ??$pow at O@std@@YA?AV?$complex at O@0 at ABV10@ABO at Z(ptr ptr ptr) complex_double_pow_cd
 @ cdecl -arch=win64 ??$pow at O@std@@YA?AV?$complex at O@0 at AEBV10@AEBO at Z(ptr ptr ptr) complex_double_pow_cd
-@ stub -arch=win32 ??$pow at O@std@@YA?AV?$complex at O@0 at ABV10@H at Z
-@ stub -arch=win64 ??$pow at O@std@@YA?AV?$complex at O@0 at AEBV10@H at Z
+@ cdecl -arch=win32 ??$pow at O@std@@YA?AV?$complex at O@0 at ABV10@H at Z(ptr ptr long) complex_double_pow_ci
+@ cdecl -arch=win64 ??$pow at O@std@@YA?AV?$complex at O@0 at AEBV10@H at Z(ptr ptr long) complex_double_pow_ci
 @ cdecl -arch=win32 ??$real at M@std@@YAMABV?$complex at M@0@@Z(ptr) complex_float_real
 @ cdecl -arch=win64 ??$real at M@std@@YAMAEBV?$complex at M@0@@Z(ptr) complex_float_real
 @ cdecl -arch=win32 ??$real at N@std@@YANABV?$complex at N@0@@Z(ptr) complex_double_real
diff --git a/dlls/msvcp80/msvcp80.spec b/dlls/msvcp80/msvcp80.spec
index 1550cc6..60ed234 100644
--- a/dlls/msvcp80/msvcp80.spec
+++ b/dlls/msvcp80/msvcp80.spec
@@ -440,24 +440,24 @@
 @ cdecl -arch=win64 ??$pow at M@std@@YA?AV?$complex at M@0 at AEBV10@0 at Z(ptr ptr ptr) complex_float_pow
 @ cdecl -arch=win32 ??$pow at M@std@@YA?AV?$complex at M@0 at ABV10@ABM at Z(ptr ptr ptr) complex_float_pow_cf
 @ cdecl -arch=win64 ??$pow at M@std@@YA?AV?$complex at M@0 at AEBV10@AEBM at Z(ptr ptr ptr) complex_float_pow_cf
-@ stub -arch=win32 ??$pow at M@std@@YA?AV?$complex at M@0 at ABV10@H at Z
-@ stub -arch=win64 ??$pow at M@std@@YA?AV?$complex at M@0 at AEBV10@H at Z
+@ cdecl -arch=win32 ??$pow at M@std@@YA?AV?$complex at M@0 at ABV10@H at Z(ptr ptr long) complex_float_pow_ci
+@ cdecl -arch=win64 ??$pow at M@std@@YA?AV?$complex at M@0 at AEBV10@H at Z(ptr ptr long) complex_float_pow_ci
 @ cdecl -arch=win32 ??$pow at N@std@@YA?AV?$complex at N@0 at ABNABV10@@Z(ptr ptr ptr) complex_double_pow_dc
 @ cdecl -arch=win64 ??$pow at N@std@@YA?AV?$complex at N@0 at AEBNAEBV10@@Z(ptr ptr ptr) complex_double_pow_dc
 @ cdecl -arch=win32 ??$pow at N@std@@YA?AV?$complex at N@0 at ABV10@0 at Z(ptr ptr ptr) complex_double_pow
 @ cdecl -arch=win64 ??$pow at N@std@@YA?AV?$complex at N@0 at AEBV10@0 at Z(ptr ptr ptr) complex_double_pow
 @ cdecl -arch=win32 ??$pow at N@std@@YA?AV?$complex at N@0 at ABV10@ABN at Z(ptr ptr ptr) complex_double_pow_cd
 @ cdecl -arch=win64 ??$pow at N@std@@YA?AV?$complex at N@0 at AEBV10@AEBN at Z(ptr ptr ptr) complex_double_pow_cd
-@ stub -arch=win32 ??$pow at N@std@@YA?AV?$complex at N@0 at ABV10@H at Z
-@ stub -arch=win64 ??$pow at N@std@@YA?AV?$complex at N@0 at AEBV10@H at Z
+@ cdecl -arch=win32 ??$pow at N@std@@YA?AV?$complex at N@0 at ABV10@H at Z(ptr ptr long) complex_double_pow_ci
+@ cdecl -arch=win64 ??$pow at N@std@@YA?AV?$complex at N@0 at AEBV10@H at Z(ptr ptr long) complex_double_pow_ci
 @ cdecl -arch=win32 ??$pow at O@std@@YA?AV?$complex at O@0 at ABOABV10@@Z(ptr ptr ptr) complex_double_pow_dc
 @ cdecl -arch=win64 ??$pow at O@std@@YA?AV?$complex at O@0 at AEBOAEBV10@@Z(ptr ptr ptr) complex_double_pow_dc
 @ cdecl -arch=win32 ??$pow at O@std@@YA?AV?$complex at O@0 at ABV10@0 at Z(ptr ptr ptr) complex_double_pow
 @ cdecl -arch=win64 ??$pow at O@std@@YA?AV?$complex at O@0 at AEBV10@0 at Z(ptr ptr ptr) complex_double_pow
 @ cdecl -arch=win32 ??$pow at O@std@@YA?AV?$complex at O@0 at ABV10@ABO at Z(ptr ptr ptr) complex_double_pow_cd
 @ cdecl -arch=win64 ??$pow at O@std@@YA?AV?$complex at O@0 at AEBV10@AEBO at Z(ptr ptr ptr) complex_double_pow_cd
-@ stub -arch=win32 ??$pow at O@std@@YA?AV?$complex at O@0 at ABV10@H at Z
-@ stub -arch=win64 ??$pow at O@std@@YA?AV?$complex at O@0 at AEBV10@H at Z
+@ cdecl -arch=win32 ??$pow at O@std@@YA?AV?$complex at O@0 at ABV10@H at Z(ptr ptr long) complex_double_pow_ci
+@ cdecl -arch=win64 ??$pow at O@std@@YA?AV?$complex at O@0 at AEBV10@H at Z(ptr ptr long) complex_double_pow_ci
 @ cdecl -arch=win32 ??$real at M@std@@YAMABV?$complex at M@0@@Z(ptr) complex_float_real
 @ cdecl -arch=win64 ??$real at M@std@@YAMAEBV?$complex at M@0@@Z(ptr) complex_float_real
 @ cdecl -arch=win32 ??$real at N@std@@YANABV?$complex at N@0@@Z(ptr) complex_double_real
diff --git a/dlls/msvcp90/math.c b/dlls/msvcp90/math.c
index 11d3c75..25f6270 100644
--- a/dlls/msvcp90/math.c
+++ b/dlls/msvcp90/math.c
@@ -1462,6 +1462,29 @@ complex_float* __cdecl complex_float_pow_cf(complex_float *ret, const complex_fl
     return complex_float_pow(ret, l, &c);
 }
 
+/*  ??$pow at M@std@@YA?AV?$complex at M@0 at ABV10@H at Z  */
+/*  ??$pow at M@std@@YA?AV?$complex at M@0 at AEBV10@H at Z */
+complex_float* __cdecl complex_float_pow_ci(complex_float *ret, const complex_float *l, int r)
+{
+    complex_float c = *l;
+    complex_float temp = { 1.0, 0 };
+    complex_float_assign(ret, &temp);
+
+    if(r < 0) {
+        r = -r;
+        complex_float_div(&c, &temp, l);
+    }
+
+    for(; r>0; r>>=1) {
+        if(r & 1)
+            complex_float_mult_assign(ret, &c);
+        complex_float_assign(&temp, &c);
+        complex_float_mult_assign(&c, &temp);
+    }
+
+    return ret;
+}
+
 /* ??$sqrt at M@std@@YA?AV?$complex at M@0 at ABV10@@Z */
 /* ??$sqrt at M@std@@YA?AV?$complex at M@0 at AEBV10@@Z */
 complex_float* __cdecl complex_float_sqrt(complex_float *ret, const complex_float *l)
@@ -2158,6 +2181,31 @@ complex_double* __cdecl complex_double_pow_cd(complex_double *ret, const complex
     return complex_double_pow(ret, l, &c);
 }
 
+/*  ??$pow at N@std@@YA?AV?$complex at N@0 at ABV10@H at Z  */
+/*  ??$pow at N@std@@YA?AV?$complex at N@0 at AEBV10@H at Z */
+/*  ??$pow at O@std@@YA?AV?$complex at O@0 at ABV10@H at Z  */
+/*  ??$pow at O@std@@YA?AV?$complex at O@0 at AEBV10@H at Z */
+complex_double* __cdecl complex_double_pow_ci(complex_double *ret, const complex_double *l, int r)
+{
+    complex_double c = *l;
+    complex_double temp = { 1.0, 0 };
+    complex_double_assign(ret, &temp);
+
+    if(r < 0) {
+        r = -r;
+        complex_double_div(&c, &temp, l);
+    }
+
+    for(; r>0; r>>=1) {
+        if(r & 1)
+            complex_double_mult_assign(ret, &c);
+        complex_double_assign(&temp, &c);
+        complex_double_mult_assign(&c, &temp);
+    }
+
+    return ret;
+}
+
 /* ??$sqrt at N@std@@YA?AV?$complex at N@0 at ABV10@@Z */
 /* ??$sqrt at N@std@@YA?AV?$complex at N@0 at AEBV10@@Z */
 /* ??$sqrt at O@std@@YA?AV?$complex at O@0 at ABV10@@Z */
diff --git a/dlls/msvcp90/msvcp90.spec b/dlls/msvcp90/msvcp90.spec
index 41820d3..745af9d 100644
--- a/dlls/msvcp90/msvcp90.spec
+++ b/dlls/msvcp90/msvcp90.spec
@@ -440,24 +440,24 @@
 @ cdecl -arch=win64 ??$pow at M@std@@YA?AV?$complex at M@0 at AEBV10@0 at Z(ptr ptr ptr) complex_float_pow
 @ cdecl -arch=win32 ??$pow at M@std@@YA?AV?$complex at M@0 at ABV10@ABM at Z(ptr ptr ptr) complex_float_pow_cf
 @ cdecl -arch=win64 ??$pow at M@std@@YA?AV?$complex at M@0 at AEBV10@AEBM at Z(ptr ptr ptr) complex_float_pow_cf
-@ stub -arch=win32 ??$pow at M@std@@YA?AV?$complex at M@0 at ABV10@H at Z
-@ stub -arch=win64 ??$pow at M@std@@YA?AV?$complex at M@0 at AEBV10@H at Z
+@ cdecl -arch=win32 ??$pow at M@std@@YA?AV?$complex at M@0 at ABV10@H at Z(ptr ptr long) complex_float_pow_ci
+@ cdecl -arch=win64 ??$pow at M@std@@YA?AV?$complex at M@0 at AEBV10@H at Z(ptr ptr long) complex_float_pow_ci
 @ cdecl -arch=win32 ??$pow at N@std@@YA?AV?$complex at N@0 at ABNABV10@@Z(ptr ptr ptr) complex_double_pow_dc
 @ cdecl -arch=win64 ??$pow at N@std@@YA?AV?$complex at N@0 at AEBNAEBV10@@Z(ptr ptr ptr) complex_double_pow_dc
 @ cdecl -arch=win32 ??$pow at N@std@@YA?AV?$complex at N@0 at ABV10@0 at Z(ptr ptr ptr) complex_double_pow
 @ cdecl -arch=win64 ??$pow at N@std@@YA?AV?$complex at N@0 at AEBV10@0 at Z(ptr ptr ptr) complex_double_pow
 @ cdecl -arch=win32 ??$pow at N@std@@YA?AV?$complex at N@0 at ABV10@ABN at Z(ptr ptr ptr) complex_double_pow_cd
 @ cdecl -arch=win64 ??$pow at N@std@@YA?AV?$complex at N@0 at AEBV10@AEBN at Z(ptr ptr ptr) complex_double_pow_cd
-@ stub -arch=win32 ??$pow at N@std@@YA?AV?$complex at N@0 at ABV10@H at Z
-@ stub -arch=win64 ??$pow at N@std@@YA?AV?$complex at N@0 at AEBV10@H at Z
+@ cdecl -arch=win32 ??$pow at N@std@@YA?AV?$complex at N@0 at ABV10@H at Z(ptr ptr long) complex_double_pow_ci
+@ cdecl -arch=win64 ??$pow at N@std@@YA?AV?$complex at N@0 at AEBV10@H at Z(ptr ptr long) complex_double_pow_ci
 @ cdecl -arch=win32 ??$pow at O@std@@YA?AV?$complex at O@0 at ABOABV10@@Z(ptr ptr ptr) complex_double_pow_dc
 @ cdecl -arch=win64 ??$pow at O@std@@YA?AV?$complex at O@0 at AEBOAEBV10@@Z(ptr ptr ptr) complex_double_pow_dc
 @ cdecl -arch=win32 ??$pow at O@std@@YA?AV?$complex at O@0 at ABV10@0 at Z(ptr ptr ptr) complex_double_pow
 @ cdecl -arch=win64 ??$pow at O@std@@YA?AV?$complex at O@0 at AEBV10@0 at Z(ptr ptr ptr) complex_double_pow
 @ cdecl -arch=win32 ??$pow at O@std@@YA?AV?$complex at O@0 at ABV10@ABO at Z(ptr ptr ptr) complex_double_pow_cd
 @ cdecl -arch=win64 ??$pow at O@std@@YA?AV?$complex at O@0 at AEBV10@AEBO at Z(ptr ptr ptr) complex_double_pow_cd
-@ stub -arch=win32 ??$pow at O@std@@YA?AV?$complex at O@0 at ABV10@H at Z
-@ stub -arch=win64 ??$pow at O@std@@YA?AV?$complex at O@0 at AEBV10@H at Z
+@ cdecl -arch=win32 ??$pow at O@std@@YA?AV?$complex at O@0 at ABV10@H at Z(ptr ptr long) complex_double_pow_ci
+@ cdecl -arch=win64 ??$pow at O@std@@YA?AV?$complex at O@0 at AEBV10@H at Z(ptr ptr long) complex_double_pow_ci
 @ cdecl -arch=win32 ??$real at M@std@@YAMABV?$complex at M@0@@Z(ptr) complex_float_real
 @ cdecl -arch=win64 ??$real at M@std@@YAMAEBV?$complex at M@0@@Z(ptr) complex_float_real
 @ cdecl -arch=win32 ??$real at N@std@@YANABV?$complex at N@0@@Z(ptr) complex_double_real
diff --git a/dlls/msvcp90/tests/misc.c b/dlls/msvcp90/tests/misc.c
index e94ddcb..26cafc9 100644
--- a/dlls/msvcp90/tests/misc.c
+++ b/dlls/msvcp90/tests/misc.c
@@ -118,6 +118,9 @@ static complex_float* (__cdecl *p_complex_float_tan)(complex_float*, const compl
 static complex_float* (__cdecl *p_complex_float_tanh)(complex_float*, const complex_float*);
 static complex_float* (__cdecl *p_complex_float_log10)(complex_float*, const complex_float*);
 static complex_float* (__cdecl *p_complex_float_sqrt)(complex_float*, const complex_float*);
+static complex_float* (__cdecl *p_complex_float_pow_ci)(complex_float*, const complex_float*, int);
+static complex_float* (__cdecl *p_complex_float_pow_fc)(complex_float*, const float*, const complex_float*);
+static complex_float* (__cdecl *p_complex_float_pow_cf)(complex_float*, const complex_float*, const float*);
 
 static int invalid_parameter = 0;
 static void __cdecl test_invalid_parameter_handler(const wchar_t *expression,
@@ -267,6 +270,12 @@ static BOOL init(void)
                 "??$log10 at M@std@@YA?AV?$complex at M@0 at AEBV10@@Z");
         SET(p_complex_float_sqrt,
                 "??$sqrt at M@std@@YA?AV?$complex at M@0 at AEBV10@@Z");
+        SET(p_complex_float_pow_ci,
+                "??$pow at M@std@@YA?AV?$complex at M@0 at AEBV10@H at Z");
+        SET(p_complex_float_pow_fc,
+                "??$pow at M@std@@YA?AV?$complex at M@0 at AEBMAEBV10@@Z");
+        SET(p_complex_float_pow_cf,
+                "??$pow at M@std@@YA?AV?$complex at M@0 at AEBV10@AEBM at Z");
     } else {
 #ifdef __arm__
         SET(p_char_assign, "?assign@?$char_traits at D@std@@SAXAADABD at Z");
@@ -322,6 +331,12 @@ static BOOL init(void)
                 "??$log10 at M@std@@YA?AV?$complex at M@0 at ABV10@@Z");
         SET(p_complex_float_sqrt,
                 "??$sqrt at M@std@@YA?AV?$complex at M@0 at ABV10@@Z");
+        SET(p_complex_float_pow_ci,
+                "??$pow at M@std@@YA?AV?$complex at M@0 at ABV10@H at Z");
+        SET(p_complex_float_pow_fc,
+                "??$pow at M@std@@YA?AV?$complex at M@0 at ABMABV10@@Z");
+        SET(p_complex_float_pow_cf,
+                "??$pow at M@std@@YA?AV?$complex at M@0 at ABV10@ABM at Z");
 #else
         SET(p_char_assign, "?assign@?$char_traits at D@std@@SAXAADABD at Z");
         SET(p_wchar_assign, "?assign@?$char_traits at _W@std@@SAXAA_WAB_W at Z");
@@ -376,6 +391,12 @@ static BOOL init(void)
                 "??$log10 at M@std@@YA?AV?$complex at M@0 at ABV10@@Z");
         SET(p_complex_float_sqrt,
                 "??$sqrt at M@std@@YA?AV?$complex at M@0 at ABV10@@Z");
+        SET(p_complex_float_pow_ci,
+                "??$pow at M@std@@YA?AV?$complex at M@0 at ABV10@H at Z");
+        SET(p_complex_float_pow_fc,
+                "??$pow at M@std@@YA?AV?$complex at M@0 at ABMABV10@@Z");
+        SET(p_complex_float_pow_cf,
+                "??$pow at M@std@@YA?AV?$complex at M@0 at ABV10@ABM at Z");
 #endif
     }
 
@@ -672,6 +693,7 @@ static void test_complex(void)
     complex_float c1, c2, c3;
     float f1, f2;
     int scale;
+    int r;
 
     f1 = 1;
     f2 = 2;
@@ -787,6 +809,8 @@ static void test_complex(void)
 
     c1.real = 0;
     c1.imag = 0;
+    r = 3;
+    f1 = 3.312;
     p_complex_float_tan(&c2, &c1);
     ok(c2.real == 0, "c2.real = %f\n", c2.real);
     ok(c2.imag == 0, "c2.imag = %f\n", c2.imag);
@@ -799,6 +823,15 @@ static void test_complex(void)
     p_complex_float_sqrt(&c2, &c1);
     ok(c2.real == 0, "c2.real = %f\n", c2.real);
     ok(c2.imag == 0, "c2.imag = %f\n", c2.imag);
+    p_complex_float_pow_ci(&c2, &c1, r);
+    ok(c2.real == 0, "c2.real = %f\n", c2.real);
+    ok(c2.imag == 0, "c2.imag = %f\n", c2.imag);
+    p_complex_float_pow_fc(&c2, &f1, &c1);
+    ok(c2.real == 1, "c2.real = %f\n", c2.real);
+    ok(c2.imag == 0, "c2.imag = %f\n", c2.imag);
+    p_complex_float_pow_cf(&c2, &c1, &f1);
+    ok(c2.real == 0, "c2.real = %f\n", c2.real);
+    ok(c2.imag == 0, "c2.imag = %f\n", c2.imag);
 
     c1.real = 3.14159/2;
     c1.imag = 0;
@@ -814,6 +847,20 @@ static void test_complex(void)
     p_complex_float_sqrt(&c2, &c1);
     ok(almost_eq(c2.real, 1.253314), "c2.real = %f\n", c2.real);
     ok(c2.imag == 0, "c2.imag = %g\n", c2.imag);
+    p_complex_float_pow_ci(&c2, &c1, r);
+    ok(almost_eq(c2.real, 3.875775), "c2.real = %f\n", c2.real);
+    ok(c2.imag == 0, "c2.imag = %g\n", c2.imag);
+    r = -r;
+    p_complex_float_pow_ci(&c2, &c1, r);
+    ok(almost_eq(c2.real, 0.258013), "c2.real = %f\n", c2.real);
+    ok(c2.imag == 0, "c2.imag = %g\n", c2.imag);
+    r = -r;
+    p_complex_float_pow_fc(&c2, &f1, &c1);
+    ok(almost_eq(c2.real, 6.560778), "c2.real = %f\n", c2.real);
+    ok(c2.imag == 0, "c2.imag = %f\n", c2.imag);
+    p_complex_float_pow_cf(&c2, &c1, &f1);
+    ok(almost_eq(c2.real, 4.462188), "c2.real = %f\n", c2.real);
+    ok(c2.imag == 0, "c2.imag = %f\n", c2.imag);
 
     c1.real = 7.12;
     c1.imag = 0.17;
@@ -829,6 +876,20 @@ static void test_complex(void)
     p_complex_float_sqrt(&c2, &c1);
     ok(almost_eq(c2.real, 2.668523), "c2.real = %f\n", c2.real);
     ok(almost_eq(c2.imag, 0.0318528), "c2.imag = %g\n", c2.imag);
+    p_complex_float_pow_ci(&c2, &c1, r);
+    ok(almost_eq(c2.real, 360.326782), "c2.real = %f\n", c2.real);
+    ok(almost_eq(c2.imag, 25.849230), "c2.imag = %g\n", c2.imag);
+    r = -r;
+    p_complex_float_pow_ci(&c2, &c1, r);
+    ok(almost_eq(c2.real, 0.002761), "c2.real = %f\n", c2.real);
+    ok(almost_eq(c2.imag, -0.000198073), "c2.imag = %g\n", c2.imag);
+    r = -r;
+    p_complex_float_pow_fc(&c2, &f1, &c1);
+    ok(almost_eq(c2.real, 4942.879395), "c2.real = %f\n", c2.real);
+    ok(almost_eq(c2.imag, 1020.427368), "c2.imag = %g\n", c2.imag);
+    p_complex_float_pow_cf(&c2, &c1, &f1);
+    ok(almost_eq(c2.real, 664.453918), "c2.real = %f\n", c2.real);
+    ok(almost_eq(c2.imag, 52.643879), "c2.imag = %g\n", c2.imag);
 
     c1.real = 0.14;
     c1.imag = 0.19;
@@ -844,6 +905,19 @@ static void test_complex(void)
     p_complex_float_sqrt(&c2, &c1);
     ok(almost_eq(c2.real, 0.433595), "c2.real = %f\n", c2.real);
     ok(almost_eq(c2.imag, 0.219099), "c2.imag = %g\n", c2.imag);
+    p_complex_float_pow_ci(&c2, &c1, r);
+    ok(almost_eq(c2.real, -0.012418), "c2.real = %f\n", c2.real);
+    ok(almost_eq(c2.imag, 0.004313), "c2.imag = %g\n", c2.imag);
+    r = -r;
+    p_complex_float_pow_ci(&c2, &c1, r);
+    ok(almost_eq(c2.real, -71.859810), "c2.real = %f\n", c2.real);
+    ok(almost_eq(c2.imag, -24.958229), "c2.imag = %g\n", c2.imag);
+    p_complex_float_pow_fc(&c2, &f1, &c1);
+    ok(almost_eq(c2.real, 1.152052), "c2.real = %f\n", c2.real);
+    ok(almost_eq(c2.imag, 0.266751), "c2.imag = %g\n", c2.imag);
+    p_complex_float_pow_cf(&c2, &c1, &f1);
+    ok(almost_eq(c2.real, -0.008370), "c2.real = %f\n", c2.real);
+    ok(almost_eq(c2.imag, 0.00035447), "c2.imag = %g\n", c2.imag);
 }
 
 START_TEST(misc)






More information about the wine-patches mailing list