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
c7fa4673
Commit
c7fa4673
authored
May 18, 2021
by
Piotr Caban
Committed by
Alexandre Julliard
May 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Import remquo implementation from musl.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
29e99741
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
78 additions
and
23 deletions
+78
-23
configure
configure
+0
-1
configure.ac
configure.ac
+0
-1
math.c
dlls/msvcrt/math.c
+78
-3
unixlib.c
dlls/msvcrt/unixlib.c
+0
-14
unixlib.h
dlls/msvcrt/unixlib.h
+0
-1
config.h.in
include/config.h.in
+0
-3
No files found.
configure
View file @
c7fa4673
...
...
@@ -19640,7 +19640,6 @@ for ac_func in \
log2f
\
remainder
\
remainderf
\
remquo
\
remquof
\
tgamma
\
tgammaf
...
...
configure.ac
View file @
c7fa4673
...
...
@@ -2680,7 +2680,6 @@ AC_CHECK_FUNCS(\
log2f \
remainder \
remainderf \
remquo \
remquof \
tgamma \
tgammaf
...
...
dlls/msvcrt/math.c
View file @
c7fa4673
...
...
@@ -5496,12 +5496,87 @@ float CDECL remainderf(float x, float y)
/*********************************************************************
* remquo (MSVCR120.@)
*
* Copied from musl: src/math/remquo.c
*/
double
CDECL
remquo
(
double
x
,
double
y
,
int
*
quo
)
{
if
(
!
isfinite
(
x
))
*
_errno
()
=
EDOM
;
if
(
isnan
(
y
)
||
y
==
0
.
0
)
*
_errno
()
=
EDOM
;
return
unix_funcs
->
remquo
(
x
,
y
,
quo
);
UINT64
uxi
=
*
(
UINT64
*
)
&
x
;
UINT64
uyi
=
*
(
UINT64
*
)
&
y
;
int
ex
=
uxi
>>
52
&
0x7ff
;
int
ey
=
uyi
>>
52
&
0x7ff
;
int
sx
=
uxi
>>
63
;
int
sy
=
uyi
>>
63
;
UINT32
q
;
UINT64
i
;
*
quo
=
0
;
if
(
y
==
0
||
isinf
(
x
))
*
_errno
()
=
EDOM
;
if
(
uyi
<<
1
==
0
||
isnan
(
y
)
||
ex
==
0x7ff
)
return
(
x
*
y
)
/
(
x
*
y
);
if
(
uxi
<<
1
==
0
)
return
x
;
/* normalize x and y */
if
(
!
ex
)
{
for
(
i
=
uxi
<<
12
;
i
>>
63
==
0
;
ex
--
,
i
<<=
1
);
uxi
<<=
-
ex
+
1
;
}
else
{
uxi
&=
-
1ULL
>>
12
;
uxi
|=
1ULL
<<
52
;
}
if
(
!
ey
)
{
for
(
i
=
uyi
<<
12
;
i
>>
63
==
0
;
ey
--
,
i
<<=
1
);
uyi
<<=
-
ey
+
1
;
}
else
{
uyi
&=
-
1ULL
>>
12
;
uyi
|=
1ULL
<<
52
;
}
q
=
0
;
if
(
ex
<
ey
)
{
if
(
ex
+
1
==
ey
)
goto
end
;
return
x
;
}
/* x mod y */
for
(;
ex
>
ey
;
ex
--
)
{
i
=
uxi
-
uyi
;
if
(
i
>>
63
==
0
)
{
uxi
=
i
;
q
++
;
}
uxi
<<=
1
;
q
<<=
1
;
}
i
=
uxi
-
uyi
;
if
(
i
>>
63
==
0
)
{
uxi
=
i
;
q
++
;
}
if
(
uxi
==
0
)
ex
=
-
60
;
else
for
(;
uxi
>>
52
==
0
;
uxi
<<=
1
,
ex
--
);
end:
/* scale result and decide between |x| and |x|-|y| */
if
(
ex
>
0
)
{
uxi
-=
1ULL
<<
52
;
uxi
|=
(
UINT64
)
ex
<<
52
;
}
else
{
uxi
>>=
-
ex
+
1
;
}
x
=
*
(
double
*
)
&
uxi
;
if
(
sy
)
y
=
-
y
;
if
(
ex
==
ey
||
(
ex
+
1
==
ey
&&
(
2
*
x
>
y
||
(
2
*
x
==
y
&&
q
%
2
))))
{
x
-=
y
;
q
++
;
}
q
&=
0x7fffffff
;
*
quo
=
sx
^
sy
?
-
(
int
)
q
:
(
int
)
q
;
return
sx
?
-
x
:
x
;
}
/*********************************************************************
...
...
dlls/msvcrt/unixlib.c
View file @
c7fa4673
...
...
@@ -502,19 +502,6 @@ static float CDECL unix_remainderf(float x, float y)
}
/*********************************************************************
* remquo
*/
static
double
CDECL
unix_remquo
(
double
x
,
double
y
,
int
*
quo
)
{
#ifdef HAVE_REMQUO
return
remquo
(
x
,
y
,
quo
);
#else
FIXME
(
"not implemented
\n
"
);
return
0
;
#endif
}
/*********************************************************************
* remquof
*/
static
float
CDECL
unix_remquof
(
float
x
,
float
y
,
int
*
quo
)
...
...
@@ -662,7 +649,6 @@ static const struct unix_funcs funcs =
unix_powf
,
unix_remainder
,
unix_remainderf
,
unix_remquo
,
unix_remquof
,
unix_sin
,
unix_sinf
,
...
...
dlls/msvcrt/unixlib.h
View file @
c7fa4673
...
...
@@ -66,7 +66,6 @@ struct unix_funcs
float
(
CDECL
*
powf
)(
float
x
,
float
y
);
double
(
CDECL
*
remainder
)(
double
x
,
double
y
);
float
(
CDECL
*
remainderf
)(
float
x
,
float
y
);
double
(
CDECL
*
remquo
)(
double
x
,
double
y
,
int
*
quo
);
float
(
CDECL
*
remquof
)(
float
x
,
float
y
,
int
*
quo
);
double
(
CDECL
*
sin
)(
double
x
);
float
(
CDECL
*
sinf
)(
float
x
);
...
...
include/config.h.in
View file @
c7fa4673
...
...
@@ -636,9 +636,6 @@
/* Define to 1 if you have the `remainderf' function. */
#undef HAVE_REMAINDERF
/* Define to 1 if you have the `remquo' function. */
#undef HAVE_REMQUO
/* Define to 1 if you have the `remquof' function. */
#undef HAVE_REMQUOF
...
...
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