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

Use native C++20 feature for bit_cast if available #542

Merged
merged 1 commit into from
May 16, 2022
Merged

Use native C++20 feature for bit_cast if available #542

merged 1 commit into from
May 16, 2022

Conversation

axic
Copy link
Member

@axic axic commented Sep 22, 2020

lib/fizzy/cxx20/bit.hpp Outdated Show resolved Hide resolved
@chfast
Copy link
Collaborator

chfast commented Sep 22, 2020

This is not doable right now because only MSVC has implemented <bit> so far. See "std::bit_cast" in https://en.cppreference.com/w/cpp/compiler_support#C.2B.2B20_library_features.

@axic
Copy link
Member Author

axic commented Sep 22, 2020

This is not doable right now because only MSVC has implemented so far. See "std::bit_cast" in https://en.cppreference.com/w/cpp/compiler_support#C.2B.2B20_library_features.

Well we could use this other macro:

2.5. Feature testing
The __cpp_lib_bit_cast feature test macro should be added.

But since we don't support compilation with MSVC it can't be tested.

@axic axic closed this Sep 22, 2020
@axic axic reopened this Oct 9, 2020
lib/fizzy/cxx20/bit.hpp Outdated Show resolved Hide resolved
@axic axic marked this pull request as ready for review October 13, 2020 19:01
@axic axic requested review from chfast and gumb0 October 13, 2020 19:01
@chfast
Copy link
Collaborator

chfast commented Oct 13, 2020

This is not doable right now because only MSVC has implemented <bit> so far. See "std::bit_cast" in https://en.cppreference.com/w/cpp/compiler_support#C.2B.2B20_library_features.

This still holds.

@codecov
Copy link

codecov bot commented Oct 13, 2020

Codecov Report

Merging #542 (d8f3fe8) into master (7901fe9) will decrease coverage by 0.01%.
The diff coverage is n/a.

❗ Current head d8f3fe8 differs from pull request most recent head ba205ff. Consider uploading reports for the commit ba205ff to get more accurate results

@@            Coverage Diff             @@
##           master     #542      +/-   ##
==========================================
- Coverage   99.12%   99.10%   -0.02%     
==========================================
  Files          81       81              
  Lines       12985    12941      -44     
==========================================
- Hits        12871    12825      -46     
- Misses        114      116       +2     
Flag Coverage Δ
rust 99.90% <ø> (ø)
spectests ?
unittests ?
unittests-32 99.03% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
lib/fizzy/cxx20/bit.hpp 100.00% <ø> (ø)
test/testfloat/testfloat.cpp 95.86% <0.00%> (-1.38%) ⬇️
test/unittests/execute_floating_point_test.cpp 99.70% <0.00%> (-0.02%) ⬇️
lib/fizzy/execute.cpp 99.29% <0.00%> (-0.01%) ⬇️
test/unittests/instantiate_test.cpp 100.00% <0.00%> (ø)
test/unittests/floating_point_utils_test.cpp 100.00% <0.00%> (ø)

@axic
Copy link
Member Author

axic commented Oct 13, 2020

This is not doable right now because only MSVC has implemented so far. See "std::bit_cast" in https://en.cppreference.com/w/cpp/compiler_support#C.2B.2B20_library_features.

This still holds.

Totally skipped over this fact.

@axic axic closed this Oct 13, 2020
@axic axic deleted the bit_cast branch October 13, 2020 19:49
@axic axic restored the bit_cast branch October 15, 2020 15:42
@axic axic reopened this Oct 15, 2020
@axic axic closed this Oct 15, 2020
@axic
Copy link
Member Author

axic commented Feb 4, 2021

This is waiting for GCC+11 now: https://www.gnu.org/software/gcc/gcc-11/changes.html

@axic axic reopened this Feb 4, 2021
@axic axic marked this pull request as draft February 4, 2021 11:09
@axic
Copy link
Member Author

axic commented May 14, 2022

GCC 11 and Clang 14 has this now. Since #804 at least gcc is of correct version.

@axic axic marked this pull request as ready for review May 14, 2022 14:35
@axic
Copy link
Member Author

axic commented May 14, 2022

Tested with introduced a compilation error that the code is actually compiled on gcc 11.

@axic
Copy link
Member Author

axic commented May 15, 2022

@chfast @gumb0 please review

@axic axic merged commit 600ca56 into master May 16, 2022
@axic axic deleted the bit_cast branch May 16, 2022 08:11
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