Skip to content

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

@Keno Keno requested review from stevengj and yuyichao November 13, 2020 07:29
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

5 participants