Signed-off-by: Martin Storsjö <mar...@martin.st> --- mingw-w64-crt/Makefile.am | 3 ++- mingw-w64-crt/math/x86/cossin.c | 23 ----------------------- mingw-w64-crt/math/x86/cossinl.c | 29 +++++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 24 deletions(-) create mode 100644 mingw-w64-crt/math/x86/cossinl.c
diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am index 97ab3b474..232aa7c0f 100644 --- a/mingw-w64-crt/Makefile.am +++ b/mingw-w64-crt/Makefile.am @@ -1009,7 +1009,8 @@ src_libmingwex_x86=\ math/x86/asinhl.c math/x86/asinl.c math/x86/atan2l.c \ math/x86/atanhl.c math/x86/atanl.c \ math/x86/ceill.S math/x86/copysignl.S \ - math/x86/cos.def.h math/x86/cosl.c math/x86/cosl_internal.S math/x86/cossin.c \ + math/x86/cos.def.h math/x86/cosl.c math/x86/cosl_internal.S \ + math/x86/cossin.c math/x86/cossinl.c \ math/x86/exp2l.S math/x86/exp.def.h math/x86/expl.c math/x86/expm1.def.h math/x86/expm1l.c \ math/x86/fastmath.h math/x86/floorl.S \ math/x86/fmodl.c math/x86/fucom.c \ diff --git a/mingw-w64-crt/math/x86/cossin.c b/mingw-w64-crt/math/x86/cossin.c index cb3340545..b86fbfc9e 100644 --- a/mingw-w64-crt/math/x86/cossin.c +++ b/mingw-w64-crt/math/x86/cossin.c @@ -5,7 +5,6 @@ */ void sincos (double __x, double *p_sin, double *p_cos); -void sincosl (long double __x, long double *p_sin, long double *p_cos); void sincosf (float __x, float *p_sin, float *p_cos); void sincos (double __x, double *p_sin, double *p_cos) @@ -51,25 +50,3 @@ void sincosf (float __x, float *p_sin, float *p_cos) *p_sin = (float) s; *p_cos = (float) c; } - -void sincosl (long double __x, long double *p_sin, long double *p_cos) -{ - long double c, s; - - __asm__ __volatile__ ("fsincos\n\t" - "fnstsw %%ax\n\t" - "testl $0x400, %%eax\n\t" - "jz 1f\n\t" - "fldpi\n\t" - "fadd %%st(0)\n\t" - "fxch %%st(1)\n\t" - "2: fprem1\n\t" - "fnstsw %%ax\n\t" - "testl $0x400, %%eax\n\t" - "jnz 2b\n\t" - "fstp %%st(1)\n\t" - "fsincos\n\t" - "1:" : "=t" (c), "=u" (s) : "0" (__x) : "eax"); - *p_sin = s; - *p_cos = c; -} diff --git a/mingw-w64-crt/math/x86/cossinl.c b/mingw-w64-crt/math/x86/cossinl.c new file mode 100644 index 000000000..cfd172dcb --- /dev/null +++ b/mingw-w64-crt/math/x86/cossinl.c @@ -0,0 +1,29 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the mingw-w64 runtime package. + * No warranty is given; refer to the file DISCLAIMER.PD within this package. + */ + +void sincosl (long double __x, long double *p_sin, long double *p_cos); + +void sincosl (long double __x, long double *p_sin, long double *p_cos) +{ + long double c, s; + + __asm__ __volatile__ ("fsincos\n\t" + "fnstsw %%ax\n\t" + "testl $0x400, %%eax\n\t" + "jz 1f\n\t" + "fldpi\n\t" + "fadd %%st(0)\n\t" + "fxch %%st(1)\n\t" + "2: fprem1\n\t" + "fnstsw %%ax\n\t" + "testl $0x400, %%eax\n\t" + "jnz 2b\n\t" + "fstp %%st(1)\n\t" + "fsincos\n\t" + "1:" : "=t" (c), "=u" (s) : "0" (__x) : "eax"); + *p_sin = s; + *p_cos = c; +} -- 2.43.0 _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public