[llvm] [LLVM][MC][DecoderEmitter] Add support to specialize decoder per bitwidth (PR #154865)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 29 14:10:03 PDT 2025
================
@@ -700,6 +700,12 @@ static constexpr DecoderListEntry DecoderList32[]{
{DecoderTableZdinxRV32Only32, {}, "RV32-only Zdinx (Double in Integer)"},
};
+// Define bitwidths for various types used to instantiate the decoder.
+template <> static constexpr uint32_t llvm::MCD::InsnBitWidth<uint16_t> = 16;
+template <> static constexpr uint32_t llvm::MCD::InsnBitWidth<uint32_t> = 32;
+// Use uint64_t to represent 48 bit instructions.
+template <> static constexpr uint32_t llvm::MCD::InsnBitWidth<uint64_t> = 48;
----------------
topperc wrote:
I'm not sure overloading on type is a good idea. For this reason and calling the function with the wrong type issue raised here https://github.com/llvm/llvm-project/pull/154865#issuecomment-3225069066
https://github.com/llvm/llvm-project/pull/154865
More information about the llvm-commits
mailing list