runtime: simplify right shift and zero test #30272
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsFix
The path to resolution is known, but the work has not been done.
Performance
Milestone
What version of Go are you using (
go version
)?1.11
What did you do?
Please consider the following dummy code:
What did you expect to see?
Main part of the loop could compile down to (i.e. without the test for zero):
or even:
What did you see instead?
It compiles down to (on x86):
PS: I've just noticed similar situation occurs with
- 1
, instead of>> 1
:There the:
could also be replaced by:
The text was updated successfully, but these errors were encountered: