x86: Fix register field encoding in VEX/EVEX prefix - #7564
Merged
Conversation
Contributor
Author
|
@Spencer-Comin This change should fix the issues with pdep/pext instructions |
Contributor
Author
|
jenkins build xlinux, x32linux |
0xdaryl
reviewed
Nov 29, 2024
| void setSource2ndRegisterFieldInEVEX(uint8_t *opcodeByte) | ||
| { | ||
| uint8_t regNum = ((_fullRegisterBinaryEncodings[_registerNumber].needsRexForByte << 3) | _fullRegisterBinaryEncodings[_registerNumber].id); | ||
| uint8_t regNum = ((_fullRegisterBinaryEncodings[_registerNumber].needsRexPlusRXB << 3) | _fullRegisterBinaryEncodings[_registerNumber].id); |
Contributor
There was a problem hiding this comment.
This change makes sense to me if you are updating the vvvv bits in P1. However, the code below seems to suggest that P1 is one byte beyond the opcodeByte, so now I am confused.
Contributor
Author
There was a problem hiding this comment.
Perhaps opcodeByte is poorly named. opcodeByte points to EVEX P1 in the instruction where vvvv bits are, not the literal opcode value.
uint8_t *evexP1 = opcodeByte + 1; should be P2
Contributor
There was a problem hiding this comment.
Can you do that renaming now as part of this PR please?
added 2 commits
December 5, 2024 12:52
Signed-off-by: Bradley Wood <bradley.wood@ibm.com>
Signed-off-by: Bradley Wood <bradley.wood@ibm.com>
BradleyWood
force-pushed
the
reg_encoding
branch
from
December 5, 2024 18:26
ebbb43d to
ca71041
Compare
Contributor
Author
|
Fixed the 32-bit encoding, improved naming. |
Contributor
|
Jenkins build xlinux,win,osx,x32linux |
0xdaryl
approved these changes
Dec 7, 2024
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.
No description provided.