Commit 55aeaf3c authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcp90: Added std::log(complex) and std::exp(complex) implementation.

parent 6c6565de
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <stdarg.h> #include <stdarg.h>
#include <limits.h> #include <limits.h>
#include <float.h> #include <float.h>
#define _USE_MATH_DEFINES
#include <math.h> #include <math.h>
#include "msvcp90.h" #include "msvcp90.h"
...@@ -1372,6 +1373,35 @@ complex_float* __cdecl complex_float_tanh(complex_float *ret, const complex_floa ...@@ -1372,6 +1373,35 @@ complex_float* __cdecl complex_float_tanh(complex_float *ret, const complex_floa
return ret; return ret;
} }
/* ??$exp@M@std@@YA?AV?$complex@M@0@ABV10@@Z */
/* ??$exp@M@std@@YA?AV?$complex@M@0@AEBV10@@Z */
complex_float* __cdecl complex_float_exp(complex_float *ret, const complex_float *c)
{
ret->real = ret->imag = exp(c->real);
ret->real *= cos(c->imag);
ret->imag *= sin(c->imag);
return ret;
}
/* ??$log@M@std@@YA?AV?$complex@M@0@ABV10@@Z */
/* ??$log@M@std@@YA?AV?$complex@M@0@AEBV10@@Z */
complex_float* __cdecl complex_float_log(complex_float *ret, const complex_float *c)
{
ret->real = log(complex_float_abs(c));
ret->imag = complex_float_arg(c);
return ret;
}
/* ??$log10@M@std@@YA?AV?$complex@M@0@ABV10@@Z */
/* ??$log10@M@std@@YA?AV?$complex@M@0@AEBV10@@Z */
complex_float* __cdecl complex_float_log10(complex_float *ret, const complex_float *c)
{
complex_float_log(ret, c);
ret->real *= M_LOG10E;
ret->imag *= M_LOG10E;
return ret;
}
/* ??0?$_Complex_base@NU_C_double_complex@@@std@@QAE@ABN0@Z */ /* ??0?$_Complex_base@NU_C_double_complex@@@std@@QAE@ABN0@Z */
/* ??0?$_Complex_base@NU_C_double_complex@@@std@@QEAA@AEBN0@Z */ /* ??0?$_Complex_base@NU_C_double_complex@@@std@@QEAA@AEBN0@Z */
/* ??0?$_Complex_base@OU_C_ldouble_complex@@@std@@QAE@ABO0@Z */ /* ??0?$_Complex_base@OU_C_ldouble_complex@@@std@@QAE@ABO0@Z */
...@@ -1952,3 +1982,38 @@ complex_double* __cdecl complex_double_tanh(complex_double *ret, const complex_d ...@@ -1952,3 +1982,38 @@ complex_double* __cdecl complex_double_tanh(complex_double *ret, const complex_d
ret->imag = -tmp.real; ret->imag = -tmp.real;
return ret; return ret;
} }
/* ??$exp@N@std@@YA?AV?$complex@N@0@ABV10@@Z */
/* ??$exp@N@std@@YA?AV?$complex@N@0@AEBV10@@Z */
/* ??$exp@O@std@@YA?AV?$complex@O@0@ABV10@@Z */
/* ??$exp@O@std@@YA?AV?$complex@O@0@AEBV10@@Z */
complex_double* __cdecl complex_double_exp(complex_double *ret, const complex_double *c)
{
ret->real = ret->imag = exp(c->real);
ret->real *= cos(c->imag);
ret->imag *= sin(c->imag);
return ret;
}
/* ??$log@N@std@@YA?AV?$complex@N@0@ABV10@@Z */
/* ??$log@N@std@@YA?AV?$complex@N@0@AEBV10@@Z */
/* ??$log@O@std@@YA?AV?$complex@O@0@ABV10@@Z */
/* ??$log@O@std@@YA?AV?$complex@O@0@AEBV10@@Z */
complex_double* __cdecl complex_double_log(complex_double *ret, const complex_double *c)
{
ret->real = log(complex_double_abs(c));
ret->imag = complex_double_arg(c);
return ret;
}
/* ??$log10@N@std@@YA?AV?$complex@N@0@ABV10@@Z */
/* ??$log10@N@std@@YA?AV?$complex@N@0@AEBV10@@Z */
/* ??$log10@O@std@@YA?AV?$complex@O@0@ABV10@@Z */
/* ??$log10@O@std@@YA?AV?$complex@O@0@AEBV10@@Z */
complex_double* __cdecl complex_double_log10(complex_double *ret, const complex_double *c)
{
complex_double_log(ret, c);
ret->real *= M_LOG10E;
ret->imag *= M_LOG10E;
return ret;
}
...@@ -380,12 +380,12 @@ ...@@ -380,12 +380,12 @@
@ cdecl -arch=win64 ??$cosh@N@std@@YA?AV?$complex@N@0@AEBV10@@Z(ptr ptr) complex_double_cosh @ cdecl -arch=win64 ??$cosh@N@std@@YA?AV?$complex@N@0@AEBV10@@Z(ptr ptr) complex_double_cosh
@ cdecl -arch=win32 ??$cosh@O@std@@YA?AV?$complex@O@0@ABV10@@Z(ptr ptr) complex_double_cosh @ cdecl -arch=win32 ??$cosh@O@std@@YA?AV?$complex@O@0@ABV10@@Z(ptr ptr) complex_double_cosh
@ cdecl -arch=win64 ??$cosh@O@std@@YA?AV?$complex@O@0@AEBV10@@Z(ptr ptr) complex_double_cosh @ cdecl -arch=win64 ??$cosh@O@std@@YA?AV?$complex@O@0@AEBV10@@Z(ptr ptr) complex_double_cosh
@ stub -arch=win32 ??$exp@M@std@@YA?AV?$complex@M@0@ABV10@@Z @ cdecl -arch=win32 ??$exp@M@std@@YA?AV?$complex@M@0@ABV10@@Z(ptr ptr) complex_float_exp
@ stub -arch=win64 ??$exp@M@std@@YA?AV?$complex@M@0@AEBV10@@Z @ cdecl -arch=win64 ??$exp@M@std@@YA?AV?$complex@M@0@AEBV10@@Z(ptr ptr) complex_float_exp
@ stub -arch=win32 ??$exp@N@std@@YA?AV?$complex@N@0@ABV10@@Z @ cdecl -arch=win32 ??$exp@N@std@@YA?AV?$complex@N@0@ABV10@@Z(ptr ptr) complex_double_exp
@ stub -arch=win64 ??$exp@N@std@@YA?AV?$complex@N@0@AEBV10@@Z @ cdecl -arch=win64 ??$exp@N@std@@YA?AV?$complex@N@0@AEBV10@@Z(ptr ptr) complex_double_exp
@ stub -arch=win32 ??$exp@O@std@@YA?AV?$complex@O@0@ABV10@@Z @ cdecl -arch=win32 ??$exp@O@std@@YA?AV?$complex@O@0@ABV10@@Z(ptr ptr) complex_double_exp
@ stub -arch=win64 ??$exp@O@std@@YA?AV?$complex@O@0@AEBV10@@Z @ cdecl -arch=win64 ??$exp@O@std@@YA?AV?$complex@O@0@AEBV10@@Z(ptr ptr) complex_double_exp
@ cdecl -arch=win32 ??$getline@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z(ptr ptr) basic_istream_char_getline_bstr @ cdecl -arch=win32 ??$getline@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z(ptr ptr) basic_istream_char_getline_bstr
@ cdecl -arch=win64 ??$getline@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z(ptr ptr) basic_istream_char_getline_bstr @ cdecl -arch=win64 ??$getline@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@YAAEAV?$basic_istream@DU?$char_traits@D@std@@@0@AEAV10@AEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@@Z(ptr ptr) basic_istream_char_getline_bstr
@ cdecl -arch=win32 ??$getline@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@D@Z(ptr ptr long) basic_istream_char_getline_bstr_delim @ cdecl -arch=win32 ??$getline@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@YAAAV?$basic_istream@DU?$char_traits@D@std@@@0@AAV10@AAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@D@Z(ptr ptr long) basic_istream_char_getline_bstr_delim
...@@ -404,18 +404,18 @@ ...@@ -404,18 +404,18 @@
@ cdecl -arch=win64 ??$imag@N@std@@YANAEBV?$complex@N@0@@Z(ptr) complex_double_imag @ cdecl -arch=win64 ??$imag@N@std@@YANAEBV?$complex@N@0@@Z(ptr) complex_double_imag
@ cdecl -arch=win32 ??$imag@O@std@@YAOABV?$complex@O@0@@Z(ptr) complex_double_imag @ cdecl -arch=win32 ??$imag@O@std@@YAOABV?$complex@O@0@@Z(ptr) complex_double_imag
@ cdecl -arch=win64 ??$imag@O@std@@YAOAEBV?$complex@O@0@@Z(ptr) complex_double_imag @ cdecl -arch=win64 ??$imag@O@std@@YAOAEBV?$complex@O@0@@Z(ptr) complex_double_imag
@ stub -arch=win32 ??$log10@M@std@@YA?AV?$complex@M@0@ABV10@@Z @ cdecl -arch=win32 ??$log10@M@std@@YA?AV?$complex@M@0@ABV10@@Z(ptr ptr) complex_float_log10
@ stub -arch=win64 ??$log10@M@std@@YA?AV?$complex@M@0@AEBV10@@Z @ cdecl -arch=win64 ??$log10@M@std@@YA?AV?$complex@M@0@AEBV10@@Z(ptr ptr) complex_float_log10
@ stub -arch=win32 ??$log10@N@std@@YA?AV?$complex@N@0@ABV10@@Z @ cdecl -arch=win32 ??$log10@N@std@@YA?AV?$complex@N@0@ABV10@@Z(ptr ptr) complex_double_log10
@ stub -arch=win64 ??$log10@N@std@@YA?AV?$complex@N@0@AEBV10@@Z @ cdecl -arch=win64 ??$log10@N@std@@YA?AV?$complex@N@0@AEBV10@@Z(ptr ptr) complex_double_log10
@ stub -arch=win32 ??$log10@O@std@@YA?AV?$complex@O@0@ABV10@@Z @ cdecl -arch=win32 ??$log10@O@std@@YA?AV?$complex@O@0@ABV10@@Z(ptr ptr) complex_double_log10
@ stub -arch=win64 ??$log10@O@std@@YA?AV?$complex@O@0@AEBV10@@Z @ cdecl -arch=win64 ??$log10@O@std@@YA?AV?$complex@O@0@AEBV10@@Z(ptr ptr) complex_double_log10
@ stub -arch=win32 ??$log@M@std@@YA?AV?$complex@M@0@ABV10@@Z @ cdecl -arch=win32 ??$log@M@std@@YA?AV?$complex@M@0@ABV10@@Z(ptr ptr) complex_float_log
@ stub -arch=win64 ??$log@M@std@@YA?AV?$complex@M@0@AEBV10@@Z @ cdecl -arch=win64 ??$log@M@std@@YA?AV?$complex@M@0@AEBV10@@Z(ptr ptr) complex_float_log
@ stub -arch=win32 ??$log@N@std@@YA?AV?$complex@N@0@ABV10@@Z @ cdecl -arch=win32 ??$log@N@std@@YA?AV?$complex@N@0@ABV10@@Z(ptr ptr) complex_double_log
@ stub -arch=win64 ??$log@N@std@@YA?AV?$complex@N@0@AEBV10@@Z @ cdecl -arch=win64 ??$log@N@std@@YA?AV?$complex@N@0@AEBV10@@Z(ptr ptr) complex_double_log
@ stub -arch=win32 ??$log@O@std@@YA?AV?$complex@O@0@ABV10@@Z @ cdecl -arch=win32 ??$log@O@std@@YA?AV?$complex@O@0@ABV10@@Z(ptr ptr) complex_double_log
@ stub -arch=win64 ??$log@O@std@@YA?AV?$complex@O@0@AEBV10@@Z @ cdecl -arch=win64 ??$log@O@std@@YA?AV?$complex@O@0@AEBV10@@Z(ptr ptr) complex_double_log
@ stub -arch=win32 ??$norm@M@std@@YAMABV?$complex@M@0@@Z @ stub -arch=win32 ??$norm@M@std@@YAMABV?$complex@M@0@@Z
@ stub -arch=win64 ??$norm@M@std@@YAMAEBV?$complex@M@0@@Z @ stub -arch=win64 ??$norm@M@std@@YAMAEBV?$complex@M@0@@Z
@ stub -arch=win32 ??$norm@N@std@@YANABV?$complex@N@0@@Z @ stub -arch=win32 ??$norm@N@std@@YANABV?$complex@N@0@@Z
......
...@@ -152,4 +152,23 @@ static const union { ...@@ -152,4 +152,23 @@ static const union {
#include <poppack.h> #include <poppack.h>
#ifdef _USE_MATH_DEFINES
#ifndef _MATH_DEFINES_DEFINED
#define _MATH_DEFINES_DEFINED
#define M_E 2.71828182845904523536
#define M_LOG2E 1.44269504088896340736
#define M_LOG10E 0.434294481903251827651
#define M_LN2 0.693147180559945309417
#define M_LN10 2.30258509299404568402
#define M_PI 3.14159265358979323846
#define M_PI_2 1.57079632679489661923
#define M_PI_4 0.785398163397448309616
#define M_1_PI 0.318309886183790671538
#define M_2_PI 0.636619772367581343076
#define M_2_SQRTPI 1.12837916709551257390
#define M_SQRT2 1.41421356237309504880
#define M_SQRT1_2 0.707106781186547524401
#endif /* !_MATH_DEFINES_DEFINED */
#endif /* _USE_MATH_DEFINES */
#endif /* __WINE_MATH_H */ #endif /* __WINE_MATH_H */
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