x86: temporarily solve conflicts caused by the last merge

test2
Nguyen Anh Quynh 10 years ago
commit 72bbcacb88
  1. 42
      arch/X86/X86DisassemblerDecoder.c
  2. 6221
      arch/X86/X86GenInstrInfo.inc
  3. 1742
      arch/X86/X86GenInstrInfo_reduce.inc

@ -22,6 +22,7 @@
#include <stdlib.h> /* for exit() */
#include "../../cs_priv.h"
#include "../../utils.h"
#include "X86DisassemblerDecoder.h"
@ -62,11 +63,6 @@ struct ContextDecision {
#include "X86GenInstrInfo.inc"
#endif
static const char *x86DisassemblerGetInstrName(unsigned Opcode)
{
return &X86InstrNameData[X86InstrNameIndices[Opcode]];
}
/*
* contextForAttrs - Client for the instruction context table. Takes a set of
* attributes and returns the appropriate decode context.
@ -955,28 +951,23 @@ static int getIDWithAttrMask(uint16_t* instructionID,
* is16BitEquivalent - Determines whether two instruction names refer to
* equivalent instructions but one is 16-bit whereas the other is not.
*
* @param orig - The instruction that is not 16-bit
* @param equiv - The instruction that is 16-bit
* @param orig - The instruction ID that is not 16-bit
* @param equiv - The instruction ID that is 16-bit
*/
static bool is16BitEquivalent(const char* orig, const char* equiv)
static bool is16BitEquivalent(unsigned orig, unsigned equiv)
{
size_t i;
for (i = 0;; i++) {
if (orig[i] == '\0' && equiv[i] == '\0')
return true;
if (orig[i] == '\0' || equiv[i] == '\0')
return false;
if (orig[i] != equiv[i]) {
if ((orig[i] == 'Q' || orig[i] == 'L') && equiv[i] == 'W')
continue;
if ((orig[i] == '6' || orig[i] == '3') && equiv[i] == '1')
continue;
if ((orig[i] == '4' || orig[i] == '2') && equiv[i] == '6')
continue;
return false;
uint16_t idx;
if ((idx = x86_16_bit_eq_lookup[orig]) != 0)
{
for (i = idx - 1; x86_16_bit_eq_tbl[i].first == orig && i < ARR_SIZE(x86_16_bit_eq_tbl); ++i)
{
if (x86_16_bit_eq_tbl[i].second == equiv)
return true;
}
}
return false;
}
/*
@ -1121,7 +1112,6 @@ static int getID(struct InternalInstruction* insn)
const struct InstructionSpecifier *spec;
uint16_t instructionIDWithOpsize;
const char *specName, *specWithOpSizeName;
spec = specifierForUID(instructionID);
@ -1137,11 +1127,7 @@ static int getID(struct InternalInstruction* insn)
return 0;
}
specName = x86DisassemblerGetInstrName(instructionID);
specWithOpSizeName =
x86DisassemblerGetInstrName(instructionIDWithOpsize);
if (is16BitEquivalent(specName, specWithOpSizeName) &&
if (is16BitEquivalent(instructionID, instructionIDWithOpsize) &&
(insn->mode == MODE_16BIT) ^ insn->prefixPresent[0x66]) {
insn->instructionID = instructionIDWithOpsize;
insn->spec = specifierForUID(instructionIDWithOpsize);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save