-
Notifications
You must be signed in to change notification settings - Fork 277
Implement __builtin_ctz{,l,ll} via count_trailing_zeros_exprt #5881
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
Conversation
e7169de
to
e0ddd62
Compare
Codecov Report
@@ Coverage Diff @@
## develop #5881 +/- ##
=========================================
Coverage 74.25% 74.25%
=========================================
Files 1445 1445
Lines 157479 157635 +156
=========================================
+ Hits 116933 117059 +126
- Misses 40546 40576 +30
Continue to review full report at Codecov.
|
How does this relate to #5879 ? |
There is a code overlap in |
e0ddd62
to
0ebc741
Compare
0ebc741
to
3b2fea4
Compare
3b2fea4
to
973cacd
Compare
simplify_exprt::resultt<> | ||
simplify_exprt::simplify_ctz(const count_trailing_zeros_exprt &expr) | ||
{ | ||
const auto const_bits_opt = expr2bits( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to use the lowering in the simplifier to avoid the duplicate implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could, but it's probably more expensive. Whether that's a practical concern, however, is a different question. I suppose ctz will be fairly rare.
973cacd
to
c9688d8
Compare
c9688d8
to
c7fd6fa
Compare
__builtin_ctz returns the number of trailing zeros. Just like ffs and clz, introduce a new bitvector expression.
Marked as Draft as it depends on #5912.
__builtin_ctz returns the number of trailing zeros. Just like ffs and clz, introduce a new bitvector expression.