[PATCH] D119665: [M68k] Adopt VarLenCodeEmitter for control instructions

Sheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 15 16:45:07 PST 2022


0x59616e marked 4 inline comments as done.
0x59616e added inline comments.


================
Comment at: llvm/lib/Target/M68k/M68kInstrControl.td:169
+        (descend 0b0110, !cast<MxEncCondOp>("MxCC"#cc).Value, disp_8),
+        disp_16_32
+      );
----------------
myhsu wrote:
> I'm fine with the syntax here, however in the future if you want to avoid supplying `disp_16_32` with empty `(ascend)` for 16/32 bits variants, you can use the conditional bang operator `!cond` like this:
> ```
> class MxBcc<string cc, Operand TARGET, int SIZE>... {
>   ...
>   let Inst = !cond(
>       !eq(SIZE, 8):   /*encoding for Bcc8*/,
>       !eq(SIZE, 16):  /*encoding for Bcc16*/,
>       !eq(SIZE, 32):  /*encoding for Bcc32*/
>   );
> }
> ```
I leave a FIXME here ;)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119665/new/

https://reviews.llvm.org/D119665



More information about the llvm-commits mailing list