Expect go tool objdump to show the PDEPQ instruction.
What did you see instead?
Output from objdump.sh script is as follows. The objdump tool does not recognize PDEPQ, and instead parses it as a sequence of instructions. Note that Apple's LLVM objdump correctly identifies the instruction.
+ go version
go version go1.10.2 darwin/amd64
+ go test -c
+ go tool objdump -s bmi.PDep bmi.test
TEXT github.com/mmcloughlin/bmi.PDep(SB) /Users/michaelmcloughlin/gocode/src/github.com/mmcloughlin/bmi/pdep.s
pdep.s:7 0x10e7860 4c8b442408 MOVQ 0x8(SP), R8
pdep.s:8 0x10e7865 4c8b4c2410 MOVQ 0x10(SP), R9
pdep.s:10 0x10e786a c442b3f5 CMC
pdep.s:10 0x10e786e d04c8954 RORB $0x1, 0x54(CX)(CX*4)
pdep.s:12 0x10e7872 2418 ANDL $0x18, AL
pdep.s:13 0x10e7874 c3 RET
:-1 0x10e7875 cc INT $0x3
:-1 0x10e7876 cc INT $0x3
:-1 0x10e7877 cc INT $0x3
:-1 0x10e7878 cc INT $0x3
:-1 0x10e7879 cc INT $0x3
:-1 0x10e787a cc INT $0x3
:-1 0x10e787b cc INT $0x3
:-1 0x10e787c cc INT $0x3
:-1 0x10e787d cc INT $0x3
:-1 0x10e787e cc INT $0x3
:-1 0x10e787f cc INT $0x3
+ objdump -disassemble-all bmi.test
+ grep -A 4 bmi.PDep:
10e7860: 4c 8b 44 24 08 movq 8(%rsp), %r8
10e7865: 4c 8b 4c 24 10 movq 16(%rsp), %r9
10e786a: c4 42 b3 f5 d0 pdepq %r8, %r9, %r10
10e786f: 4c 89 54 24 18 movq %r10, 24(%rsp)
The text was updated successfully, but these errors were encountered:
#23386 is potentially linked. @quasilytesuggested in a comment that the disassembler needs to be updated according to the latest x86.csv. From my limited digging into this, it does seem it could just be a matter of some instruction tables getting out of sync.
@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.