[llvm-commits] [llvm] r91879 - in /llvm/trunk/lib/Target/X86/Disassembler: X86DisassemblerDecoder.c X86DisassemblerDecoder.h
Sean Callanan
scallanan at apple.com
Mon Dec 21 18:07:42 PST 2009
Author: spyffe
Date: Mon Dec 21 20:07:42 2009
New Revision: 91879
URL: http://llvm.org/viewvc/llvm-project?rev=91879&view=rev
Log:
Changed REG_* to MODRM_REG_* to avoid conflicts
with symbols in AuroraUX's global namespace.
Modified:
llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c
llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h
Modified: llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c?rev=91879&r1=91878&r2=91879&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c (original)
+++ llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c Mon Dec 21 20:07:42 2009
@@ -876,15 +876,15 @@
*/
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 @@
* @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 @@
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;
}
}
Modified: llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h?rev=91879&r1=91878&r2=91879&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h (original)
+++ llvm/trunk/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h Mon Dec 21 20:07:42 2009
@@ -324,10 +324,10 @@
* 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;
/*
More information about the llvm-commits
mailing list