x86: 0x66 & 0x67 cannot be anywhere. this fixes CRC32 instruction

This commit is contained in:
Nguyen Anh Quynh 2014-11-10 07:43:49 +08:00
parent 248519efea
commit 4e20e8e24d
2 changed files with 4 additions and 6 deletions

View File

@ -365,10 +365,6 @@ static bool isPrefixAtLocation(struct InternalInstruction* insn,
uint8_t prefix,
uint64_t location)
{
// allow 0x66 & 0x67 to be put anywhere
if (prefix == 0x66 || prefix == 0x67)
return insn->prefixPresent[prefix] == 1;
if (insn->prefixPresent[prefix] == 1 &&
insn->prefixLocations[prefix] == location)
return true;
@ -545,6 +541,7 @@ static int readPrefixes(struct InternalInstruction* insn)
insn->vectorExtensionType = TYPE_NO_VEX_XOP;
if (byte == 0x62) {
uint8_t byte1, byte2;

View File

@ -568,6 +568,9 @@ typedef struct InternalInstruction {
/* 1 if the prefix byte, 0xf2 or 0xf3 is xacquire or xrelease */
bool xAcquireRelease;
/* contains the location (for use with the reader) of the prefix byte */
uint64_t prefixLocations[0x100];
/* The value of the vector extension prefix(EVEX/VEX/XOP), if present */
uint8_t vectorExtensionPrefix[4];
@ -596,8 +599,6 @@ typedef struct InternalInstruction {
/* Prefix state */
/* contains the location (for use with the reader) of the prefix byte */
uint64_t prefixLocations[0x100];
/* The type of the vector extension prefix */
VectorExtensionType vectorExtensionType;
/* The location where a mandatory prefix would have to be (i.e., right before