From 2be2c0fed88489c65e3f1586a229b6ccb578423a Mon Sep 17 00:00:00 2001 From: Rot127 Date: Thu, 25 Apr 2024 02:51:16 -0500 Subject: [PATCH] Add MatrixIndex_... to the OP_GROUP list --- README.md | 7 +++++++ llvm/utils/TableGen/PrinterCapstone.cpp | 3 +++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 83668ef614e9..ae5188efa9b5 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,13 @@ So you need to figure out where this specific code snipped is printed and add `t To fix this the function declaration is probably missing in the header (e.g. `InstPrinter.h`). You can copy the `DEFINE_printMatrix()` function to the header and rewrite it as declaration. Just check the other `DECLARE_...` macros in the header file. +- And `ARCH_OP_GROUP_...` is missing or not generated. Build error like: + ``` + AArch64InstPrinter.c:2249:42: error: ‘AArch64_OP_GROUP_MatrixIndex_8’ undeclared (first use in this function); did you mean ‘AArch64_OP_GROUP_MatrixIndex’? + 2249 | add_cs_detail(MI, CONCAT(AArch64_OP_GROUP_MatrixIndex, Scale), \ + ``` + Fix it by adding the postfix `MatrixIndex_8` to one of the exception lists in `PrinterCapstone::printOpPrintGroupEnum()`. + - If the mapping files miss operand types or access information, then the `.td` files are incomplete (happens surprisingly often). You need to search for the instruction or operands with missing or incorrect values and fix them. ``` diff --git a/llvm/utils/TableGen/PrinterCapstone.cpp b/llvm/utils/TableGen/PrinterCapstone.cpp index ca82e9cbc73f..1a162f591293 100644 --- a/llvm/utils/TableGen/PrinterCapstone.cpp +++ b/llvm/utils/TableGen/PrinterCapstone.cpp @@ -2968,6 +2968,9 @@ void printOpPrintGroupEnum(StringRef const &TargetName, "SVELogicalImm_int16_t", "SVELogicalImm_int32_t", "SVELogicalImm_int64_t", + "MatrixIndex_8", + "MatrixIndex_0", + "MatrixIndex_1", "ZPRasFPR_128"}; bool NoExceptions = false;