Open randall77 opened 3 years ago
Build this program with GOAMD64=v3:
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
objdump -d
1053b20: c4 e2 e0 f2 c0 andnq %rax, %rbx, %rax
With go tool objdump we get
go tool objdump
: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.
POPCNT
POPCNTQ
POPCNTL
Change https://golang.org/cl/351889 mentions this issue: x86asm: include size suffix on popcnt instruction
x86asm: include size suffix on popcnt instruction
Change https://go.dev/cl/618036 mentions this issue: x86: allow decoding of AVX instructions
x86: allow decoding of AVX instructions
Build this program with
GOAMD64=v3
:Disassembling with the native
objdump -d
, we getWith
go tool objdump
we get@martisch
Side note, the popcount instruction disassembles as
POPCNT
, it should really disassemble asPOPCNTQ
orPOPCNTL
, as appropriate.