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
compiler/runtime Issues related to the Go compiler and/or runtime. help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@randall77
Copy link
Contributor

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

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

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>
@dr2chase dr2chase added the NeedsFix The path to resolution is known, but the work has not been done. label Sep 24, 2021
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 13, 2022
@seankhliao seankhliao added this to the Backlog milestone Aug 20, 2022
AppleSeed95 pushed a commit to AppleSeed95/arch that referenced this issue Feb 2, 2024
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
compiler/runtime Issues related to the Go compiler and/or runtime. help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
Status: Triage Backlog
Development

No branches or pull requests

4 participants