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

Implement f{32,64}.div instructions #468

Merged
merged 2 commits into from
Aug 12, 2020
Merged

Implement f{32,64}.div instructions #468

merged 2 commits into from
Aug 12, 2020

Conversation

chfast
Copy link
Collaborator

@chfast chfast commented Aug 10, 2020

image

@chfast chfast requested review from axic and gumb0 August 10, 2020 14:17
@chfast chfast force-pushed the fp_add branch 3 times, most recently from 0ee2182 to c6547b9 Compare August 10, 2020 19:24
@chfast chfast force-pushed the fp_div branch 2 times, most recently from 4abda86 to 74a1c1c Compare August 11, 2020 09:10
@chfast chfast force-pushed the fp_add branch 7 times, most recently from 403e427 to e8c2b15 Compare August 11, 2020 21:36
Base automatically changed from fp_add to master August 11, 2020 21:50
@chfast chfast force-pushed the fp_div branch 2 times, most recently from 6435f60 to 717a89a Compare August 11, 2020 22:15
@gumb0
Copy link
Collaborator

gumb0 commented Aug 12, 2020

Some UBSan errors on macOS

@codecov
Copy link

codecov bot commented Aug 12, 2020

Codecov Report

Merging #468 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #468   +/-   ##
=======================================
  Coverage   99.54%   99.54%           
=======================================
  Files          54       54           
  Lines       16123    16196   +73     
=======================================
+ Hits        16049    16122   +73     
  Misses         74       74           

@@ -510,6 +510,13 @@ inline uint64_t popcnt64(uint64_t value) noexcept
return static_cast<uint64_t>(__builtin_popcountll(value));
}

template <typename T>
__attribute__((no_sanitize("float-divide-by-zero"))) inline constexpr T fdiv(T a, T b) noexcept
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The attribute disables UBSan check in both GCC and Clang. Using C++ attributes ([[gnu::no_sanitize("")]]) is also possible but requires some changes to compiler's warning options. So I think it is fine to leave it as is for now.

@chfast chfast changed the title Implement f{32,64}_div instructions Implement f{32,64}.div instructions Aug 12, 2020
@chfast
Copy link
Collaborator Author

chfast commented Aug 12, 2020

@axic, I added spec annotations in tests.

@chfast chfast merged commit dc66074 into master Aug 12, 2020
@chfast chfast deleted the fp_div branch August 12, 2020 18:47
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.

3 participants