New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/vet: incorrect complaint about PEXTRD instruction #15271
Comments
/cc @robpike |
Sending to @rsc, owner of the assembly checker. |
CL https://golang.org/cl/22083 mentions this issue. |
@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 |
Excellent. :)
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. |
Thanks, it does make sense. |
This gist contains a program that prints
123
. The value is generated by this assembly function:Indeed the program works correctly:
However,
go vet
is unhappy about thePEXTRD
instruction:I don't understand what it's trying to tell me here.
PEXTRD
is supposed to operate on 4-byte values, as far as I understand it.I tried using
PEXTRL
instead, but the assembler says it doesn't exist. (I don't understand why sometimes I can use bothL
/D
, e.g.MOVL
andMOVD
, and other times I can't.)I'm using Go 1.6 on linux/amd64.
The text was updated successfully, but these errors were encountered: