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
Please answer these questions before submitting your issue. Thanks!
go version
go version devel +ee80afe326 Tue Mar 21 21:19:47 2017 +0000 linux/amd64
go env
linux amd64
Compiled the following functions
func blah8a(s uint8) uint64 { return 1 << (s&63) } func blah8b(s uint8) uint64 { return 1 << uint(s&63) } func blah64(s uint64) uint64 { return 1 << uint(s&63) }
Same assembly code.
Assembly differs wildly. Only blah64 is completely optimized.
blah64
TEXT ·blah8a(SB), $0-16 // a.go:3 MOVBLZX s+0(FP), CX // a.go:4 ANDL $63, CX MOVQ $1, AX SHLQ CX, AX MOVQ AX, _r1+8(FP) RET TEXT ·blah8b(SB), $0-16 // a.go:7 MOVBLZX s+0(FP), CX // a.go:8 ANDL $63, CX MOVQ $1, AX SHLQ CX, AX CMPQ CX, $64 SBBQ DX, DX ANDQ DX, AX MOVQ AX, _r1+8(FP) RET TEXT ·blah64(SB), $0-16 // a.go:11 MOVQ s+0(FP), CX // a.go:12 MOVQ $1, AX SHLQ CX, AX MOVQ AX, _r1+8(FP) RET
The text was updated successfully, but these errors were encountered:
CL https://golang.org/cl/38550 mentions this issue.
Sorry, something went wrong.
3e63cdf
No branches or pull requests
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version devel +ee80afe326 Tue Mar 21 21:19:47 2017 +0000 linux/amd64
What operating system and processor architecture are you using (
go env
)?linux amd64
What did you do?
Compiled the following functions
What did you expect to see?
Same assembly code.
What did you see instead?
Assembly differs wildly. Only
blah64
is completely optimized.The text was updated successfully, but these errors were encountered: