Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
c7454eef
Commit
c7454eef
authored
Oct 26, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Move math functions to a separate file.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bbff1238
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
178 additions
and
153 deletions
+178
-153
Makefile.in
dlls/ntdll/Makefile.in
+1
-0
math.c
dlls/ntdll/math.c
+177
-0
misc.c
dlls/ntdll/misc.c
+0
-153
No files found.
dlls/ntdll/Makefile.in
View file @
c7454eef
...
...
@@ -22,6 +22,7 @@ C_SRCS = \
large_int.c
\
loader.c
\
locale.c
\
math.c
\
misc.c
\
path.c
\
printf.c
\
...
...
dlls/ntdll/math.c
0 → 100644
View file @
c7454eef
/*
* Math functions
*
* Copyright 2021 Alexandre Julliard
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <math.h>
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "ntdll_misc.h"
/*********************************************************************
* abs (NTDLL.@)
*/
int
CDECL
abs
(
int
i
)
{
return
i
>=
0
?
i
:
-
i
;
}
/*********************************************************************
* atan (NTDLL.@)
*/
double
CDECL
atan
(
double
d
)
{
return
unix_funcs
->
atan
(
d
);
}
/*********************************************************************
* ceil (NTDLL.@)
*/
double
CDECL
ceil
(
double
d
)
{
return
unix_funcs
->
ceil
(
d
);
}
/*********************************************************************
* cos (NTDLL.@)
*/
double
CDECL
cos
(
double
d
)
{
return
unix_funcs
->
cos
(
d
);
}
/*********************************************************************
* fabs (NTDLL.@)
*/
double
CDECL
fabs
(
double
d
)
{
return
unix_funcs
->
fabs
(
d
);
}
/*********************************************************************
* floor (NTDLL.@)
*/
double
CDECL
floor
(
double
d
)
{
return
unix_funcs
->
floor
(
d
);
}
/*********************************************************************
* log (NTDLL.@)
*/
double
CDECL
log
(
double
d
)
{
return
unix_funcs
->
log
(
d
);
}
/*********************************************************************
* pow (NTDLL.@)
*/
double
CDECL
pow
(
double
x
,
double
y
)
{
return
unix_funcs
->
pow
(
x
,
y
);
}
/*********************************************************************
* sin (NTDLL.@)
*/
double
CDECL
sin
(
double
d
)
{
return
unix_funcs
->
sin
(
d
);
}
/*********************************************************************
* sqrt (NTDLL.@)
*/
double
CDECL
sqrt
(
double
d
)
{
return
unix_funcs
->
sqrt
(
d
);
}
/*********************************************************************
* tan (NTDLL.@)
*/
double
CDECL
tan
(
double
d
)
{
return
unix_funcs
->
tan
(
d
);
}
#if (defined(__GNUC__) || defined(__clang__)) && 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) : )
/*********************************************************************
* _CIcos (NTDLL.@)
*/
double
CDECL
_CIcos
(
void
)
{
FPU_DOUBLE
(
x
);
return
cos
(
x
);
}
/*********************************************************************
* _CIlog (NTDLL.@)
*/
double
CDECL
_CIlog
(
void
)
{
FPU_DOUBLE
(
x
);
return
log
(
x
);
}
/*********************************************************************
* _CIpow (NTDLL.@)
*/
double
CDECL
_CIpow
(
void
)
{
FPU_DOUBLES
(
x
,
y
);
return
pow
(
x
,
y
);
}
/*********************************************************************
* _CIsin (NTDLL.@)
*/
double
CDECL
_CIsin
(
void
)
{
FPU_DOUBLE
(
x
);
return
sin
(
x
);
}
/*********************************************************************
* _CIsqrt (NTDLL.@)
*/
double
CDECL
_CIsqrt
(
void
)
{
FPU_DOUBLE
(
x
);
return
sqrt
(
x
);
}
/*********************************************************************
* _ftol (NTDLL.@)
*/
LONGLONG
CDECL
_ftol
(
void
)
{
FPU_DOUBLE
(
x
);
return
(
LONGLONG
)
x
;
}
#endif
/* (defined(__GNUC__) || defined(__clang__)) && defined(__i386__) */
dlls/ntdll/misc.c
View file @
c7454eef
...
...
@@ -20,7 +20,6 @@
*/
#include <time.h>
#include <math.h>
#include "ntstatus.h"
#define WIN32_NO_STATUS
...
...
@@ -38,158 +37,6 @@ LPCSTR debugstr_us( const UNICODE_STRING *us )
return
debugstr_wn
(
us
->
Buffer
,
us
->
Length
/
sizeof
(
WCHAR
));
}
/*********************************************************************
* abs (NTDLL.@)
*/
int
CDECL
abs
(
int
i
)
{
return
i
>=
0
?
i
:
-
i
;
}
/*********************************************************************
* atan (NTDLL.@)
*/
double
CDECL
atan
(
double
d
)
{
return
unix_funcs
->
atan
(
d
);
}
/*********************************************************************
* ceil (NTDLL.@)
*/
double
CDECL
ceil
(
double
d
)
{
return
unix_funcs
->
ceil
(
d
);
}
/*********************************************************************
* cos (NTDLL.@)
*/
double
CDECL
cos
(
double
d
)
{
return
unix_funcs
->
cos
(
d
);
}
/*********************************************************************
* fabs (NTDLL.@)
*/
double
CDECL
fabs
(
double
d
)
{
return
unix_funcs
->
fabs
(
d
);
}
/*********************************************************************
* floor (NTDLL.@)
*/
double
CDECL
floor
(
double
d
)
{
return
unix_funcs
->
floor
(
d
);
}
/*********************************************************************
* log (NTDLL.@)
*/
double
CDECL
log
(
double
d
)
{
return
unix_funcs
->
log
(
d
);
}
/*********************************************************************
* pow (NTDLL.@)
*/
double
CDECL
pow
(
double
x
,
double
y
)
{
return
unix_funcs
->
pow
(
x
,
y
);
}
/*********************************************************************
* sin (NTDLL.@)
*/
double
CDECL
sin
(
double
d
)
{
return
unix_funcs
->
sin
(
d
);
}
/*********************************************************************
* sqrt (NTDLL.@)
*/
double
CDECL
sqrt
(
double
d
)
{
return
unix_funcs
->
sqrt
(
d
);
}
/*********************************************************************
* tan (NTDLL.@)
*/
double
CDECL
tan
(
double
d
)
{
return
unix_funcs
->
tan
(
d
);
}
#if (defined(__GNUC__) || defined(__clang__)) && 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) : )
/*********************************************************************
* _CIcos (NTDLL.@)
*/
double
CDECL
_CIcos
(
void
)
{
FPU_DOUBLE
(
x
);
return
cos
(
x
);
}
/*********************************************************************
* _CIlog (NTDLL.@)
*/
double
CDECL
_CIlog
(
void
)
{
FPU_DOUBLE
(
x
);
return
log
(
x
);
}
/*********************************************************************
* _CIpow (NTDLL.@)
*/
double
CDECL
_CIpow
(
void
)
{
FPU_DOUBLES
(
x
,
y
);
return
pow
(
x
,
y
);
}
/*********************************************************************
* _CIsin (NTDLL.@)
*/
double
CDECL
_CIsin
(
void
)
{
FPU_DOUBLE
(
x
);
return
sin
(
x
);
}
/*********************************************************************
* _CIsqrt (NTDLL.@)
*/
double
CDECL
_CIsqrt
(
void
)
{
FPU_DOUBLE
(
x
);
return
sqrt
(
x
);
}
/*********************************************************************
* _ftol (NTDLL.@)
*/
LONGLONG
CDECL
_ftol
(
void
)
{
FPU_DOUBLE
(
x
);
return
(
LONGLONG
)
x
;
}
#endif
/* (defined(__GNUC__) || defined(__clang__)) && defined(__i386__) */
static
void
NTDLL_mergesort
(
void
*
arr
,
void
*
barr
,
size_t
elemsize
,
int
(
__cdecl
*
compar
)(
const
void
*
,
const
void
*
),
size_t
left
,
size_t
right
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment