mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-10-15 05:25:55 +00:00
llvm-mc/x86: Rename X86Operand::ScaleReg to IndexReg and make order consistent
with syntax. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74679 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0e7a54672c
commit
55a3c6c324
@ -37,8 +37,8 @@ struct AsmParser::X86Operand {
|
|||||||
unsigned SegReg;
|
unsigned SegReg;
|
||||||
MCValue Disp;
|
MCValue Disp;
|
||||||
unsigned BaseReg;
|
unsigned BaseReg;
|
||||||
|
unsigned IndexReg;
|
||||||
unsigned Scale;
|
unsigned Scale;
|
||||||
unsigned ScaleReg;
|
|
||||||
} Mem;
|
} Mem;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -55,14 +55,14 @@ struct AsmParser::X86Operand {
|
|||||||
return Res;
|
return Res;
|
||||||
}
|
}
|
||||||
static X86Operand CreateMem(unsigned SegReg, MCValue Disp, unsigned BaseReg,
|
static X86Operand CreateMem(unsigned SegReg, MCValue Disp, unsigned BaseReg,
|
||||||
unsigned Scale, unsigned ScaleReg) {
|
unsigned IndexReg, unsigned Scale) {
|
||||||
X86Operand Res;
|
X86Operand Res;
|
||||||
Res.Kind = Memory;
|
Res.Kind = Memory;
|
||||||
Res.Mem.SegReg = SegReg;
|
Res.Mem.SegReg = SegReg;
|
||||||
Res.Mem.Disp = Disp;
|
Res.Mem.Disp = Disp;
|
||||||
Res.Mem.BaseReg = BaseReg;
|
Res.Mem.BaseReg = BaseReg;
|
||||||
|
Res.Mem.IndexReg = IndexReg;
|
||||||
Res.Mem.Scale = Scale;
|
Res.Mem.Scale = Scale;
|
||||||
Res.Mem.ScaleReg = ScaleReg;
|
|
||||||
return Res;
|
return Res;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -152,7 +152,7 @@ bool AsmParser::ParseX86MemOperand(X86Operand &Op) {
|
|||||||
|
|
||||||
// If we reached here, then we just ate the ( of the memory operand. Process
|
// If we reached here, then we just ate the ( of the memory operand. Process
|
||||||
// the rest of the memory operand.
|
// the rest of the memory operand.
|
||||||
unsigned BaseReg = 0, ScaleReg = 0, Scale = 0;
|
unsigned BaseReg = 0, IndexReg = 0, Scale = 0;
|
||||||
|
|
||||||
if (Lexer.is(asmtok::Register)) {
|
if (Lexer.is(asmtok::Register)) {
|
||||||
BaseReg = 123; // FIXME: decode reg #
|
BaseReg = 123; // FIXME: decode reg #
|
||||||
@ -163,7 +163,7 @@ bool AsmParser::ParseX86MemOperand(X86Operand &Op) {
|
|||||||
Lexer.Lex(); // eat the comma.
|
Lexer.Lex(); // eat the comma.
|
||||||
|
|
||||||
if (Lexer.is(asmtok::Register)) {
|
if (Lexer.is(asmtok::Register)) {
|
||||||
ScaleReg = 123; // FIXME: decode reg #
|
IndexReg = 123; // FIXME: decode reg #
|
||||||
Lexer.Lex(); // eat the register.
|
Lexer.Lex(); // eat the register.
|
||||||
Scale = 1; // If not specified, the scale defaults to 1.
|
Scale = 1; // If not specified, the scale defaults to 1.
|
||||||
}
|
}
|
||||||
@ -187,7 +187,7 @@ bool AsmParser::ParseX86MemOperand(X86Operand &Op) {
|
|||||||
return TokError("unexpected token in memory operand");
|
return TokError("unexpected token in memory operand");
|
||||||
Lexer.Lex(); // Eat the ')'.
|
Lexer.Lex(); // Eat the ')'.
|
||||||
|
|
||||||
Op = X86Operand::CreateMem(SegReg, Disp, BaseReg, Scale, ScaleReg);
|
Op = X86Operand::CreateMem(SegReg, Disp, BaseReg, IndexReg, Scale);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user