cmd/compile: teach prove about range of results of math/bits.*Zeros #40084
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
Milestone
Since
x != 0
, we know thatbits.TrailingZeros64
will return a result in the range 0-63. We can use that information to remove the code that fixes up shifts that are not in range.Right now it generates:
(And even worse without the uint cast.)
We could get rid of the CMPQ/SBBQ/ANDQ I think. Add
&63
to the end of the shift line to see what it could be...@zdjones @rasky @josharian
The text was updated successfully, but these errors were encountered: