We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
func f(s []int, i int) []int { return s[i:] }
The assembly starts out with
MOVQ "".i+32(FP), AX MOVQ "".s+16(FP), CX CMPQ AX, CX JHI $0, 60 SUBQ AX, CX
The CMP and SUB are almost redundant. Instead, we could do
MOVQ "".i+32(FP), AX MOVQ "".s+16(FP), CX SUBQ AX, CX JHI $0, 60
We just need a subtract that also generates flags. (We have a 32-bit one for synthesizing 64-bit ops. We need a 64-bit one also.)
The text was updated successfully, but these errors were encountered:
Typo in code snippet?
Sorry, something went wrong.
Thanks, fixed.
No branches or pull requests
The assembly starts out with
The CMP and SUB are almost redundant. Instead, we could do
We just need a subtract that also generates flags. (We have a 32-bit one for synthesizing 64-bit ops. We need a 64-bit one also.)
The text was updated successfully, but these errors were encountered: