Open mmcloughlin opened 6 years ago
@mmcloughlin, that's my understanding that it's better to re-generate disassembler than to manually fix all issues (there are potentially a lots of them). It's possible to patch it, but decoder does not understand, for example, all recently added AVX-512 instructions, so it's not a matter of dozens, but hundreds of instructions.
The main problem is that updated x86.csv generator is on halt until some format questions are resolved. The encoder tables (for assembler) are generated from XED tables directly right now. It is possible to generate decoder tables from that too, but this would require discussion as well.
Thank you for the detailed reply. I'd agree that an automated solution to this is preferable.
I'm interested in learning more and helping out, but it seems that contributing in this area is non-trivial?
Noting that the objdump still cannot disassemble the input:
TEXT bmi.PDep.abi0(SB) s:/temp/pdepq/pdep.s
pdep.s:7 0x505400 4c8b442408 MOVQ 0x8(SP), R8
pdep.s:8 0x505405 4c8b4c2410 MOVQ 0x10(SP), R9
pdep.s:10 0x50540a c442b3f5 CMC
pdep.s:10 0x50540e d04c8954 RORB $0x1, 0x54(CX)(CX*4)
pdep.s:12 0x505412 2418 ANDL $0x18, AL
pdep.s:13 0x505414 c3 RET
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, confirmed on 1.9.2 and 1.10.2. Not tested on master.
What operating system and processor architecture are you using (
go env
)?What did you do?
Compiled package with assembly code using
PDEPQ
. Viewed resulting assembly withgo tool objdump
.Gist https://gist.github.com/mmcloughlin/b5bf1bcc7f31222ff2bc510f2777cd79 is a minimal example.
What did you expect to see?
Expect
go tool objdump
to show thePDEPQ
instruction.What did you see instead?
Output from
objdump.sh
script is as follows. Theobjdump
tool does not recognizePDEPQ
, and instead parses it as a sequence of instructions. Note that Apple's LLVM objdump correctly identifies the instruction.