[llvm] [X86][MC] Add alias for `{evex} cmp` and `{evex} test`. (PR #99277)

Shengchen Kan via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 24 23:34:29 PDT 2024


================
@@ -3784,6 +3784,68 @@ bool X86AsmParser::processInstruction(MCInst &Inst, const OperandVector &Ops) {
     Inst.setOpcode(X86::INT3);
     return true;
   }
+  // `{evex} cmp <>, <>` is alias of `ccmpt {dfv=} <>, <>`
+#define FROM_TO(FROM, TO)                                                      \
+  case X86::FROM: {                                                            \
+    if (ForcedOpcodePrefix == OpcodePrefix_EVEX) {                             \
----------------
KanRobert wrote:

Maybe we don't need to care about the code size after macro expansion. Before expansion, the code is not duplicated and easy to maintain. The compiler used to build LLVM should be able to extract the code into a function if it's beneficial.

https://github.com/llvm/llvm-project/pull/99277


More information about the llvm-commits mailing list