[PATCH] D52100: [tblgen] Allow FixedLenDecoderEmitter to use APInt-like objects as InsnType

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 22 01:40:47 PDT 2018


nhaehnle added inline comments.


================
Comment at: utils/TableGen/FixedLenDecoderEmitter.cpp:2119-2120
      << "                                     unsigned numBits) {\n"
-     << "    assert(startBit + numBits <= (sizeof(InsnType)*8) &&\n"
-     << "           \"Instruction field out of bounds!\");\n"
-     << "    InsnType fieldMask;\n"
-     << "    if (numBits == sizeof(InsnType)*8)\n"
-     << "      fieldMask = (InsnType)(-1LL);\n"
-     << "    else\n"
-     << "      fieldMask = (((InsnType)1 << numBits) - 1) << startBit;\n"
-     << "    return (insn & fieldMask) >> startBit;\n"
+     << "  assert(startBit + numBits <= 64 && \"Cannot support >64-bit "
+        "extractions!\");\n"
+     << "  return fieldFromInstruction(insn, startBit, numBits, "
----------------
This assertion seems to defeat the point of the change?


Repository:
  rL LLVM

https://reviews.llvm.org/D52100





More information about the llvm-commits mailing list