Piotr Caban : msvcp90: Added std::abs(complex) implementation.

Alexandre Julliard julliard at winehq.org
Thu Jan 24 12:59:49 CST 2013


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Thu Jan 24 12:27:57 2013 +0100

msvcp90: Added std::abs(complex) implementation.

---

 dlls/msvcp90/math.c       |   58 +++++++++++++++++++++++++++++++++++++++++++++
 dlls/msvcp90/msvcp90.spec |   24 +++++++++---------
 2 files changed, 70 insertions(+), 12 deletions(-)

diff --git a/dlls/msvcp90/math.c b/dlls/msvcp90/math.c
index 8d25e76..37dc3f7 100644
--- a/dlls/msvcp90/math.c
+++ b/dlls/msvcp90/math.c
@@ -1276,6 +1276,33 @@ float __thiscall complex_float_real_get(const complex_float *this)
     return this->real;
 }
 
+/* ??$_Fabs at M@std@@YAMABV?$complex at M@0 at PAH@Z */
+/* ??$_Fabs at M@std@@YAMAEBV?$complex at M@0 at PEAH@Z */
+float __cdecl complex_float__Fabs(const complex_float *c, int *scale)
+{
+    float ret;
+
+    ret = hypotf(c->real, c->imag);
+    if(_isnan(ret) || ret==0) {
+        *scale = 0;
+    }else if(ret >= 1) {
+        *scale = 2;
+        ret /= 4;
+    }else {
+        *scale = -2;
+        ret *= 4;
+    }
+
+    return ret;
+}
+
+/* ??$abs at M@std@@YAMABV?$complex at M@0@@Z */
+/* ??$abs at M@std@@YAMAEBV?$complex at M@0@@Z */
+float __cdecl complex_float_abs(const complex_float *c)
+{
+    return hypotf(c->real, c->imag);
+}
+
 /* ??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 */
@@ -1742,3 +1769,34 @@ double __thiscall complex_double_real_get(const complex_double *this)
 {
     return this->real;
 }
+
+/* ??$_Fabs at N@std@@YANABV?$complex at N@0 at PAH@Z */
+/* ??$_Fabs at N@std@@YANAEBV?$complex at N@0 at PEAH@Z */
+/* ??$_Fabs at O@std@@YAOABV?$complex at O@0 at PAH@Z */
+/* ??$_Fabs at O@std@@YAOAEBV?$complex at O@0 at PEAH@Z */
+double __cdecl complex_double__Fabs(const complex_double *c, int *scale)
+{
+    double ret;
+
+    ret = hypot(c->real, c->imag);
+    if(_isnan(ret) || ret==0) {
+        *scale = 0;
+    }else if(ret >= 1) {
+        *scale = 2;
+        ret /= 4;
+    }else {
+        *scale = -2;
+        ret *= 4;
+    }
+
+    return ret;
+}
+
+/* ??$abs at N@std@@YANABV?$complex at N@0@@Z */
+/* ??$abs at N@std@@YANAEBV?$complex at N@0@@Z */
+/* ??$abs at O@std@@YAOABV?$complex at O@0@@Z */
+/* ??$abs at O@std@@YAOAEBV?$complex at O@0@@Z */
+double __cdecl complex_double_abs(const complex_double *c)
+{
+    return hypot(c->real, c->imag);
+}
diff --git a/dlls/msvcp90/msvcp90.spec b/dlls/msvcp90/msvcp90.spec
index 14540b4..ef4726d 100644
--- a/dlls/msvcp90/msvcp90.spec
+++ b/dlls/msvcp90/msvcp90.spec
@@ -344,18 +344,18 @@
 @ cdecl -arch=win64 ??$?P_WU?$char_traits at _W@std@@V?$allocator at _W@1@@std@@YA_NAEBV?$basic_string at _WU?$char_traits at _W@std@@V?$allocator at _W@2@@0 at PEB_W@Z(ptr wstr) MSVCP_basic_string_wchar_geq_bstr_cstr
 @ cdecl -arch=win32 ??$?P_WU?$char_traits at _W@std@@V?$allocator at _W@1@@std@@YA_NPB_WABV?$basic_string at _WU?$char_traits at _W@std@@V?$allocator at _W@2@@0@@Z(wstr ptr) MSVCP_basic_string_wchar_geq_cstr_bstr
 @ cdecl -arch=win64 ??$?P_WU?$char_traits at _W@std@@V?$allocator at _W@1@@std@@YA_NPEB_WAEBV?$basic_string at _WU?$char_traits at _W@std@@V?$allocator at _W@2@@0@@Z(wstr ptr) MSVCP_basic_string_wchar_geq_cstr_bstr
