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

Move _Floating_type_traits-related functions #4615

Merged
merged 3 commits into from
Apr 26, 2024

Conversation

frederick-vs-ja
Copy link
Contributor

Towards #3599.

  • Move _Float_abs_bits, _Float_abs, _Is_nan, and _Is_finite to <type_traits> to avoid including <xutility> in <cmath>.
    • However, throughput may be slightly damaged when <cmath> is not included.
  • Move _Is_signaling_nan and _Is_inf to <complex> as they are not used elsewhere.
  • Remove _Float_copysign as it's unused.
  • Reimplement _Floating_max and _Floating_min in a consistent way.

- Move `_Float_abs_bits`, `_Float_abs`, `_Is_nan`, and `_Is_finite`
to `<type_traits>` to avoid including `<xutility>` in `<cmath>`cmath
- Move `_Is_signaling_nan` and `_Is_inf` to `<complex>` as they are
not used elsewhere.
- Remove `_Float_copysign` as it's unused.
- Reimplement `_Floating_max` and `_Floating_min` in a simpler way.
@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner April 21, 2024 16:58
@StephanTLavavej StephanTLavavej added the throughput Must compile faster label Apr 21, 2024
stl/inc/numeric Outdated Show resolved Hide resolved
@StephanTLavavej
Copy link
Member

Thanks! I pushed a further simplification to use hexfloats.

Note that this makes _Floating_type_traits<long double>::_Meowimum_value not have exactly the right type, but this is fine - we end up "widening" it to _Ty. I didn't think it was worth the effort to try to "fix" the type for this internal trait.

@StephanTLavavej StephanTLavavej self-assigned this Apr 26, 2024
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit 4ab1364 into microsoft:main Apr 26, 2024
39 checks passed
@StephanTLavavej
Copy link
Member

Thanks again for noticing these possibilities for improvement! 🪄 🚀 🎉

@frederick-vs-ja frederick-vs-ja deleted the constexpr-fp-helpers branch April 27, 2024 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
throughput Must compile faster
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants