[bug] Fixed EVEX encoder accepting {k1} on unsupported insns#520
Open
es3n1n wants to merge 3 commits into
Open
[bug] Fixed EVEX encoder accepting {k1} on unsupported insns#520es3n1n wants to merge 3 commits into
es3n1n wants to merge 3 commits into
Conversation
The x86 test file already defines this macro for the commented-out failure block; mirror it on the x64 side so future PRs can add FAIL_INSTRUCTION(...) cases inline without reintroducing the macro each time.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
based on #513
the validator at
x86instapi.cpp:721already rejectsextra_reg=kNon instructions withouthas_avx512_k(), but the encoder'sEmitVexEvexR/EmitVexEvexMpath just ORs_extra_reg.id() << 16into the EVEXaaafield and emits. so in the default path (kValidateAssembleroff),setExtraReg(k1); emit(vpextrb, ...)produces EVEX bytes withaaa != 0on an instruction whereaaamust be 000 -#UDat runtimeisa_x86.jsonhad wrong{kz}markers onvpinsrb/vpinsrw/vpinsrd/vpinsrqEVEX rows and on thevmovw W:xmm {kz}, r32/m16row. intel sdm shows these with plain operand syntax - no{k1}{z}in the instruction reference. soinfoById().hasAvx512K()returned a lie and the encoder gate would fall through for those mnemonics even after fix 1https://revers.engineering/x86/pextrb.pdf
https://revers.engineering/x86/pinsrb.pdf
https://revers.engineering/x86/movw.pdf