Piotr Caban : msvcp90: Added std::norm(complex) and std::polar(complex) implementation.

Alexandre Julliard julliard at winehq.org
Fri Jan 25 13:31:48 CST 2013


Module: wine
Branch: master
Commit: 2350e48f2029ab60fe60b2782005a0e34ac0a3f5
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2350e48f2029ab60fe60b2782005a0e34ac0a3f5

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Fri Jan 25 10:37:24 2013 +0100

msvcp90: Added std::norm(complex) and std::polar(complex) implementation.

---

 dlls/msvcp90/math.c       |   56 +++++++++++++++++++++++++++++++++++++++++++++
 dlls/msvcp90/msvcp90.spec |   36 ++++++++++++++--------------
 2 files changed, 74 insertions(+), 18 deletions(-)

diff --git a/dlls/msvcp90/math.c b/dlls/msvcp90/math.c
index aca11f1..7cd605a 100644
--- a/dlls/msvcp90/math.c
+++ b/dlls/msvcp90/math.c
@@ -1402,6 +1402,31 @@ complex_float* __cdecl complex_float_log10(complex_float *ret, const complex_flo
     return ret;
 }
 
+/* ??$norm at M@std@@YAMABV?$complex at M@0@@Z */
+/* ??$norm at M@std@@YAMAEBV?$complex at M@0@@Z */
+float __cdecl complex_float_norm(const complex_float *c)
+{
+    return c->real*c->real + c->imag*c->imag;
+}
+
+/* ??$polar at M@std@@YA?AV?$complex at M@0 at ABM0@Z */
+/* ??$polar at M@std@@YA?AV?$complex at M@0 at AEBM0@Z */
+complex_float* __cdecl complex_float_polar_theta(complex_float *ret, const float *mod, const float *theta)
+{
+    ret->real = *mod * cos(*theta);
+    ret->imag = *mod * sin(*theta);
+    return ret;
+}
+
+/* ??$polar at M@std@@YA?AV?$complex at M@0 at ABM@Z */
+/* ??$polar at M@std@@YA?AV?$complex at M@0 at AEBM@Z */
+complex_float* __cdecl complex_float_polar(complex_float *ret, const float *mod)
+{
+    ret->real = *mod;
+    ret->imag = 0;
+    return ret;
+}
+
 /* ??0?$_Complex_base at NU_C_double_complex@@@std@@QAE at ABN0@Z */
 /* ??0?$_Complex_base at NU_C_double_complex@@@std@@QEAA at AEBN0@Z */
 /* ??0?$_Complex_base at OU_C_ldouble_complex@@@std@@QAE at ABO0@Z */
@@ -2017,3 +2042,34 @@ complex_double* __cdecl complex_double_log10(complex_double *ret, const complex_
     ret->imag *= M_LOG10E;
     return ret;
 }
+
+/* ??$norm at N@std@@YANABV?$complex at N@0@@Z */
+/* ??$norm at N@std@@YANAEBV?$complex at N@0@@Z */
+/* ??$norm at O@std@@YAOABV?$complex at O@0@@Z */
+/* ??$norm at O@std@@YAOAEBV?$complex at O@0@@Z */
+double __cdecl complex_double_norm(const complex_double *c)
+{
+    return c->real*c->real + c->imag*c->imag;
+}
+
+/* ??$polar at N@std@@YA?AV?$complex at N@0 at ABN0@Z */
+/* ??$polar at N@std@@YA?AV?$complex at N@0 at AEBN0@Z */
+/* ??$polar at O@std@@YA?AV?$complex at O@0 at ABO0@Z */
+/* ??$polar at O@std@@YA?AV?$complex at O@0 at AEBO0@Z */
+complex_double* __cdecl complex_double_polar_theta(complex_double *ret, const double *mod, const double *theta)
+{
+    ret->real = *mod * cos(*theta);
+    ret->imag = *mod * sin(*theta);
+    return ret;
+}
+
+/* ??$polar at N@std@@YA?AV?$complex at N@0 at ABN@Z */
+/* ??$polar at N@std@@YA?AV?$complex at N@0 at AEBN@Z */
+/* ??$polar at O@std@@YA?AV?$complex at O@0 at ABO@Z */
+/* ??$polar at O@std@@YA?AV?$complex at O@0 at AEBO@Z */
+complex_double* __cdecl complex_double_polar(complex_double *ret, const double *mod)
+{
+    ret->real = *mod;
+    ret->imag = 0;
+    return ret;
+}
diff --git a/dlls/msvcp90/msvcp90.spec b/dlls/msvcp90/msvcp90.spec
index 61a4651..c1351d5 100644
--- a/dlls/msvcp90/msvcp90.spec
+++ b/dlls/msvcp90/msvcp90.spec
@@ -416,24 +416,24 @@
 @ cdecl -arch=win64 ??$log at N@std@@YA?AV?$complex at N@0 at AEBV10@@Z(ptr ptr) complex_double_log
 @ cdecl -arch=win32 ??$log at O@std@@YA?AV?$complex at O@0 at ABV10@@Z(ptr ptr) complex_double_log
 @ cdecl -arch=win64 ??$log at O@std@@YA?AV?$complex at O@0 at AEBV10@@Z(ptr ptr) complex_double_log
-@ stub -arch=win32 ??$norm at M@std@@YAMABV?$complex at M@0@@Z
-@ stub -arch=win64 ??$norm at M@std@@YAMAEBV?$complex at M@0@@Z
-@ stub -arch=win32 ??$norm at N@std@@YANABV?$complex at N@0@@Z
-@ stub -arch=win64 ??$norm at N@std@@YANAEBV?$complex at N@0@@Z
-@ stub -arch=win32 ??$norm at O@std@@YAOABV?$complex at O@0@@Z
-@ stub -arch=win64 ??$norm at O@std@@YAOAEBV?$complex at O@0@@Z
-@ stub -arch=win32 ??$polar at M@std@@YA?AV?$complex at M@0 at ABM0@Z
-@ stub -arch=win64 ??$polar at M@std@@YA?AV?$complex at M@0 at AEBM0@Z
-@ stub -arch=win32 ??$polar at M@std@@YA?AV?$complex at M@0 at ABM@Z
-@ stub -arch=win64 ??$polar at M@std@@YA?AV?$complex at M@0 at AEBM@Z
-@ stub -arch=win32 ??$polar at N@std@@YA?AV?$complex at N@0 at ABN0@Z
-@ stub -arch=win64 ??$polar at N@std@@YA?AV?$complex at N@0 at AEBN0@Z
-@ stub -arch=win32 ??$polar at N@std@@YA?AV?$complex at N@0 at ABN@Z
-@ stub -arch=win64 ??$polar at N@std@@YA?AV?$complex at N@0 at AEBN@Z
-@ stub -arch=win32 ??$polar at O@std@@YA?AV?$complex at O@0 at ABO0@Z
-@ stub -arch=win64 ??$polar at O@std@@YA?AV?$complex at O@0 at AEBO0@Z
-@ stub -arch=win32 ??$polar at O@std@@YA?AV?$complex at O@0 at ABO@Z
-@ stub -arch=win64 ??$polar at O@std@@YA?AV?$complex at O@0 at AEBO@Z
+@ cdecl -arch=win32 ??$norm at M@std@@YAMABV?$complex at M@0@@Z(ptr) complex_float_norm
+@ cdecl -arch=win64 ??$norm at M@std@@YAMAEBV?$complex at M@0@@Z(ptr) complex_float_norm
+@ cdecl -arch=win32 ??$norm at N@std@@YANABV?$complex at N@0@@Z(ptr) complex_double_norm
+@ cdecl -arch=win64 ??$norm at N@std@@YANAEBV?$complex at N@0@@Z(ptr) complex_double_norm
+@ cdecl -arch=win32 ??$norm at O@std@@YAOABV?$complex at O@0@@Z(ptr) complex_double_norm
+@ cdecl -arch=win64 ??$norm at O@std@@YAOAEBV?$complex at O@0@@Z(ptr) complex_double_norm
+@ cdecl -arch=win32 ??$polar at M@std@@YA?AV?$complex at M@0 at ABM0@Z(ptr ptr ptr) complex_float_polar_theta
+@ cdecl -arch=win64 ??$polar at M@std@@YA?AV?$complex at M@0 at AEBM0@Z(ptr ptr ptr) complex_float_polar_theta
+@ cdecl -arch=win32 ??$polar at M@std@@YA?AV?$complex at M@0 at ABM@Z(ptr ptr) complex_float_polar
+@ cdecl -arch=win64 ??$polar at M@std@@YA?AV?$complex at M@0 at AEBM@Z(ptr ptr) complex_float_polar
+@ cdecl -arch=win32 ??$polar at N@std@@YA?AV?$complex at N@0 at ABN0@Z(ptr ptr ptr) complex_double_polar_theta
+@ cdecl -arch=win64 ??$polar at N@std@@YA?AV?$complex at N@0 at AEBN0@Z(ptr ptr ptr) complex_double_polar_theta
+@ cdecl -arch=win32 ??$polar at N@std@@YA?AV?$complex at N@0 at ABN@Z(ptr ptr) complex_double_polar
+@ cdecl -arch=win64 ??$polar at N@std@@YA?AV?$complex at N@0 at AEBN@Z(ptr ptr) complex_double_polar
+@ cdecl -arch=win32 ??$polar at O@std@@YA?AV?$complex at O@0 at ABO0@Z(ptr ptr ptr) complex_double_polar_theta
+@ cdecl -arch=win64 ??$polar at O@std@@YA?AV?$complex at O@0 at AEBO0@Z(ptr ptr ptr) complex_double_polar_theta
+@ cdecl -arch=win32 ??$polar at O@std@@YA?AV?$complex at O@0 at ABO@Z(ptr ptr) complex_double_polar
+@ cdecl -arch=win64 ??$polar at O@std@@YA?AV?$complex at O@0 at AEBO@Z(ptr ptr) complex_double_polar
 @ stub -arch=win32 ??$pow at M@std@@YA?AV?$complex at M@0 at ABMABV10@@Z
 @ stub -arch=win64 ??$pow at M@std@@YA?AV?$complex at M@0 at AEBMAEBV10@@Z
 @ stub -arch=win32 ??$pow at M@std@@YA?AV?$complex at M@0 at ABV10@0 at Z




More information about the wine-cvs mailing list