Skip to content
This repository was archived by the owner on Sep 2, 2018. It is now read-only.

Commit 294cc52

Browse files
committed
[mips] Unified the MipsMemSimm9GPRAsmOperand and MipsMemSimm9AsmOperand operands, NFC.
Summary: These operands had the same purpose, however the MipsMemSimm9GPRAsmOperand operand was only for micromips32r6 and the MipsMemSimm9AsmOperand did not have a ParserMatchClass. Patch by Scott Egerton Reviewers: vkalintiris, dsanders Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12730 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247573 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 85e6f24 commit 294cc52

File tree

3 files changed

+10
-24
lines changed

3 files changed

+10
-24
lines changed

lib/Target/Mips/AsmParser/MipsAsmParser.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -944,9 +944,6 @@ class MipsOperand : public MCParsedAsmOperand {
944944
return isMem() && dyn_cast<MCConstantExpr>(getMemOff());
945945
}
946946
template <unsigned Bits> bool isMemWithSimmOffset() const {
947-
return isMem() && isConstantMemOff() && isInt<Bits>(getConstantMemOff());
948-
}
949-
template <unsigned Bits> bool isMemWithSimmOffsetGPR() const {
950947
return isMem() && isConstantMemOff() && isInt<Bits>(getConstantMemOff())
951948
&& getMemBase()->isGPRAsmReg();
952949
}

lib/Target/Mips/MicroMips32r6InstrInfo.td

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -185,26 +185,6 @@ class CVT_S_D_MMR6_ENC : POOL32F_CVT_DS_FM<"cvt.s.d", 0, 0b1101101>;
185185
class CVT_S_W_MMR6_ENC : POOL32F_CVT_DS_FM<"cvt.s.w", 1, 0b1101101>;
186186
class CVT_S_L_MMR6_ENC : POOL32F_CVT_DS_FM<"cvt.s.l", 2, 0b1101101>;
187187

188-
//===----------------------------------------------------------------------===//
189-
//
190-
// Operand Definitions
191-
//
192-
//===----------------------------------------------------------------------===//
193-
194-
def MipsMemSimm9GPRAsmOperand : AsmOperandClass {
195-
let Name = "MemOffsetSimm9GPR";
196-
let SuperClasses = [MipsMemAsmOperand];
197-
let RenderMethod = "addMemOperands";
198-
let ParserMethod = "parseMemOperand";
199-
let PredicateMethod = "isMemWithSimmOffsetGPR<9>";
200-
}
201-
202-
def mem_simm9gpr : mem_generic {
203-
let MIOperandInfo = (ops ptr_rc, simm9);
204-
let EncoderMethod = "getMemEncoding";
205-
let ParserMatchClass = MipsMemSimm9GPRAsmOperand;
206-
}
207-
208188
//===----------------------------------------------------------------------===//
209189
//
210190
// Instruction Descriptions
@@ -407,7 +387,7 @@ class SWE_MMR6_DESC_BASE<string opstr, DAGOperand RO, DAGOperand MO,
407387
let mayStore = 1;
408388
}
409389
class SW_MMR6_DESC : Store<"sw", GPR32Opnd>;
410-
class SWE_MMR6_DESC : SWE_MMR6_DESC_BASE<"swe", GPR32Opnd, mem_simm9gpr>;
390+
class SWE_MMR6_DESC : SWE_MMR6_DESC_BASE<"swe", GPR32Opnd, mem_simm9>;
411391

412392
/// Floating Point Instructions
413393
class FARITH_MMR6_DESC_BASE<string instr_asm, RegisterOperand RC,

lib/Target/Mips/MipsInstrInfo.td

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,14 @@ def MipsMemAsmOperand : AsmOperandClass {
451451
let ParserMethod = "parseMemOperand";
452452
}
453453

454+
def MipsMemSimm9AsmOperand : AsmOperandClass {
455+
let Name = "MemOffsetSimm9";
456+
let SuperClasses = [MipsMemAsmOperand];
457+
let RenderMethod = "addMemOperands";
458+
let ParserMethod = "parseMemOperand";
459+
let PredicateMethod = "isMemWithSimmOffset<9>";
460+
}
461+
454462
def MipsMemSimm11AsmOperand : AsmOperandClass {
455463
let Name = "MemOffsetSimm11";
456464
let SuperClasses = [MipsMemAsmOperand];
@@ -501,6 +509,7 @@ def mem_msa : mem_generic {
501509
def mem_simm9 : mem_generic {
502510
let MIOperandInfo = (ops ptr_rc, simm9);
503511
let EncoderMethod = "getMemEncoding";
512+
let ParserMatchClass = MipsMemSimm9AsmOperand;
504513
}
505514

506515
def mem_simm11 : mem_generic {

0 commit comments

Comments
 (0)