These follow up on the fesetenv and _fpreset changes from the last few
days.

Patch 1 moves __mingw_fe_dfl_env next to _fpreset on x86, as Pali
suggested, so that a copy of *FE_DFL_ENV matches whichever of
CRT_fp8.o and CRT_fp10.o is linked. It also fixes a mistake in my
earlier "Recognize FE_DFL_ENV by address" patch. On arm and arm64ec
__mingw_fe_dfl_env was left as { 0, 0 }, so a copy of it now decodes to
an environment with every exception unmasked. It gets the real startup
encoding there instead. t_fesetenv now checks that fegetenv at startup
returns exactly *FE_DFL_ENV, on every target.

Patch 2 adds CRT_fp4.o, which sets 24-bit x87 precision, next to
CRT_fp8.o and CRT_fp10.o. The GCC patch for -mpc32/-mpc64/-mpc80 on
mingw will link CRT_fp4.o, CRT_fp8.o and CRT_fp10.o, as Pali proposed
on gcc-patches. v2 of that will follow.

Patch 1 adds a HOST_X86 conditional to configure.ac (the
t_fesetenv_fp* tests can only link on x86), so configure and
Makefile.in need regenerating.

Tested on x86_64 and i686. CI on my fork:
https://github.com/Peter0x44/mingw-w64/actions/runs/39686893006

Peter Damianov (2):
  crt: Define FE_DFL_ENV next to _fpreset
  crt: Add CRT_fp4.o for 24-bit x87 precision

 mingw-w64-crt/Makefile.am                 |  7 +++-
 mingw-w64-crt/configure.ac                |  2 +
 mingw-w64-crt/crt/CRT_fp10.c              |  5 +++
 mingw-w64-crt/crt/CRT_fp4.c               | 47 +++++++++++++++++++++++
 mingw-w64-crt/crt/CRT_fp8.c               |  5 +++
 mingw-w64-crt/misc/fesetenv.c             | 14 ++++---
 mingw-w64-crt/testcases/Makefile.am       | 12 ++++++
 mingw-w64-crt/testcases/t_fesetenv.c      | 23 ++++++++++-
 mingw-w64-crt/testcases/t_fesetenv_fp10.c |  2 +
 mingw-w64-crt/testcases/t_fesetenv_fp4.c  |  3 ++
 mingw-w64-crt/testcases/t_fesetenv_fp8.c  |  3 ++
 11 files changed, 113 insertions(+), 10 deletions(-)
 create mode 100644 mingw-w64-crt/crt/CRT_fp4.c
 create mode 100644 mingw-w64-crt/testcases/t_fesetenv_fp10.c
 create mode 100644 mingw-w64-crt/testcases/t_fesetenv_fp4.c
 create mode 100644 mingw-w64-crt/testcases/t_fesetenv_fp8.c

-- 
2.54.0.windows.1



_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to