Commit Graph

368 Commits

Author SHA1 Message Date
Eric Pouech 9b802a3d56 msvcr: Build without -DWINE_NO_LONG_TYPES.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-08 20:24:15 +01:00
Eric Pouech 948f465da7 msvcrt: Use correct integral type in _except1.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-04 19:42:01 +01:00
Piotr Caban 201266769d msvcrt: Don't use fegetenv in nearbyintf.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-01 18:23:18 +01:00
Piotr Caban 5d9d195f49 msvcrt: Don't use fegetenv in nearbyint.
The fegetenv/feupdateenv functions are broken in msvcr120 and are
causing unintentional SSE control word changes.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-01 18:23:18 +01:00
Piotr Caban e617fe0bda msvcrt: Don't set SSE control word in _except1.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-01 18:23:18 +01:00
Piotr Caban f12bcfd2ab msvcrt: Fix fmaf not to depend on rounding mode.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-01 18:23:18 +01:00
Piotr Caban 80eec636ee msvcrt: Fix Pi constants while computing acosf.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-19 16:27:16 +01:00
Piotr Caban 7555573dc5 msvcrt: Fix restoring 53-bit precision mode in _control87.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52260
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-23 22:57:01 +01:00
Piotr Caban c521ec04c9 msvcrt: Make _setfp* helpers infallible.
The functions may only fail on unsupported compilers/architectures. It's
not really possible to handle errors properly.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-21 13:32:08 +01:00
Piotr Caban 564ede5d32 msvcrt: Don't set _EM_AMBIGOUS flag in _control87 when sse2 is not supported.
Fixes compilation warning.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-21 13:32:08 +01:00
Alexandre Julliard da8176df61 msvcrt: Move _fdclass/_dclass to avoid forward references.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-15 18:28:00 +02:00
Francois Gouget a6b1e97eb6 msvcrt: Remove CDECL on static functions where not needed.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-06 14:52:51 +02:00
Piotr Caban 62d2693701 msvcrt: Fix x87 FPU status register assignment detection.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51568
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51579
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-09 11:38:33 +02:00
Piotr Caban a440e8aa8e msvcrt: Implement _fpreset on arm and aarch64.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-04 21:48:28 +02:00
Piotr Caban 0c808ff4d3 msvcrt: Use _setfp helper on all architectures.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-04 21:48:28 +02:00
Piotr Caban b28b409bb5 msvcrt: Introduce _setfp helper on arm.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-04 21:48:28 +02:00
Piotr Caban 63f3f4283f msvcrt: Introduce _setfp helper on aarch64.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-04 21:48:28 +02:00
Piotr Caban f1ef14dc17 msvcrt: Introduce _setfp helper to access floating point status and control words.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-04 21:48:28 +02:00
Piotr Caban f53b2095f3 msvcrt: Don't reset x87 in x86_64 fpreset.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-04 21:48:28 +02:00
Piotr Caban f46ef017cd msvcrt: Don't clear x87 status word x86_64 _clearfp.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-04 21:48:28 +02:00
Piotr Caban ab3afe8347 msvcrt: Don't check x87 status word in x86_64 _statusfp.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-04 21:48:28 +02:00
Piotr Caban 24fb503e2f msvcrt: Introduce _setfp_sse helper to access mxcsr register.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-04 21:48:28 +02:00
Martin Storsjö 8c02239619 msvcrt: Implement fesetenv for arm.
Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-04 21:48:28 +02:00
Martin Storsjö 6391a9f897 msvcrt: Implement fesetenv for arm64.
Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-04 21:48:28 +02:00
Martin Storsjö 6521134705 msvcrt: Implement _control87 for arm.
Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-03 23:41:31 +02:00
Martin Storsjö 1b6f59b5d0 msvcrt: Implement _clearfp for arm.
Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-03 23:41:31 +02:00
Martin Storsjö 70400c9368 msvcrt: Implement _statusfp for arm.
Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-03 23:41:31 +02:00
Alexandre Julliard 08e5080089 msvcrt: Remove leftover __wine_init_unix_lib() call.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-03 23:41:05 +02:00
Martin Storsjo 37b896db48 msvcrt: Convert double (numerically) to UINT64 via INT64, fixing pow() on arm.
If converting a negative double to an UINT64, on arm it's clipped
to zero instead of converted to its two's complement form (contrary
to x86).

This fixes cases like pow(2.0, -2.0) on arm/aarch64. Add similar
casts to expf() too which seems to have a similar pattern, even if
it's not known if that case can cause issues or not.

In the original musl source, the converttoint() function returns a
signed int32_t, doing the same double->signed->unsigned conversion,
implicitly.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-28 22:07:05 +02:00
Martin Storsjo 07ec052e54 msvcrt: Make the tanh function NAN preserving.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-28 22:07:05 +02:00
Martin Storsjo 11166aa01e msvcrt: Make the sinh function NAN preserving.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-28 22:07:05 +02:00
Martin Storsjo 60d178b410 msvcrt: Make the cosh function NAN preserving.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-28 22:07:05 +02:00
Martin Storsjo e93e246719 msvcrt: Make the tanhf function NAN preserving.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-28 22:07:05 +02:00
Martin Storsjo 4fd9daea4a msvcrt: Make the sinhf function NAN preserving.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-28 22:07:05 +02:00
Martin Storsjo 361143252b msvcrt: Make the coshf function NAN preserving.
Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-28 22:07:05 +02:00
Piotr Caban 2f9312fe5f msvcrt: Introduce fenv_encode helper in all runtime versions.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-21 17:44:33 +02:00
Piotr Caban 67c7c40351 msvcrt: Don't set x87 control word in x86_64 fesetenv.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-21 17:44:20 +02:00
Piotr Caban 5189d73b54 msvcrt: Introduce fenv_decode helper in all runtime versions.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-21 17:44:19 +02:00
Piotr Caban bf859348ad msvcrt: Use _MCW_RC rounding mask in fesetround and fegetround.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-21 17:14:34 +02:00
Piotr Caban 9008cd2f24 msvcrt: Match native cosf results in -Pi/4 - Pi/4 range.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-21 23:13:58 +02:00
Piotr Caban ee7b5ebc3a msvcrt: Match native sinf results in -Pi/4 - Pi/4 range.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-21 23:13:57 +02:00
Piotr Caban ff4d7edc33 msvcrt: Import pow implementation from musl.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-14 18:32:24 +02:00
Piotr Caban 9d2de96d07 msvcrt: Fix math error arguments in powf.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-14 18:32:24 +02:00
Piotr Caban f5bd0be6a4 msvcrt: Import exp implementation from musl.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-11 20:29:02 +02:00
Piotr Caban b06dd5a13b msvcrt: Import exp2 implementation from musl.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-11 20:28:20 +02:00
Piotr Caban 7bb574eafd msvcrt: Import powf implementation from musl.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-10 20:50:07 +02:00
Piotr Caban 9a459dc5af msvcrt: Import expf implementation from musl.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-10 20:50:00 +02:00
Piotr Caban 07e31f4eaf msvcrt: Import exp2f implementation from musl.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-10 20:49:52 +02:00
Piotr Caban 7fdb78e80b msvcrt: Import fmaf implementation from musl.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-08 22:29:57 +02:00
Piotr Caban f4c88b3e9c msvcrt: Import tgammaf implementation from musl.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-08 22:29:51 +02:00