[PATCH] D88385: [TableGen][M68K] (Patch 1/8) Utilities for complex instruction addressing modes: CodeBeads and logical operand helper functions

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 23 04:47:46 PST 2021


jrtc27 added a comment.

Some minor remaining issues, but this is fine to commit once those are fixed IMO.



================
Comment at: llvm/utils/TableGen/CodeBeadsGen.cpp:17
+// instruction is usually associated with large amount of information like
+// addressing mode details used on a speicifc operand. Instead of retreating to
+// ad-hoc methods to figure out these information when encoding an instruction,
----------------
craig.topper wrote:
> speicifc -> specific
Still outstanding


================
Comment at: llvm/utils/TableGen/CodeBeadsGen.cpp:54
+  // Emit function declaration
+  OS << "const uint8_t * llvm::" << Target.getInstNamespace();
+  OS << "::getMCInstrBeads(unsigned Opcode) {\n";
----------------



================
Comment at: llvm/utils/TableGen/CodeBeadsGen.cpp:94-95
+
+    /// Convert to byte array:
+    /// [dcba] -> [a][b][c][d]
+    OS << "\t{";
----------------
Triple-slash is for doxygen


================
Comment at: llvm/utils/TableGen/InstrInfoEmitter.cpp:503
+
+    OS << "  switch(Opcode) {\n";
+    OS << "  default: return LogicalOpIdx;\n";
----------------



================
Comment at: llvm/utils/TableGen/InstrInfoEmitter.cpp:522
+  OS << "  auto S = 0U;\n";
+  OS << "  for(auto i = 0U; i < LogicalOpIdx; ++i)\n";
+  OS << "    S += getLogicalOperandSize(Opcode, i);\n";
----------------



================
Comment at: llvm/utils/TableGen/InstrInfoEmitter.cpp:601
+
+    OS << "  switch(Opcode) {\n";
+    OS << "  default: return -1;\n";
----------------



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

https://reviews.llvm.org/D88385



More information about the llvm-commits mailing list