-@ stub -arch=win32 ??$_Fabs at M@std@@YAMABV?$complex at M@0 at PAH@Z
-@ stub -arch=win64 ??$_Fabs at M@std@@YAMAEBV?$complex at M@0 at PEAH@Z
-@ stub -arch=win32 ??$_Fabs at N@std@@YANABV?$complex at N@0 at PAH@Z
-@ stub -arch=win64 ??$_Fabs at N@std@@YANAEBV?$complex at N@0 at PEAH@Z
-@ stub -arch=win32 ??$_Fabs at O@std@@YAOABV?$complex at O@0 at PAH@Z
-@ stub -arch=win64 ??$_Fabs at O@std@@YAOAEBV?$complex at O@0 at PEAH@Z
-@ stub -arch=win32 ??$abs at M@std@@YAMABV?$complex at M@0@@Z
-@ stub -arch=win64 ??$abs at M@std@@YAMAEBV?$complex at M@0@@Z
-@ stub -arch=win32 ??$abs at N@std@@YANABV?$complex at N@0@@Z
-@ stub -arch=win64 ??$abs at N@std@@YANAEBV?$complex at N@0@@Z
-@ stub -arch=win32 ??$abs at O@std@@YAOABV?$complex at O@0@@Z
-@ stub -arch=win64 ??$abs at O@std@@YAOAEBV?$complex at O@0@@Z
+@ cdecl -arch=win32 ??$_Fabs at M@std@@YAMABV?$complex at M@0 at PAH@Z(ptr ptr) complex_float__Fabs
+@ cdecl -arch=win64 ??$_Fabs at M@std@@YAMAEBV?$complex at M@0 at PEAH@Z(ptr ptr) complex_float__Fabs
+@ cdecl -arch=win32 ??$_Fabs at N@std@@YANABV?$complex at N@0 at PAH@Z(ptr ptr) complex_double__Fabs
+@ cdecl -arch=win64 ??$_Fabs at N@std@@YANAEBV?$complex at N@0 at PEAH@Z(ptr ptr) complex_double__Fabs
+@ cdecl -arch=win32 ??$_Fabs at O@std@@YAOABV?$complex at O@0 at PAH@Z(ptr ptr) complex_double__Fabs
+@ cdecl -arch=win64 ??$_Fabs at O@std@@YAOAEBV?$complex at O@0 at PEAH@Z(ptr ptr) complex_double__Fabs
+@ cdecl -arch=win32 ??$abs at M@std@@YAMABV?$complex at M@0@@Z(ptr) complex_float_abs
+@ cdecl -arch=win64 ??$abs at M@std@@YAMAEBV?$complex at M@0@@Z(ptr) complex_float_abs
+@ cdecl -arch=win32 ??$abs at N@std@@YANABV?$complex at N@0@@Z(ptr) complex_double_abs
+@ cdecl -arch=win64 ??$abs at N@std@@YANAEBV?$complex at N@0@@Z(ptr) complex_double_abs
+@ cdecl -arch=win32 ??$abs at O@std@@YAOABV?$complex at O@0@@Z(ptr) complex_double_abs
+@ cdecl -arch=win64 ??$abs at O@std@@YAOAEBV?$complex at O@0@@Z(ptr) complex_double_abs
 @ cdecl -arch=win32 ??$arg at M@std@@YAMABV?$complex at M@0@@Z(ptr) complex_float_arg
 @ cdecl -arch=win64 ??$arg at M@std@@YAMAEBV?$complex at M@0@@Z(ptr) complex_float_arg
 @ cdecl -arch=win32 ??$arg at N@std@@YANABV?$complex at N@0@@Z(ptr) complex_double_arg




More information about the wine-cvs mailing list