Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for floating point exceptions #47930

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
fix darwin
  • Loading branch information
simonbyrne committed Dec 19, 2022
commit b1ba28287fbdb67c6df9f380a71b2116cd661ba2
6 changes: 3 additions & 3 deletions src/jlapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,10 +537,10 @@ JL_DLLEXPORT int jl_set_fenv_except(int excepts)
fenv_t env;
fegetenv(&env);
#if defined(_CPU_AARCH64_)
env.__fpcr = env.__fpcr | (excepts << 8);
env.__fpcr = (env.__fpcr & ~(FE_ALL_EXCEPT << 8)) | (excepts << 8);
#elif defined(_CPU_X86_64_)
env.__control = env.__control & ~excepts;
env.__mxcsr = env.__mxcsr & ~(excepts << 7);
env.__control = (env.__control | FE_ALL_EXCEPT) & ~excepts;
env.__mxcsr = (env.__mxcsr | FE_ALL_EXCEPT << 7) & ~(excepts << 7);
#else
return 1;
#endif
Expand Down