Changed REG_* to MODRM_REG_* to avoid conflicts

with symbols in AuroraUX's global namespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91879 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Sean Callanan 2009-12-22 02:07:42 +00:00
parent baf2e35e18
commit 06b766d1c0
2 changed files with 21 additions and 17 deletions

View File

@ -876,15 +876,15 @@ static int readModRM(struct InternalInstruction* insn) {
*/
switch (insn->registerSize) {
case 2:
insn->regBase = REG_AX;
insn->regBase = MODRM_REG_AX;
insn->eaRegBase = EA_REG_AX;
break;
case 4:
insn->regBase = REG_EAX;
insn->regBase = MODRM_REG_EAX;
insn->eaRegBase = EA_REG_EAX;
break;
case 8:
insn->regBase = REG_RAX;
insn->regBase = MODRM_REG_RAX;
insn->eaRegBase = EA_REG_RAX;
break;
}
@ -1051,7 +1051,7 @@ static int readModRM(struct InternalInstruction* insn) {
* @param valid - The address of a uint8_t. The target is set to 1 if the
* field is valid for the register class; 0 if not.
*/
GENERIC_FIXUP_FUNC(fixupRegValue, insn->regBase, REG)
GENERIC_FIXUP_FUNC(fixupRegValue, insn->regBase, MODRM_REG)
GENERIC_FIXUP_FUNC(fixupRMValue, insn->eaRegBase, EA_REG)
/*
@ -1145,26 +1145,30 @@ static void readOpcodeRegister(struct InternalInstruction* insn, uint8_t size) {
switch (size) {
case 1:
insn->opcodeRegister = (Reg)(REG_AL + ((bFromREX(insn->rexPrefix) << 3)
| insn->opcodeModifier));
insn->opcodeRegister = (Reg)(MODRM_REG_AL + ((bFromREX(insn->rexPrefix) << 3)
| insn->opcodeModifier));
if(insn->rexPrefix &&
insn->opcodeRegister >= REG_AL + 0x4 &&
insn->opcodeRegister < REG_AL + 0x8) {
insn->opcodeRegister = (Reg)(REG_SPL + (insn->opcodeRegister - REG_AL - 4));
insn->opcodeRegister >= MODRM_REG_AL + 0x4 &&
insn->opcodeRegister < MODRM_REG_AL + 0x8) {
insn->opcodeRegister = (Reg)(MODRM_REG_SPL
+ (insn->opcodeRegister - MODRM_REG_AL - 4));
}
break;
case 2:
insn->opcodeRegister = (Reg)(REG_AX + ((bFromREX(insn->rexPrefix) << 3)
| insn->opcodeModifier));
insn->opcodeRegister = (Reg)(MODRM_REG_AX
+ ((bFromREX(insn->rexPrefix) << 3)
| insn->opcodeModifier));
break;
case 4:
insn->opcodeRegister = (Reg)(REG_EAX + ((bFromREX(insn->rexPrefix) << 3)
| insn->opcodeModifier));
insn->opcodeRegister = (Reg)(MODRM_REG_EAX +
+ ((bFromREX(insn->rexPrefix) << 3)
| insn->opcodeModifier));
break;
case 8:
insn->opcodeRegister = (Reg)(REG_RAX + ((bFromREX(insn->rexPrefix) << 3)
|insn->opcodeModifier));
insn->opcodeRegister = (Reg)(MODRM_REG_RAX
+ ((bFromREX(insn->rexPrefix) << 3)
| insn->opcodeModifier));
break;
}
}

View File

@ -324,10 +324,10 @@ typedef enum {
* Reg - All possible values of the reg field in the ModR/M byte.
*/
typedef enum {
#define ENTRY(x) REG_##x,
#define ENTRY(x) MODRM_REG_##x,
ALL_REGS
#undef ENTRY
REG_max
MODRM_REG_max
} Reg;
/*