[PATCH] D144154: [X86]Use Class to refactor ArithMetic td file in X86
Wang, Xin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 15 18:51:31 PST 2023
XinWang10 added inline comments.
================
Comment at: llvm/lib/Target/X86/X86InstrArithmetic.td:460
+// UnaryOpR - Instructions like "inc reg"
+class UnaryOpR<bits<8> opcode, Format f, string mnemonic, X86TypeInfo info,
+ list<dag> pattern>
----------------
skan wrote:
> It seems this class is never used?
Actually, will remove.
================
Comment at: llvm/lib/Target/X86/X86InstrArithmetic.td:741
+let Defs = [AX,DX,EFLAGS], Uses = [AX] in
+def IMUL16r : MulOpR<0xF7, MRM5r, "imul", Xi16, WriteIMul16, []>;
+// EAX,EDX = EAX*GR32
----------------
skan wrote:
> Could we define `MulOpR` as a multiclass and use `defm IMUL`?
I don't know if it is necessary? In my understanding, class and multiclass is designed for reuse, but if I rewrite a MulOpR as a multiclass here for IMUL, seems it has only one user here?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D144154/new/
https://reviews.llvm.org/D144154
More information about the llvm-commits
mailing list