2001-01-10 23:59:25 +00:00
|
|
|
/*
|
|
|
|
* msvcrt.dll math functions
|
|
|
|
*
|
|
|
|
* Copyright 2000 Jon Griffiths
|
2002-03-09 23:29:33 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2001-01-10 23:59:25 +00:00
|
|
|
*/
|
2001-01-22 02:21:54 +00:00
|
|
|
#include "config.h"
|
2001-01-10 23:59:25 +00:00
|
|
|
|
2003-03-20 23:47:25 +00:00
|
|
|
#include <stdio.h>
|
2001-01-10 23:59:25 +00:00
|
|
|
#define __USE_ISOC9X 1
|
|
|
|
#define __USE_ISOC99 1
|
|
|
|
#include <math.h>
|
|
|
|
#ifdef HAVE_IEEEFP_H
|
|
|
|
#include <ieeefp.h>
|
|
|
|
#endif
|
|
|
|
|
2004-03-16 19:17:11 +00:00
|
|
|
#include "msvcrt.h"
|
|
|
|
#include "msvcrt/errno.h"
|
2001-04-10 23:25:25 +00:00
|
|
|
#include "msvcrt/stdlib.h"
|
2004-03-16 19:17:11 +00:00
|
|
|
#include "msvcrt/math.h"
|
|
|
|
#include "msvcrt/float.h"
|
2001-04-10 23:25:25 +00:00
|
|
|
|
2002-01-22 00:57:16 +00:00
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
|
2001-01-10 23:59:25 +00:00
|
|
|
|
|
|
|
#ifndef HAVE_FINITE
|
|
|
|
#ifndef finite /* Could be a macro */
|
|
|
|
#ifdef isfinite
|
|
|
|
#define finite(x) isfinite(x)
|
|
|
|
#else
|
|
|
|
#define finite(x) (!isnan(x)) /* At least catch some cases */
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef signbit
|
|
|
|
#define signbit(x) 0
|
|
|
|
#endif
|
|
|
|
|
2004-03-16 19:17:11 +00:00
|
|
|
typedef int (*MSVCRT_matherr_func)(struct MSVCRT__exception *);
|
2001-01-10 23:59:25 +00:00
|
|
|
|
|
|
|
static MSVCRT_matherr_func MSVCRT_default_matherr_func = NULL;
|
|
|
|
|
|
|
|
#if defined(__GNUC__) && defined(__i386__)
|
|
|
|
|
|
|
|
#define FPU_DOUBLE(var) double var; \
|
|
|
|
__asm__ __volatile__( "fstpl %0;fwait" : "=m" (var) : )
|
|
|
|
#define FPU_DOUBLES(var1,var2) double var1,var2; \
|
|
|
|
__asm__ __volatile__( "fstpl %0;fwait" : "=m" (var2) : ); \
|
|
|
|
__asm__ __volatile__( "fstpl %0;fwait" : "=m" (var1) : )
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _CIacos (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
double _CIacos(void)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
FPU_DOUBLE(x);
|
2002-07-19 03:24:50 +00:00
|
|
|
if (x < -1.0 || x > 1.0 || !finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
|
2001-01-10 23:59:25 +00:00
|
|
|
return acos(x);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _CIasin (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
double _CIasin(void)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
FPU_DOUBLE(x);
|
2002-07-19 03:24:50 +00:00
|
|
|
if (x < -1.0 || x > 1.0 || !finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
|
2001-01-10 23:59:25 +00:00
|
|
|
return asin(x);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _CIatan (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
double _CIatan(void)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
FPU_DOUBLE(x);
|
2002-07-19 03:24:50 +00:00
|
|
|
if (!finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
|
2001-01-10 23:59:25 +00:00
|
|
|
return atan(x);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _CIatan2 (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
double _CIatan2(void)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
FPU_DOUBLES(x,y);
|
2002-07-19 03:24:50 +00:00
|
|
|
if (!finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
|
2001-01-10 23:59:25 +00:00
|
|
|
return atan2(x,y);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _CIcos (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
double _CIcos(void)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
FPU_DOUBLE(x);
|
2002-07-19 03:24:50 +00:00
|
|
|
if (!finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
|
2001-01-10 23:59:25 +00:00
|
|
|
return cos(x);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _CIcosh (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
double _CIcosh(void)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
FPU_DOUBLE(x);
|
2002-07-19 03:24:50 +00:00
|
|
|
if (!finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
|
2001-01-10 23:59:25 +00:00
|
|
|
return cosh(x);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _CIexp (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
double _CIexp(void)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
FPU_DOUBLE(x);
|
2002-07-19 03:24:50 +00:00
|
|
|
if (!finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
|
2001-01-10 23:59:25 +00:00
|
|
|
return exp(x);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _CIfmod (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
double _CIfmod(void)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
FPU_DOUBLES(x,y);
|
2002-07-19 03:24:50 +00:00
|
|
|
if (!finite(x) || !finite(y)) *MSVCRT__errno() = MSVCRT_EDOM;
|
2001-01-10 23:59:25 +00:00
|
|
|
return fmod(x,y);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _CIlog (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
double _CIlog(void)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
FPU_DOUBLE(x);
|
2002-07-19 03:24:50 +00:00
|
|
|
if (x < 0.0 || !finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
|
|
|
|
if (x == 0.0) *MSVCRT__errno() = MSVCRT_ERANGE;
|
2001-01-10 23:59:25 +00:00
|
|
|
return log(x);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _CIlog10 (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
double _CIlog10(void)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
FPU_DOUBLE(x);
|
2002-07-19 03:24:50 +00:00
|
|
|
if (x < 0.0 || !finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
|
|
|
|
if (x == 0.0) *MSVCRT__errno() = MSVCRT_ERANGE;
|
2001-01-10 23:59:25 +00:00
|
|
|
return log10(x);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _CIpow (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
double _CIpow(void)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
double z;
|
|
|
|
FPU_DOUBLES(x,y);
|
|
|
|
/* FIXME: If x < 0 and y is not integral, set EDOM */
|
|
|
|
z = pow(x,y);
|
2002-07-19 03:24:50 +00:00
|
|
|
if (!finite(z)) *MSVCRT__errno() = MSVCRT_EDOM;
|
2001-01-10 23:59:25 +00:00
|
|
|
return z;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _CIsin (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
double _CIsin(void)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
FPU_DOUBLE(x);
|
2002-07-19 03:24:50 +00:00
|
|
|
if (!finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
|
2001-01-10 23:59:25 +00:00
|
|
|
return sin(x);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _CIsinh (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
double _CIsinh(void)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
FPU_DOUBLE(x);
|
2002-07-19 03:24:50 +00:00
|
|
|
if (!finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
|
2001-01-10 23:59:25 +00:00
|
|
|
return sinh(x);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _CIsqrt (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
double _CIsqrt(void)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
FPU_DOUBLE(x);
|
2002-07-19 03:24:50 +00:00
|
|
|
if (x < 0.0 || !finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
|
2001-01-10 23:59:25 +00:00
|
|
|
return sqrt(x);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _CItan (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
double _CItan(void)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
FPU_DOUBLE(x);
|
2002-07-19 03:24:50 +00:00
|
|
|
if (!finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
|
2001-01-10 23:59:25 +00:00
|
|
|
return tan(x);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _CItanh (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
double _CItanh(void)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
FPU_DOUBLE(x);
|
2002-07-19 03:24:50 +00:00
|
|
|
if (!finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
|
2001-01-10 23:59:25 +00:00
|
|
|
return tanh(x);
|
|
|
|
}
|
|
|
|
|
|
|
|
#else /* defined(__GNUC__) && defined(__i386__) */
|
|
|
|
|
|
|
|
/* The above cannot be called on non x86 platforms, stub them for linking */
|
|
|
|
|
2002-08-07 01:18:41 +00:00
|
|
|
#define IX86_ONLY(func) double func(void) { return 0.0; }
|
2001-01-10 23:59:25 +00:00
|
|
|
|
|
|
|
IX86_ONLY(_CIacos)
|
|
|
|
IX86_ONLY(_CIasin)
|
|
|
|
IX86_ONLY(_CIatan)
|
|
|
|
IX86_ONLY(_CIatan2)
|
|
|
|
IX86_ONLY(_CIcos)
|
|
|
|
IX86_ONLY(_CIcosh)
|
|
|
|
IX86_ONLY(_CIexp)
|
|
|
|
IX86_ONLY(_CIfmod)
|
|
|
|
IX86_ONLY(_CIlog)
|
|
|
|
IX86_ONLY(_CIlog10)
|
|
|
|
IX86_ONLY(_CIpow)
|
|
|
|
IX86_ONLY(_CIsin)
|
|
|
|
IX86_ONLY(_CIsinh)
|
|
|
|
IX86_ONLY(_CIsqrt)
|
|
|
|
IX86_ONLY(_CItan)
|
|
|
|
IX86_ONLY(_CItanh)
|
|
|
|
|
|
|
|
#endif /* defined(__GNUC__) && defined(__i386__) */
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _fpclass (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
int _fpclass(double num)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
#if defined(HAVE_FPCLASS) || defined(fpclass)
|
|
|
|
switch (fpclass( num ))
|
|
|
|
{
|
2004-04-08 19:49:49 +00:00
|
|
|
#ifdef FP_SNAN
|
2001-01-10 23:59:25 +00:00
|
|
|
case FP_SNAN: return _FPCLASS_SNAN;
|
2004-04-08 19:49:49 +00:00
|
|
|
#endif
|
|
|
|
#ifdef FP_QNAN
|
2001-01-10 23:59:25 +00:00
|
|
|
case FP_QNAN: return _FPCLASS_QNAN;
|
2004-04-08 19:49:49 +00:00
|
|
|
#endif
|
|
|
|
#ifdef FP_NINF
|
2001-01-10 23:59:25 +00:00
|
|
|
case FP_NINF: return _FPCLASS_NINF;
|
2004-04-08 19:49:49 +00:00
|
|
|
#endif
|
|
|
|
#ifdef FP_PINF
|
2001-01-10 23:59:25 +00:00
|
|
|
case FP_PINF: return _FPCLASS_PINF;
|
2004-04-08 19:49:49 +00:00
|
|
|
#endif
|
|
|
|
#ifdef FP_NDENORM
|
2001-01-10 23:59:25 +00:00
|
|
|
case FP_NDENORM: return _FPCLASS_ND;
|
2004-04-08 19:49:49 +00:00
|
|
|
#endif
|
|
|
|
#ifdef FP_PDENORM
|
2001-01-10 23:59:25 +00:00
|
|
|
case FP_PDENORM: return _FPCLASS_PD;
|
2004-04-08 19:49:49 +00:00
|
|
|
#endif
|
|
|
|
#ifdef FP_NZERO
|
2001-01-10 23:59:25 +00:00
|
|
|
case FP_NZERO: return _FPCLASS_NZ;
|
2004-04-08 19:49:49 +00:00
|
|
|
#endif
|
|
|
|
#ifdef FP_PZERO
|
2001-01-10 23:59:25 +00:00
|
|
|
case FP_PZERO: return _FPCLASS_PZ;
|
2004-04-08 19:49:49 +00:00
|
|
|
#endif
|
|
|
|
#ifdef FP_NNORM
|
2001-01-10 23:59:25 +00:00
|
|
|
case FP_NNORM: return _FPCLASS_NN;
|
2004-04-08 19:49:49 +00:00
|
|
|
#endif
|
|
|
|
#ifdef FP_PNORM
|
2002-04-01 21:03:53 +00:00
|
|
|
case FP_PNORM: return _FPCLASS_PN;
|
2004-04-08 19:49:49 +00:00
|
|
|
#endif
|
2001-01-10 23:59:25 +00:00
|
|
|
}
|
|
|
|
return _FPCLASS_PN;
|
|
|
|
#elif defined (fpclassify)
|
|
|
|
switch (fpclassify( num ))
|
|
|
|
{
|
|
|
|
case FP_NAN: return _FPCLASS_QNAN;
|
|
|
|
case FP_INFINITE: return signbit(num) ? _FPCLASS_NINF : _FPCLASS_PINF;
|
|
|
|
case FP_SUBNORMAL: return signbit(num) ?_FPCLASS_ND : _FPCLASS_PD;
|
|
|
|
case FP_ZERO: return signbit(num) ? _FPCLASS_NZ : _FPCLASS_PZ;
|
|
|
|
}
|
|
|
|
return signbit(num) ? _FPCLASS_NN : _FPCLASS_PN;
|
|
|
|
#else
|
|
|
|
if (!finite(num))
|
|
|
|
return _FPCLASS_QNAN;
|
2001-01-12 20:30:41 +00:00
|
|
|
return num == 0.0 ? _FPCLASS_PZ : (num < 0 ? _FPCLASS_NN : _FPCLASS_PN);
|
2001-01-10 23:59:25 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _rotl (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
unsigned int _rotl(unsigned int num, int shift)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
shift &= 31;
|
|
|
|
return (num << shift) | (num >> (32-shift));
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _logb (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
double _logb(double num)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
2002-07-19 03:24:50 +00:00
|
|
|
if (!finite(num)) *MSVCRT__errno() = MSVCRT_EDOM;
|
2001-01-10 23:59:25 +00:00
|
|
|
return logb(num);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _lrotl (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
unsigned long _lrotl(unsigned long num, int shift)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
shift &= 0x1f;
|
|
|
|
return (num << shift) | (num >> (32-shift));
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _lrotr (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
unsigned long _lrotr(unsigned long num, int shift)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
shift &= 0x1f;
|
|
|
|
return (num >> shift) | (num << (32-shift));
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _rotr (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
unsigned int _rotr(unsigned int num, int shift)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
shift &= 0x1f;
|
|
|
|
return (num >> shift) | (num << (32-shift));
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _scalb (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
double _scalb(double num, long power)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
/* Note - Can't forward directly as libc expects y as double */
|
|
|
|
double dblpower = (double)power;
|
2002-07-19 03:24:50 +00:00
|
|
|
if (!finite(num)) *MSVCRT__errno() = MSVCRT_EDOM;
|
2001-01-10 23:59:25 +00:00
|
|
|
return scalb(num, dblpower);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _matherr (MSVCRT.@)
|
|
|
|
*/
|
2004-03-16 19:17:11 +00:00
|
|
|
int MSVCRT__matherr(struct MSVCRT__exception *e)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
if (e)
|
|
|
|
TRACE("(%p = %d, %s, %g %g %g)\n",e, e->type, e->name, e->arg1, e->arg2,
|
|
|
|
e->retval);
|
|
|
|
else
|
|
|
|
TRACE("(null)\n");
|
|
|
|
if (MSVCRT_default_matherr_func)
|
|
|
|
return MSVCRT_default_matherr_func(e);
|
|
|
|
ERR(":Unhandled math error!\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* __setusermatherr (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
void MSVCRT___setusermatherr(MSVCRT_matherr_func func)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
MSVCRT_default_matherr_func = func;
|
|
|
|
TRACE(":new matherr handler %p\n", func);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
* _statusfp (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
unsigned int _statusfp(void)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
unsigned int retVal = 0;
|
|
|
|
#if defined(__GNUC__) && defined(__i386__)
|
|
|
|
unsigned int fpword;
|
|
|
|
|
|
|
|
__asm__ __volatile__( "fstsw %0" : "=m" (fpword) : );
|
|
|
|
if (fpword & 0x1) retVal |= _SW_INVALID;
|
|
|
|
if (fpword & 0x2) retVal |= _SW_DENORMAL;
|
|
|
|
if (fpword & 0x4) retVal |= _SW_ZERODIVIDE;
|
|
|
|
if (fpword & 0x8) retVal |= _SW_OVERFLOW;
|
|
|
|
if (fpword & 0x10) retVal |= _SW_UNDERFLOW;
|
|
|
|
if (fpword & 0x20) retVal |= _SW_INEXACT;
|
|
|
|
#else
|
|
|
|
FIXME(":Not implemented!\n");
|
|
|
|
#endif
|
|
|
|
return retVal;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _clearfp (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
unsigned int _clearfp(void)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
2001-04-10 21:16:07 +00:00
|
|
|
unsigned int retVal = _statusfp();
|
2001-01-10 23:59:25 +00:00
|
|
|
#if defined(__GNUC__) && defined(__i386__)
|
|
|
|
__asm__ __volatile__( "fnclex" );
|
|
|
|
#else
|
|
|
|
FIXME(":Not Implemented\n");
|
|
|
|
#endif
|
|
|
|
return retVal;
|
|
|
|
}
|
|
|
|
|
2004-01-13 05:45:05 +00:00
|
|
|
/*********************************************************************
|
|
|
|
* __fpecode (MSVCRT.@)
|
|
|
|
*/
|
|
|
|
int *__fpecode(void)
|
|
|
|
{
|
|
|
|
return &msvcrt_get_thread_data()->fpecode;
|
|
|
|
}
|
|
|
|
|
2001-01-10 23:59:25 +00:00
|
|
|
/*********************************************************************
|
|
|
|
* ldexp (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
double MSVCRT_ldexp(double num, long exp)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
double z = ldexp(num,exp);
|
|
|
|
|
|
|
|
if (!finite(z))
|
2002-07-19 03:24:50 +00:00
|
|
|
*MSVCRT__errno() = MSVCRT_ERANGE;
|
2001-01-10 23:59:25 +00:00
|
|
|
else if (z == 0 && signbit(z))
|
|
|
|
z = 0.0; /* Convert -0 -> +0 */
|
|
|
|
return z;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _cabs (MSVCRT.@)
|
|
|
|
*/
|
2004-03-16 19:17:11 +00:00
|
|
|
double MSVCRT__cabs(struct MSVCRT__complex num)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
2004-03-16 19:17:11 +00:00
|
|
|
return sqrt(num.x * num.x + num.y * num.y);
|
2001-01-10 23:59:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _chgsign (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
double _chgsign(double num)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
/* FIXME: +-infinity,Nan not tested */
|
|
|
|
return -num;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _control87 (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
unsigned int _control87(unsigned int newval, unsigned int mask)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
#if defined(__GNUC__) && defined(__i386__)
|
2001-08-13 20:03:29 +00:00
|
|
|
unsigned int fpword = 0;
|
|
|
|
unsigned int flags = 0;
|
|
|
|
|
|
|
|
TRACE("(%08x, %08x): Called\n", newval, mask);
|
2001-01-10 23:59:25 +00:00
|
|
|
|
|
|
|
/* Get fp control word */
|
2001-08-13 20:03:29 +00:00
|
|
|
__asm__ __volatile__( "fstcw %0" : "=m" (fpword) : );
|
|
|
|
|
|
|
|
TRACE("Control word before : %08x\n", fpword);
|
2001-01-10 23:59:25 +00:00
|
|
|
|
|
|
|
/* Convert into mask constants */
|
|
|
|
if (fpword & 0x1) flags |= _EM_INVALID;
|
|
|
|
if (fpword & 0x2) flags |= _EM_DENORMAL;
|
|
|
|
if (fpword & 0x4) flags |= _EM_ZERODIVIDE;
|
|
|
|
if (fpword & 0x8) flags |= _EM_OVERFLOW;
|
|
|
|
if (fpword & 0x10) flags |= _EM_UNDERFLOW;
|
|
|
|
if (fpword & 0x20) flags |= _EM_INEXACT;
|
|
|
|
switch(fpword & 0xC00) {
|
|
|
|
case 0xC00: flags |= _RC_UP|_RC_DOWN; break;
|
|
|
|
case 0x800: flags |= _RC_UP; break;
|
|
|
|
case 0x400: flags |= _RC_DOWN; break;
|
|
|
|
}
|
|
|
|
switch(fpword & 0x300) {
|
|
|
|
case 0x0: flags |= _PC_24; break;
|
|
|
|
case 0x200: flags |= _PC_53; break;
|
|
|
|
case 0x300: flags |= _PC_64; break;
|
|
|
|
}
|
|
|
|
if (fpword & 0x1000) flags |= _IC_AFFINE;
|
|
|
|
|
|
|
|
/* Mask with parameters */
|
|
|
|
flags = (flags & ~mask) | (newval & mask);
|
|
|
|
|
|
|
|
/* Convert (masked) value back to fp word */
|
|
|
|
fpword = 0;
|
|
|
|
if (flags & _EM_INVALID) fpword |= 0x1;
|
|
|
|
if (flags & _EM_DENORMAL) fpword |= 0x2;
|
|
|
|
if (flags & _EM_ZERODIVIDE) fpword |= 0x4;
|
|
|
|
if (flags & _EM_OVERFLOW) fpword |= 0x8;
|
|
|
|
if (flags & _EM_UNDERFLOW) fpword |= 0x10;
|
|
|
|
if (flags & _EM_INEXACT) fpword |= 0x20;
|
|
|
|
switch(flags & (_RC_UP | _RC_DOWN)) {
|
|
|
|
case _RC_UP|_RC_DOWN: fpword |= 0xC00; break;
|
|
|
|
case _RC_UP: fpword |= 0x800; break;
|
|
|
|
case _RC_DOWN: fpword |= 0x400; break;
|
|
|
|
}
|
|
|
|
switch (flags & (_PC_24 | _PC_53)) {
|
|
|
|
case _PC_64: fpword |= 0x300; break;
|
|
|
|
case _PC_53: fpword |= 0x200; break;
|
|
|
|
case _PC_24: fpword |= 0x0; break;
|
|
|
|
}
|
2001-08-13 20:03:29 +00:00
|
|
|
if (flags & _IC_AFFINE) fpword |= 0x1000;
|
|
|
|
|
|
|
|
TRACE("Control word after : %08x\n", fpword);
|
2001-01-10 23:59:25 +00:00
|
|
|
|
|
|
|
/* Put fp control word */
|
|
|
|
__asm__ __volatile__( "fldcw %0" : : "m" (fpword) );
|
2001-08-13 20:03:29 +00:00
|
|
|
|
|
|
|
return flags;
|
2001-01-10 23:59:25 +00:00
|
|
|
#else
|
2001-08-13 20:03:29 +00:00
|
|
|
FIXME(":Not Implemented!\n");
|
|
|
|
return 0;
|
2001-01-10 23:59:25 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _controlfp (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
unsigned int _controlfp(unsigned int newval, unsigned int mask)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
2002-05-16 23:08:01 +00:00
|
|
|
#ifdef __i386__
|
2001-08-13 20:03:29 +00:00
|
|
|
return _control87( newval, mask & ~_EM_DENORMAL );
|
2002-05-16 23:08:01 +00:00
|
|
|
#else
|
|
|
|
FIXME(":Not Implemented!\n");
|
|
|
|
return 0;
|
|
|
|
#endif
|
2001-01-10 23:59:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _copysign (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
double _copysign(double num, double sign)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
/* FIXME: Behaviour for Nan/Inf? */
|
|
|
|
if (sign < 0.0)
|
|
|
|
return num < 0.0 ? num : -num;
|
|
|
|
return num < 0.0 ? -num : num;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _finite (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
int _finite(double num)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
return (finite(num)?1:0); /* See comment for _isnan() */
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _fpreset (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
void _fpreset(void)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
#if defined(__GNUC__) && defined(__i386__)
|
|
|
|
__asm__ __volatile__( "fninit" );
|
|
|
|
#else
|
|
|
|
FIXME(":Not Implemented!\n");
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _isnan (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
INT _isnan(double num)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
/* Some implementations return -1 for true(glibc), msvcrt/crtdll return 1.
|
|
|
|
* Do the same, as the result may be used in calculations
|
|
|
|
*/
|
|
|
|
return isnan(num) ? 1 : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _y0 (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
double _y0(double num)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
double retval;
|
2002-07-19 03:24:50 +00:00
|
|
|
if (!finite(num)) *MSVCRT__errno() = MSVCRT_EDOM;
|
2001-01-10 23:59:25 +00:00
|
|
|
retval = y0(num);
|
2001-04-10 21:16:07 +00:00
|
|
|
if (_fpclass(retval) == _FPCLASS_NINF)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
2002-07-19 03:24:50 +00:00
|
|
|
*MSVCRT__errno() = MSVCRT_EDOM;
|
2001-01-10 23:59:25 +00:00
|
|
|
retval = sqrt(-1);
|
|
|
|
}
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _y1 (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
double _y1(double num)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
double retval;
|
2002-07-19 03:24:50 +00:00
|
|
|
if (!finite(num)) *MSVCRT__errno() = MSVCRT_EDOM;
|
2001-01-10 23:59:25 +00:00
|
|
|
retval = y1(num);
|
2001-04-10 21:16:07 +00:00
|
|
|
if (_fpclass(retval) == _FPCLASS_NINF)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
2002-07-19 03:24:50 +00:00
|
|
|
*MSVCRT__errno() = MSVCRT_EDOM;
|
2001-01-10 23:59:25 +00:00
|
|
|
retval = sqrt(-1);
|
|
|
|
}
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _yn (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
double _yn(int order, double num)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
double retval;
|
2002-07-19 03:24:50 +00:00
|
|
|
if (!finite(num)) *MSVCRT__errno() = MSVCRT_EDOM;
|
2001-01-10 23:59:25 +00:00
|
|
|
retval = yn(order,num);
|
2001-04-10 21:16:07 +00:00
|
|
|
if (_fpclass(retval) == _FPCLASS_NINF)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
2002-07-19 03:24:50 +00:00
|
|
|
*MSVCRT__errno() = MSVCRT_EDOM;
|
2001-01-10 23:59:25 +00:00
|
|
|
retval = sqrt(-1);
|
|
|
|
}
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* _nextafter (MSVCRT.@)
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
double _nextafter(double num, double next)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
double retval;
|
2002-07-19 03:24:50 +00:00
|
|
|
if (!finite(num) || !finite(next)) *MSVCRT__errno() = MSVCRT_EDOM;
|
2001-01-10 23:59:25 +00:00
|
|
|
retval = nextafter(num,next);
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
2003-03-20 23:47:25 +00:00
|
|
|
/*********************************************************************
|
|
|
|
* _ecvt (MSVCRT.@)
|
|
|
|
*/
|
|
|
|
char *_ecvt( double number, int ndigits, int *decpt, int *sign )
|
|
|
|
{
|
|
|
|
MSVCRT_thread_data *data = msvcrt_get_thread_data();
|
|
|
|
char *dec;
|
|
|
|
|
|
|
|
if (!data->efcvt_buffer)
|
|
|
|
data->efcvt_buffer = MSVCRT_malloc( 80 ); /* ought to be enough */
|
|
|
|
|
|
|
|
snprintf(data->efcvt_buffer, 80, "%.*e", ndigits /* FIXME wrong */, number);
|
|
|
|
*sign = (number < 0);
|
|
|
|
dec = strchr(data->efcvt_buffer, '.');
|
|
|
|
*decpt = (dec) ? dec - data->efcvt_buffer : -1;
|
|
|
|
return data->efcvt_buffer;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* _fcvt (MSVCRT.@)
|
|
|
|
*/
|
|
|
|
char *_fcvt( double number, int ndigits, int *decpt, int *sign )
|
|
|
|
{
|
|
|
|
MSVCRT_thread_data *data = msvcrt_get_thread_data();
|
|
|
|
char *dec;
|
|
|
|
|
|
|
|
if (!data->efcvt_buffer)
|
|
|
|
data->efcvt_buffer = MSVCRT_malloc( 80 ); /* ought to be enough */
|
|
|
|
|
|
|
|
snprintf(data->efcvt_buffer, 80, "%.*e", ndigits, number);
|
|
|
|
*sign = (number < 0);
|
|
|
|
dec = strchr(data->efcvt_buffer, '.');
|
|
|
|
*decpt = (dec) ? dec - data->efcvt_buffer : -1;
|
|
|
|
return data->efcvt_buffer;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* _gcvt (MSVCRT.@)
|
|
|
|
*
|
|
|
|
* FIXME: uses both E and F.
|
|
|
|
*/
|
|
|
|
char *_gcvt( double number, int ndigit, char *buff )
|
|
|
|
{
|
|
|
|
sprintf(buff, "%.*E", ndigit, number);
|
|
|
|
return buff;
|
|
|
|
}
|
|
|
|
|
2001-01-10 23:59:25 +00:00
|
|
|
#include <stdlib.h> /* div_t, ldiv_t */
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* div (MSVCRT.@)
|
|
|
|
* VERSION
|
|
|
|
* [i386] Windows binary compatible - returns the struct in eax/edx.
|
|
|
|
*/
|
|
|
|
#ifdef __i386__
|
2003-11-28 23:17:28 +00:00
|
|
|
unsigned __int64 MSVCRT_div(int num, int denom)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
div_t dt = div(num,denom);
|
2003-11-28 23:17:28 +00:00
|
|
|
return ((unsigned __int64)dt.rem << 32) | (unsigned int)dt.quot;
|
2001-01-10 23:59:25 +00:00
|
|
|
}
|
|
|
|
#else
|
|
|
|
/*********************************************************************
|
|
|
|
* div (MSVCRT.@)
|
|
|
|
* VERSION
|
|
|
|
* [!i386] Non-x86 can't run win32 apps so we don't need binary compatibility
|
|
|
|
*/
|
2001-04-10 23:25:25 +00:00
|
|
|
MSVCRT_div_t MSVCRT_div(int num, int denom)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
2002-05-16 23:08:01 +00:00
|
|
|
div_t dt = div(num,denom);
|
|
|
|
MSVCRT_div_t ret;
|
|
|
|
ret.quot = dt.quot;
|
|
|
|
ret.rem = dt.rem;
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
2001-01-10 23:59:25 +00:00
|
|
|
}
|
|
|
|
#endif /* ifdef __i386__ */
|
|
|
|
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
* ldiv (MSVCRT.@)
|
|
|
|
* VERSION
|
|
|
|
* [i386] Windows binary compatible - returns the struct in eax/edx.
|
|
|
|
*/
|
|
|
|
#ifdef __i386__
|
2003-11-28 23:17:28 +00:00
|
|
|
unsigned __int64 MSVCRT_ldiv(long num, long denom)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
|
|
|
ldiv_t ldt = ldiv(num,denom);
|
2003-11-28 23:17:28 +00:00
|
|
|
return ((unsigned __int64)ldt.rem << 32) | (unsigned long)ldt.quot;
|
2001-01-10 23:59:25 +00:00
|
|
|
}
|
|
|
|
#else
|
|
|
|
/*********************************************************************
|
|
|
|
* ldiv (MSVCRT.@)
|
|
|
|
* VERSION
|
|
|
|
* [!i386] Non-x86 can't run win32 apps so we don't need binary compatibility
|
|
|
|
*/
|
2001-04-10 23:25:25 +00:00
|
|
|
MSVCRT_ldiv_t MSVCRT_ldiv(long num, long denom)
|
2001-01-10 23:59:25 +00:00
|
|
|
{
|
2002-05-16 23:08:01 +00:00
|
|
|
ldiv_t result = ldiv(num,denom);
|
|
|
|
|
|
|
|
MSVCRT_ldiv_t ret;
|
|
|
|
ret.quot = result.quot;
|
|
|
|
ret.rem = result.rem;
|
|
|
|
|
|
|
|
return ret;
|
2001-01-10 23:59:25 +00:00
|
|
|
}
|
|
|
|
#endif /* ifdef __i386__ */
|
|
|
|
|
2001-02-12 03:45:09 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* _adj_fdiv_m16i (MSVCRT.@)
|
|
|
|
*
|
|
|
|
* NOTE
|
|
|
|
* I _think_ this function is intended to work around the Pentium
|
|
|
|
* fdiv bug.
|
|
|
|
*/
|
2004-05-12 23:22:36 +00:00
|
|
|
void __stdcall _adj_fdiv_m16i( short arg )
|
2001-02-12 03:45:09 +00:00
|
|
|
{
|
2001-05-09 17:31:31 +00:00
|
|
|
TRACE("(): stub\n");
|
2001-02-12 03:45:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* _adj_fdiv_m32 (MSVCRT.@)
|
|
|
|
*
|
|
|
|
* NOTE
|
|
|
|
* I _think_ this function is intended to work around the Pentium
|
|
|
|
* fdiv bug.
|
|
|
|
*/
|
2004-05-12 23:22:36 +00:00
|
|
|
void __stdcall _adj_fdiv_m32( unsigned int arg )
|
2001-02-12 03:45:09 +00:00
|
|
|
{
|
2001-05-09 17:31:31 +00:00
|
|
|
TRACE("(): stub\n");
|
2001-02-12 03:45:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* _adj_fdiv_m32i (MSVCRT.@)
|
|
|
|
*
|
|
|
|
* NOTE
|
|
|
|
* I _think_ this function is intended to work around the Pentium
|
|
|
|
* fdiv bug.
|
|
|
|
*/
|
2004-05-12 23:22:36 +00:00
|
|
|
void __stdcall _adj_fdiv_m32i( int arg )
|
2001-02-12 03:45:09 +00:00
|
|
|
{
|
2001-05-09 17:31:31 +00:00
|
|
|
TRACE("(): stub\n");
|
2001-02-12 03:45:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* _adj_fdiv_m64 (MSVCRT.@)
|
|
|
|
*
|
|
|
|
* NOTE
|
|
|
|
* I _think_ this function is intended to work around the Pentium
|
|
|
|
* fdiv bug.
|
|
|
|
*/
|
2004-05-12 23:22:36 +00:00
|
|
|
void __stdcall _adj_fdiv_m64( unsigned __int64 arg )
|
2001-02-12 03:45:09 +00:00
|
|
|
{
|
2001-05-09 17:31:31 +00:00
|
|
|
TRACE("(): stub\n");
|
2001-02-12 03:45:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* _adj_fdiv_r (MSVCRT.@)
|
|
|
|
* FIXME
|
|
|
|
* This function is likely to have the wrong number of arguments.
|
|
|
|
*
|
|
|
|
* NOTE
|
|
|
|
* I _think_ this function is intended to work around the Pentium
|
|
|
|
* fdiv bug.
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
void _adj_fdiv_r(void)
|
2001-02-12 03:45:09 +00:00
|
|
|
{
|
2001-05-09 17:31:31 +00:00
|
|
|
TRACE("(): stub\n");
|
2001-02-12 03:45:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* _adj_fdivr_m16i (MSVCRT.@)
|
|
|
|
*
|
|
|
|
* NOTE
|
|
|
|
* I _think_ this function is intended to work around the Pentium
|
|
|
|
* fdiv bug.
|
|
|
|
*/
|
2004-05-12 23:22:36 +00:00
|
|
|
void __stdcall _adj_fdivr_m16i( short arg )
|
2001-02-12 03:45:09 +00:00
|
|
|
{
|
2001-05-09 17:31:31 +00:00
|
|
|
TRACE("(): stub\n");
|
2001-02-12 03:45:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* _adj_fdivr_m32 (MSVCRT.@)
|
|
|
|
*
|
|
|
|
* NOTE
|
|
|
|
* I _think_ this function is intended to work around the Pentium
|
|
|
|
* fdiv bug.
|
|
|
|
*/
|
2004-05-12 23:22:36 +00:00
|
|
|
void __stdcall _adj_fdivr_m32( unsigned int arg )
|
2001-02-12 03:45:09 +00:00
|
|
|
{
|
2001-05-09 17:31:31 +00:00
|
|
|
TRACE("(): stub\n");
|
2001-02-12 03:45:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* _adj_fdivr_m32i (MSVCRT.@)
|
|
|
|
*
|
|
|
|
* NOTE
|
|
|
|
* I _think_ this function is intended to work around the Pentium
|
|
|
|
* fdiv bug.
|
|
|
|
*/
|
2004-05-12 23:22:36 +00:00
|
|
|
void __stdcall _adj_fdivr_m32i( int arg )
|
2001-02-12 03:45:09 +00:00
|
|
|
{
|
2001-05-09 17:31:31 +00:00
|
|
|
TRACE("(): stub\n");
|
2001-02-12 03:45:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* _adj_fdivr_m64 (MSVCRT.@)
|
|
|
|
*
|
|
|
|
* NOTE
|
|
|
|
* I _think_ this function is intended to work around the Pentium
|
|
|
|
* fdiv bug.
|
|
|
|
*/
|
2004-05-12 23:22:36 +00:00
|
|
|
void __stdcall _adj_fdivr_m64( unsigned __int64 arg )
|
2001-02-12 03:45:09 +00:00
|
|
|
{
|
2001-05-09 17:31:31 +00:00
|
|
|
TRACE("(): stub\n");
|
2001-02-12 03:45:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* _adj_fpatan (MSVCRT.@)
|
|
|
|
* FIXME
|
|
|
|
* This function is likely to have the wrong number of arguments.
|
|
|
|
*
|
|
|
|
* NOTE
|
|
|
|
* I _think_ this function is intended to work around the Pentium
|
|
|
|
* fdiv bug.
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
void _adj_fpatan(void)
|
2001-02-12 03:45:09 +00:00
|
|
|
{
|
2001-05-09 17:31:31 +00:00
|
|
|
TRACE("(): stub\n");
|
2001-02-12 03:45:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* _adj_fprem (MSVCRT.@)
|
|
|
|
* FIXME
|
|
|
|
* This function is likely to have the wrong number of arguments.
|
|
|
|
*
|
|
|
|
* NOTE
|
|
|
|
* I _think_ this function is intended to work around the Pentium
|
|
|
|
* fdiv bug.
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
void _adj_fprem(void)
|
2001-02-12 03:45:09 +00:00
|
|
|
{
|
2001-05-09 17:31:31 +00:00
|
|
|
TRACE("(): stub\n");
|
2001-02-12 03:45:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* _adj_fprem1 (MSVCRT.@)
|
|
|
|
* FIXME
|
|
|
|
* This function is likely to have the wrong number of arguments.
|
|
|
|
*
|
|
|
|
* NOTE
|
|
|
|
* I _think_ this function is intended to work around the Pentium
|
|
|
|
* fdiv bug.
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
void _adj_fprem1(void)
|
2001-02-12 03:45:09 +00:00
|
|
|
{
|
2001-05-09 17:31:31 +00:00
|
|
|
TRACE("(): stub\n");
|
2001-02-12 03:45:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* _adj_fptan (MSVCRT.@)
|
|
|
|
* FIXME
|
|
|
|
* This function is likely to have the wrong number of arguments.
|
|
|
|
*
|
|
|
|
* NOTE
|
|
|
|
* I _think_ this function is intended to work around the Pentium
|
|
|
|
* fdiv bug.
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
void _adj_fptan(void)
|
2001-02-12 03:45:09 +00:00
|
|
|
{
|
2001-05-09 17:31:31 +00:00
|
|
|
TRACE("(): stub\n");
|
2001-02-12 03:45:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* _adjust_fdiv (MSVCRT.@)
|
|
|
|
* FIXME
|
|
|
|
* I _think_ this function should be a variable indicating whether
|
|
|
|
* Pentium fdiv bug safe code should be used.
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
void _adjust_fdiv(void)
|
2001-02-12 03:45:09 +00:00
|
|
|
{
|
2001-05-09 17:31:31 +00:00
|
|
|
TRACE("(): stub\n");
|
2001-02-12 03:45:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* _safe_fdiv (MSVCRT.@)
|
|
|
|
* FIXME
|
|
|
|
* This function is likely to have the wrong number of arguments.
|
|
|
|
*
|
|
|
|
* NOTE
|
|
|
|
* I _think_ this function is intended to work around the Pentium
|
|
|
|
* fdiv bug.
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
void _safe_fdiv(void)
|
2001-02-12 03:45:09 +00:00
|
|
|
{
|
2001-05-09 17:31:31 +00:00
|
|
|
TRACE("(): stub\n");
|
2001-02-12 03:45:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* _safe_fdivr (MSVCRT.@)
|
|
|
|
* FIXME
|
|
|
|
* This function is likely to have the wrong number of arguments.
|
|
|
|
*
|
|
|
|
* NOTE
|
|
|
|
* I _think_ this function is intended to work around the Pentium
|
|
|
|
* fdiv bug.
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
void _safe_fdivr(void)
|
2001-02-12 03:45:09 +00:00
|
|
|
{
|
2001-05-09 17:31:31 +00:00
|
|
|
TRACE("(): stub\n");
|
2001-02-12 03:45:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* _safe_fprem (MSVCRT.@)
|
|
|
|
* FIXME
|
|
|
|
* This function is likely to have the wrong number of arguments.
|
|
|
|
*
|
|
|
|
* NOTE
|
|
|
|
* I _think_ this function is intended to work around the Pentium
|
|
|
|
* fdiv bug.
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
void _safe_fprem(void)
|
2001-02-12 03:45:09 +00:00
|
|
|
{
|
2001-05-09 17:31:31 +00:00
|
|
|
TRACE("(): stub\n");
|
2001-02-12 03:45:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* _safe_fprem1 (MSVCRT.@)
|
|
|
|
*
|
|
|
|
* FIXME
|
|
|
|
* This function is likely to have the wrong number of arguments.
|
|
|
|
*
|
|
|
|
* NOTE
|
|
|
|
* I _think_ this function is intended to work around the Pentium
|
|
|
|
* fdiv bug.
|
|
|
|
*/
|
2001-04-10 21:16:07 +00:00
|
|
|
void _safe_fprem1(void)
|
2001-02-12 03:45:09 +00:00
|
|
|
{
|
2001-05-09 17:31:31 +00:00
|
|
|
TRACE("(): stub\n");
|
2001-02-12 03:45:09 +00:00
|
|
|
}
|