[llvm] a21940e - [mips] Define mem_simm# operands using tblgen `foreach` loop. NFC
Simon Atanasyan via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 20 06:42:31 PST 2019
Author: Simon Atanasyan
Date: 2019-11-20T17:42:15+03:00
New Revision: a21940eac149dc03d9e028023bbd059f871af1c5
URL: https://github.com/llvm/llvm-project/commit/a21940eac149dc03d9e028023bbd059f871af1c5
DIFF: https://github.com/llvm/llvm-project/commit/a21940eac149dc03d9e028023bbd059f871af1c5.diff
LOG: [mips] Define mem_simm# operands using tblgen `foreach` loop. NFC
Added:
Modified:
llvm/lib/Target/Mips/MipsInstrInfo.td
Removed:
################################################################################
diff --git a/llvm/lib/Target/Mips/MipsInstrInfo.td b/llvm/lib/Target/Mips/MipsInstrInfo.td
index 4c277113d54f..da8be7c640b8 100644
--- a/llvm/lib/Target/Mips/MipsInstrInfo.td
+++ b/llvm/lib/Target/Mips/MipsInstrInfo.td
@@ -1140,17 +1140,11 @@ def simm12 : Operand<i32> {
let DecoderMethod = "DecodeSimm12";
}
-def mem_simm9 : mem_generic {
- let MIOperandInfo = (ops ptr_rc, simm9);
- let EncoderMethod = "getMemEncoding";
- let ParserMatchClass = MipsMemSimmAsmOperand<9>;
-}
-
-def mem_simm10 : mem_generic {
- let MIOperandInfo = (ops ptr_rc, simm10);
- let EncoderMethod = "getMemEncoding";
- let ParserMatchClass = MipsMemSimmAsmOperand<10>;
-}
+foreach I = {9, 10, 11, 12, 16} in
+ def mem_simm # I : mem_generic {
+ let MIOperandInfo = (ops ptr_rc, !cast<Operand>("simm" # I));
+ let ParserMatchClass = MipsMemSimmAsmOperand<I>;
+ }
foreach I = {1, 2, 3} in
def mem_simm10_lsl # I : mem_generic {
@@ -1159,24 +1153,6 @@ foreach I = {1, 2, 3} in
let ParserMatchClass = MipsMemSimmAsmOperand<10, I>;
}
-def mem_simm11 : mem_generic {
- let MIOperandInfo = (ops ptr_rc, simm11);
- let EncoderMethod = "getMemEncoding";
- let ParserMatchClass = MipsMemSimmAsmOperand<11>;
-}
-
-def mem_simm12 : mem_generic {
- let MIOperandInfo = (ops ptr_rc, simm12);
- let EncoderMethod = "getMemEncoding";
- let ParserMatchClass = MipsMemSimmAsmOperand<12>;
-}
-
-def mem_simm16 : mem_generic {
- let MIOperandInfo = (ops ptr_rc, simm16);
- let EncoderMethod = "getMemEncoding";
- let ParserMatchClass = MipsMemSimmAsmOperand<16>;
-}
-
def mem_simmptr : mem_generic {
let ParserMatchClass = MipsMemSimmPtrAsmOperand;
}
More information about the llvm-commits
mailing list