cmd/vet: incorrect complaint about PEXTRD instruction #15271
This gist contains a program that prints
Indeed the program works correctly:
I don't understand what it's trying to tell me here.
I tried using
I'm using Go 1.6 on linux/amd64.
The text was updated successfully, but these errors were encountered:
@josharian: Thanks for the fix! (And now I know where to look if I want to fix it myself next time.) Is this going to come up again for
(Also do you happen to know the answer to my implicit question above about why I can say
I don't think so; vet should correctly interpret the trailing B and W already.
The assembly language is not particularly well-defined. The assembler works (more or less) off the list of internal instruction names (see e.g. cmd/internal/obj/x86/anames.go). Those internal instruction names mostly match a well-defined pattern. PEXTRD doesn't fit that pattern; it sticks closer to x86 speak.
In a few important cases like the various Jxx mnemonics (JAE, JCC, JHI, etc.), there are synonyms. We could teach the assembler that PEXTRL is a synonym for PEXTRD. (Or we could rename PEXTRD to PEXTRL, but that'll break existing code unnecessarily.) It's not technically challenging to add synonyms, but it does contribute to sprawl. If you think we should add a synonym, please file a new issue and cc @robpike, who should probably make that call.
Hope that all makes sense.