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

Normalize floating point environment on startup #38420

Merged
merged 2 commits into from
Nov 18, 2020
Merged

Conversation

Keno
Copy link
Member

@Keno Keno commented Nov 13, 2020

In #38419 we noticed that on AArch64 Darwin, processes start with the
FZ and DN floating point flags set. To maintain consistency across platforms,
reset these flags whenever we start julia. Not that default_nans isn't available
on x86, so while we do have julia-level wrappers for the fz flag, I'm not
adding any for the dn flag. The function is exported, so if somebody really
needs it in some aarch64-specific code, they can ccall it.

cc @oscardssmith
Fixes #38419

Copy link
Contributor

@yuyichao yuyichao left a comment

Choose a reason for hiding this comment

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

LGTM.

FWIW, I believe I tested subnormals on the ARM cores and they weren't really slower. Of course it was with cortex-a57 and things might have changed.

In #38419 we noticed that on AArch64 Darwin, processes start with the
FZ and DN floating point flags set. To maintain consistency across platforms,
reset these flags whenever we start julia. Not that default_nans isn't available
on x86, so while we do have julia-level wrappers for the fz flag, I'm not
adding any for the dn flag. The function is exported, so if somebody really
needs it in some aarch64-specific code, they can ccall it.
return 0;
}

extern "C" JL_DLLEXPORT int32_t jl_set_zero_subnormals(int8_t isDefault)
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't that be jl_set_default_nans ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks

@JeffBezanson JeffBezanson merged commit b92ce01 into master Nov 18, 2020
@JeffBezanson JeffBezanson deleted the kf/resetfpenv branch November 18, 2020 19:35
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.

Complex signed NaN test fails on Darwin/Aarch64
4 participants