Tidy up a bit.

llvm-svn: 145458
This commit is contained in:
Jim Grosbach 2011-11-29 23:51:09 +00:00
parent 187748456a
commit 182b6a077e
2 changed files with 10 additions and 33 deletions

View File

@ -78,6 +78,7 @@ def VectorIndex32 : Operand<i32>, ImmLeaf<i32, [{
def VecListOneDAsmOperand : AsmOperandClass { def VecListOneDAsmOperand : AsmOperandClass {
let Name = "VecListOneD"; let Name = "VecListOneD";
let ParserMethod = "parseVectorList"; let ParserMethod = "parseVectorList";
let RenderMethod = "addVecListOperands";
} }
def VecListOneD : RegisterOperand<DPR, "printVectorListOne"> { def VecListOneD : RegisterOperand<DPR, "printVectorListOne"> {
let ParserMatchClass = VecListOneDAsmOperand; let ParserMatchClass = VecListOneDAsmOperand;
@ -86,6 +87,7 @@ def VecListOneD : RegisterOperand<DPR, "printVectorListOne"> {
def VecListTwoDAsmOperand : AsmOperandClass { def VecListTwoDAsmOperand : AsmOperandClass {
let Name = "VecListTwoD"; let Name = "VecListTwoD";
let ParserMethod = "parseVectorList"; let ParserMethod = "parseVectorList";
let RenderMethod = "addVecListOperands";
} }
def VecListTwoD : RegisterOperand<DPR, "printVectorListTwo"> { def VecListTwoD : RegisterOperand<DPR, "printVectorListTwo"> {
let ParserMatchClass = VecListTwoDAsmOperand; let ParserMatchClass = VecListTwoDAsmOperand;
@ -94,6 +96,7 @@ def VecListTwoD : RegisterOperand<DPR, "printVectorListTwo"> {
def VecListThreeDAsmOperand : AsmOperandClass { def VecListThreeDAsmOperand : AsmOperandClass {
let Name = "VecListThreeD"; let Name = "VecListThreeD";
let ParserMethod = "parseVectorList"; let ParserMethod = "parseVectorList";
let RenderMethod = "addVecListOperands";
} }
def VecListThreeD : RegisterOperand<DPR, "printVectorListThree"> { def VecListThreeD : RegisterOperand<DPR, "printVectorListThree"> {
let ParserMatchClass = VecListThreeDAsmOperand; let ParserMatchClass = VecListThreeDAsmOperand;
@ -102,6 +105,7 @@ def VecListThreeD : RegisterOperand<DPR, "printVectorListThree"> {
def VecListFourDAsmOperand : AsmOperandClass { def VecListFourDAsmOperand : AsmOperandClass {
let Name = "VecListFourD"; let Name = "VecListFourD";
let ParserMethod = "parseVectorList"; let ParserMethod = "parseVectorList";
let RenderMethod = "addVecListOperands";
} }
def VecListFourD : RegisterOperand<DPR, "printVectorListFour"> { def VecListFourD : RegisterOperand<DPR, "printVectorListFour"> {
let ParserMatchClass = VecListFourDAsmOperand; let ParserMatchClass = VecListFourDAsmOperand;
@ -110,6 +114,7 @@ def VecListFourD : RegisterOperand<DPR, "printVectorListFour"> {
def VecListTwoQAsmOperand : AsmOperandClass { def VecListTwoQAsmOperand : AsmOperandClass {
let Name = "VecListTwoQ"; let Name = "VecListTwoQ";
let ParserMethod = "parseVectorList"; let ParserMethod = "parseVectorList";
let RenderMethod = "addVecListOperands";
} }
def VecListTwoQ : RegisterOperand<DPR, "printVectorListTwo"> { def VecListTwoQ : RegisterOperand<DPR, "printVectorListTwo"> {
let ParserMatchClass = VecListTwoQAsmOperand; let ParserMatchClass = VecListTwoQAsmOperand;

View File

@ -1527,39 +1527,11 @@ public:
Inst.addOperand(MCOperand::CreateImm(unsigned(getProcIFlags()))); Inst.addOperand(MCOperand::CreateImm(unsigned(getProcIFlags())));
} }
void addVecListOneDOperands(MCInst &Inst, unsigned N) const { void addVecListOperands(MCInst &Inst, unsigned N) const {
assert(N == 1 && "Invalid number of operands!"); assert(N == 1 && "Invalid number of operands!");
Inst.addOperand(MCOperand::CreateReg(VectorList.RegNum)); Inst.addOperand(MCOperand::CreateReg(VectorList.RegNum));
} }
void addVecListTwoDOperands(MCInst &Inst, unsigned N) const {
assert(N == 1 && "Invalid number of operands!");
// Only the first register actually goes on the instruction. The rest
// are implied by the opcode.
Inst.addOperand(MCOperand::CreateReg(VectorList.RegNum));
}
void addVecListThreeDOperands(MCInst &Inst, unsigned N) const {
assert(N == 1 && "Invalid number of operands!");
// Only the first register actually goes on the instruction. The rest
// are implied by the opcode.
Inst.addOperand(MCOperand::CreateReg(VectorList.RegNum));
}
void addVecListFourDOperands(MCInst &Inst, unsigned N) const {
assert(N == 1 && "Invalid number of operands!");
// Only the first register actually goes on the instruction. The rest
// are implied by the opcode.
Inst.addOperand(MCOperand::CreateReg(VectorList.RegNum));
}
void addVecListTwoQOperands(MCInst &Inst, unsigned N) const {
assert(N == 1 && "Invalid number of operands!");
// Only the first register actually goes on the instruction. The rest
// are implied by the opcode.
Inst.addOperand(MCOperand::CreateReg(VectorList.RegNum));
}
void addVectorIndex8Operands(MCInst &Inst, unsigned N) const { void addVectorIndex8Operands(MCInst &Inst, unsigned N) const {
assert(N == 1 && "Invalid number of operands!"); assert(N == 1 && "Invalid number of operands!");
Inst.addOperand(MCOperand::CreateImm(getVectorIndex())); Inst.addOperand(MCOperand::CreateImm(getVectorIndex()));
@ -3444,7 +3416,7 @@ bool ARMAsmParser::
cvtVLDwbFixed(MCInst &Inst, unsigned Opcode, cvtVLDwbFixed(MCInst &Inst, unsigned Opcode,
const SmallVectorImpl<MCParsedAsmOperand*> &Operands) { const SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
// Vd // Vd
((ARMOperand*)Operands[3])->addVecListTwoDOperands(Inst, 1); ((ARMOperand*)Operands[3])->addVecListOperands(Inst, 1);
// Create a writeback register dummy placeholder. // Create a writeback register dummy placeholder.
Inst.addOperand(MCOperand::CreateImm(0)); Inst.addOperand(MCOperand::CreateImm(0));
// Vn // Vn
@ -3458,7 +3430,7 @@ bool ARMAsmParser::
cvtVLDwbRegister(MCInst &Inst, unsigned Opcode, cvtVLDwbRegister(MCInst &Inst, unsigned Opcode,
const SmallVectorImpl<MCParsedAsmOperand*> &Operands) { const SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
// Vd // Vd
((ARMOperand*)Operands[3])->addVecListTwoDOperands(Inst, 1); ((ARMOperand*)Operands[3])->addVecListOperands(Inst, 1);
// Create a writeback register dummy placeholder. // Create a writeback register dummy placeholder.
Inst.addOperand(MCOperand::CreateImm(0)); Inst.addOperand(MCOperand::CreateImm(0));
// Vn // Vn
@ -3478,7 +3450,7 @@ cvtVSTwbFixed(MCInst &Inst, unsigned Opcode,
// Vn // Vn
((ARMOperand*)Operands[4])->addAlignedMemoryOperands(Inst, 2); ((ARMOperand*)Operands[4])->addAlignedMemoryOperands(Inst, 2);
// Vt // Vt
((ARMOperand*)Operands[3])->addVecListTwoDOperands(Inst, 1); ((ARMOperand*)Operands[3])->addVecListOperands(Inst, 1);
// pred // pred
((ARMOperand*)Operands[1])->addCondCodeOperands(Inst, 2); ((ARMOperand*)Operands[1])->addCondCodeOperands(Inst, 2);
return true; return true;
@ -3494,7 +3466,7 @@ cvtVSTwbRegister(MCInst &Inst, unsigned Opcode,
// Vm // Vm
((ARMOperand*)Operands[5])->addRegOperands(Inst, 1); ((ARMOperand*)Operands[5])->addRegOperands(Inst, 1);
// Vt // Vt
((ARMOperand*)Operands[3])->addVecListTwoDOperands(Inst, 1); ((ARMOperand*)Operands[3])->addVecListOperands(Inst, 1);
// pred // pred
((ARMOperand*)Operands[1])->addCondCodeOperands(Inst, 2); ((ARMOperand*)Operands[1])->addCondCodeOperands(Inst, 2);
return true; return true;