Skip to content
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

cmd/objdump: new GOAMD64=v3 instructions don't disassemble properly #48584

Open
randall77 opened this issue Sep 23, 2021 · 1 comment
Open

cmd/objdump: new GOAMD64=v3 instructions don't disassemble properly #48584

randall77 opened this issue Sep 23, 2021 · 1 comment
Labels

Comments

@randall77
Copy link
Contributor

@randall77 randall77 commented Sep 23, 2021

Build this program with GOAMD64=v3:

package main

//go:noinline
func f(x, y uint64) uint64 {
	return x &^ y
}
func main() {
	f(0, 0)
}

Disassembling with the native objdump -d, we get

 1053b20:       c4 e2 e0 f2 c0  andnq   %rax, %rbx, %rax

With go tool objdump we get

  :0                    0x1053b20               c4e2e0f2c0c3cc          ROLL $0xcc, BL          

@martisch

Side note, the popcount instruction disassembles as POPCNT, it should really disassemble as POPCNTQ or POPCNTL, as appropriate.

@gopherbot
Copy link

@gopherbot gopherbot commented Sep 23, 2021

Change https://golang.org/cl/351889 mentions this issue: x86asm: include size suffix on popcnt instruction

Loading

gopherbot pushed a commit to golang/arch that referenced this issue Sep 23, 2021
Update golang/go#48584

Change-Id: I2c770aaf88e15f8987dc8f1d974127b02b220777
Reviewed-on: https://go-review.googlesource.com/c/arch/+/351889
Trust: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants