golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.61k stars 17.61k forks source link

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

Open randall77 opened 3 years ago

randall77 commented 3 years ago

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 commented 3 years ago

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

gopherbot commented 2 weeks ago

Change https://go.dev/cl/618036 mentions this issue: x86: allow decoding of AVX instructions