Skip to content

Apple Silicon HW FPE trapping & signal handling#116

Merged
wdeconinck merged 11 commits into
ecmwf-ifs:developfrom
Andrew-Beggs-ECMWF:naab-mac-hw-fpe-handling
Apr 22, 2026
Merged

Apple Silicon HW FPE trapping & signal handling#116
wdeconinck merged 11 commits into
ecmwf-ifs:developfrom
Andrew-Beggs-ECMWF:naab-mac-hw-fpe-handling

Conversation

@Andrew-Beggs-ECMWF

Copy link
Copy Markdown
Contributor

Description

This PR is inspired by work done in Atlas[1][2]. It uses the floating point control register (FPCR) and floating point status register (FPSR) to trap requested FPEs using hardware trapping. These are natively treated as SIGILL exceptions, so DrHook will now reinterpret them as SIGFPEs to maintain consistency with other platforms.

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

@Andrew-Beggs-ECMWF Andrew-Beggs-ECMWF force-pushed the naab-mac-hw-fpe-handling branch from bbbd4fc to 37e3ad3 Compare April 21, 2026 17:20
@Andrew-Beggs-ECMWF Andrew-Beggs-ECMWF marked this pull request as ready for review April 21, 2026 17:21
Comment thread src/fiat/drhook/drhook.c Outdated
Comment thread src/fiat/drhook/drhook.c
Comment thread tests/drhook/drhook_core/drhook_no_hw_fpe/drhook_no_hw_fpe_fenv_util.c Outdated
@Andrew-Beggs-ECMWF Andrew-Beggs-ECMWF changed the title Naab mac hw fpe handling Apple Silicon HW FPE trapping & signal handling Apr 22, 2026

@wdeconinck wdeconinck left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice to have hardware FPE trapping on macOS for the all IFS-related packages now! Thanks @Andrew-Beggs-ECMWF

@wdeconinck wdeconinck merged commit de87fda into ecmwf-ifs:develop Apr 22, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants