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
20c53e72
Commit
20c53e72
authored
Apr 10, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Use the sqrtf() implementation from the bundled musl library.
parent
bfc3a2bd
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
12 additions
and
68 deletions
+12
-68
msvcr100.spec
dlls/msvcr100/msvcr100.spec
+1
-1
msvcr110.spec
dlls/msvcr110/msvcr110.spec
+1
-1
msvcr120.spec
dlls/msvcr120/msvcr120.spec
+1
-1
msvcr80.spec
dlls/msvcr80/msvcr80.spec
+1
-1
msvcr90.spec
dlls/msvcr90/msvcr90.spec
+1
-1
math.c
dlls/msvcrt/math.c
+3
-59
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+1
-1
ucrtbase.spec
dlls/ucrtbase/ucrtbase.spec
+2
-2
sqrtf.c
libs/musl/src/math/sqrtf.c
+1
-1
No files found.
dlls/msvcr100/msvcr100.spec
View file @
20c53e72
...
...
@@ -1791,7 +1791,7 @@
@ varargs sprintf(ptr str)
@ varargs sprintf_s(ptr long str)
@ cdecl sqrt(double)
@ cdecl -arch=!i386 sqrtf(float)
@ cdecl -arch=!i386 sqrtf(float)
MSVCRT_sqrtf
@ cdecl srand(long)
@ varargs sscanf(str str)
@ varargs sscanf_s(str str)
...
...
dlls/msvcr110/msvcr110.spec
View file @
20c53e72
...
...
@@ -2149,7 +2149,7 @@
@ varargs sprintf(ptr str)
@ varargs sprintf_s(ptr long str)
@ cdecl sqrt(double)
@ cdecl -arch=!i386 sqrtf(float)
@ cdecl -arch=!i386 sqrtf(float)
MSVCRT_sqrtf
@ cdecl srand(long)
@ varargs sscanf(str str)
@ varargs sscanf_s(str str)
...
...
dlls/msvcr120/msvcr120.spec
View file @
20c53e72
...
...
@@ -2360,7 +2360,7 @@
@ varargs sprintf(ptr str)
@ varargs sprintf_s(ptr long str)
@ cdecl sqrt(double)
@ cdecl -arch=!i386 sqrtf(float)
@ cdecl -arch=!i386 sqrtf(float)
MSVCRT_sqrtf
@ cdecl srand(long)
@ varargs sscanf(str str)
@ varargs sscanf_s(str str)
...
...
dlls/msvcr80/msvcr80.spec
View file @
20c53e72
...
...
@@ -1472,7 +1472,7 @@
@ varargs sprintf(ptr str)
@ varargs sprintf_s(ptr long str)
@ cdecl sqrt(double)
@ cdecl -arch=!i386 sqrtf(float)
@ cdecl -arch=!i386 sqrtf(float)
MSVCRT_sqrtf
@ cdecl srand(long)
@ varargs sscanf(str str)
@ varargs sscanf_s(str str)
...
...
dlls/msvcr90/msvcr90.spec
View file @
20c53e72
...
...
@@ -1444,7 +1444,7 @@
@ varargs sprintf(ptr str)
@ varargs sprintf_s(ptr long str)
@ cdecl sqrt(double)
@ cdecl -arch=!i386 sqrtf(float)
@ cdecl -arch=!i386 sqrtf(float)
MSVCRT_sqrtf
@ cdecl srand(long)
@ varargs sscanf(str str)
@ varargs sscanf_s(str str)
...
...
dlls/msvcrt/math.c
View file @
20c53e72
...
...
@@ -288,6 +288,7 @@ float CDECL MSVCRT_atanf( float x )
}
#endif
#ifdef __x86_64__
static
BOOL
sqrtf_validate
(
float
*
x
)
{
short
c
=
_fdclass
(
*
x
);
...
...
@@ -303,7 +304,6 @@ static BOOL sqrtf_validate( float *x )
return
TRUE
;
}
#if defined(__x86_64__) || defined(__i386__)
float
CDECL
sse2_sqrtf
(
float
);
__ASM_GLOBAL_FUNC
(
sse2_sqrtf
,
"sqrtss %xmm0, %xmm0
\n\t
"
...
...
@@ -312,10 +312,8 @@ __ASM_GLOBAL_FUNC( sse2_sqrtf,
/*********************************************************************
* sqrtf (MSVCRT.@)
*
* Copied from musl: src/math/sqrtf.c
*/
float
CDECL
sqrtf
(
float
x
)
float
CDECL
MSVCRT_
sqrtf
(
float
x
)
{
#ifdef __x86_64__
if
(
!
sqrtf_validate
(
&
x
))
...
...
@@ -323,61 +321,7 @@ float CDECL sqrtf( float x )
return
sse2_sqrtf
(
x
);
#else
static
const
float
tiny
=
1.0e-30
;
float
z
;
int
ix
,
s
,
q
,
m
,
t
,
i
;
unsigned
int
r
;
ix
=
*
(
int
*
)
&
x
;
if
(
!
sqrtf_validate
(
&
x
))
return
x
;
/* normalize x */
m
=
ix
>>
23
;
if
(
m
==
0
)
{
/* subnormal x */
for
(
i
=
0
;
(
ix
&
0x00800000
)
==
0
;
i
++
)
ix
<<=
1
;
m
-=
i
-
1
;
}
m
-=
127
;
/* unbias exponent */
ix
=
(
ix
&
0x007fffff
)
|
0x00800000
;
if
(
m
&
1
)
/* odd m, double x to make it even */
ix
+=
ix
;
m
>>=
1
;
/* m = [m/2] */
/* generate sqrt(x) bit by bit */
ix
+=
ix
;
q
=
s
=
0
;
/* q = sqrt(x) */
r
=
0x01000000
;
/* r = moving bit from right to left */
while
(
r
!=
0
)
{
t
=
s
+
r
;
if
(
t
<=
ix
)
{
s
=
t
+
r
;
ix
-=
t
;
q
+=
r
;
}
ix
+=
ix
;
r
>>=
1
;
}
/* use floating add to find out rounding direction */
if
(
ix
!=
0
)
{
z
=
1
.
0
f
-
tiny
;
/* raise inexact flag */
if
(
z
>=
1
.
0
f
)
{
z
=
1
.
0
f
+
tiny
;
if
(
z
>
1
.
0
f
)
q
+=
2
;
else
q
+=
q
&
1
;
}
}
ix
=
(
q
>>
1
)
+
0x3f000000
;
r
=
ix
+
((
unsigned
int
)
m
<<
23
);
z
=
*
(
float
*
)
&
r
;
return
z
;
return
sqrtf
(
x
);
#endif
}
...
...
dlls/msvcrt/msvcrt.spec
View file @
20c53e72
...
...
@@ -1423,7 +1423,7 @@
@ varargs sprintf(ptr str)
@ varargs sprintf_s(ptr long str)
@ cdecl sqrt(double)
@ cdecl -arch=!i386 sqrtf(float)
@ cdecl -arch=!i386 sqrtf(float)
MSVCRT_sqrtf
@ cdecl srand(long)
@ varargs sscanf(str str)
@ varargs sscanf_s(str str)
...
...
dlls/ucrtbase/ucrtbase.spec
View file @
20c53e72
...
...
@@ -1779,7 +1779,7 @@
@ cdecl _o_sinh(double) sinh
@ cdecl -arch=!i386 _o_sinhf(float) sinhf
@ cdecl _o_sqrt(double) sqrt
@ cdecl -arch=!i386 _o_sqrtf(float) sqrtf
@ cdecl -arch=!i386 _o_sqrtf(float)
MSVCRT_
sqrtf
@ cdecl _o_srand(long) srand
@ cdecl _o_strcat_s(str long str) strcat_s
@ cdecl _o_strcoll(str str) strcoll
...
...
@@ -2495,7 +2495,7 @@
@ cdecl sinh(double)
@ cdecl -arch=!i386 sinhf(float)
@ cdecl sqrt(double)
@ cdecl -arch=!i386 sqrtf(float)
@ cdecl -arch=!i386 sqrtf(float)
MSVCRT_sqrtf
@ cdecl srand(long)
@ cdecl strcat(str str)
@ cdecl strcat_s(str long str)
...
...
libs/musl/src/math/sqrtf.c
View file @
20c53e72
...
...
@@ -24,7 +24,7 @@ float __cdecl sqrtf(float x)
if
(
ix
==
0x7f800000
)
return
x
;
if
(
ix
>
0x7f800000
)
return
__math_invalidf
(
x
);
return
math_error
(
_DOMAIN
,
"sqrtf"
,
x
,
0
,
(
x
-
x
)
/
(
x
-
x
)
);
/* x is subnormal, normalize it. */
ix
=
asuint
(
x
*
0x1
p23f
);
ix
-=
23
<<
23
;
...
...
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