aboutsummaryrefslogtreecommitdiff
path: root/lldb/packages/Python/lldbsuite/test/lldbgdbclient.py
diff options
context:
space:
mode:
authorSergei Barannikov <barannikov88@gmail.com>2025-08-22 01:22:16 +0300
committerGitHub <noreply@github.com>2025-08-21 22:22:16 +0000
commit33f6b10c179f3636904415b73b7d71556583061b (patch)
tree36b0c68b76dea0faefed988f992e4da5c986f143 /lldb/packages/Python/lldbsuite/test/lldbgdbclient.py
parentd4b9acad580d85ff95a30056f5a89cc41ef31b55 (diff)
downloadllvm-33f6b10c179f3636904415b73b7d71556583061b.zip
llvm-33f6b10c179f3636904415b73b7d71556583061b.tar.gz
llvm-33f6b10c179f3636904415b73b7d71556583061b.tar.bz2
[TableGen][DecoderEmitter] Resolve a FIXME in emitDecoder (#154649)
As the FIXME says, we might generate the wrong code to decode an instruction if it had an operand with no encoding bits. An example is M68k's `MOV16ds` that is defined as follows: ``` dag OutOperandList = (outs MxDRD16:$dst); dag InOperandList = (ins SRC:$src); list<Register> Uses = [SR]; string AsmString = "move.w\t$src, $dst" dag Inst = (descend { 0, 1, 0, 0, 0, 0, 0, 0, 1, 1 }, (descend { 0, 0, 0 }, (operand "$dst", 3))); ``` The `$src` operand is not encoded, but what we see in the decoder is: ```C++ tmp = fieldFromInstruction(insn, 0, 3); if (!Check(S, DecodeDR16RegisterClass(MI, tmp, Address, Decoder))) { return MCDisassembler::Fail; } if (!Check(S, DecodeSRCRegisterClass(MI, insn, Address, Decoder))) { return MCDisassembler::Fail; } return S; ``` This calls DecodeSRCRegisterClass passing it `insn` instead of the value of a field that doesn't exist. DecodeSRCRegisterClass has an unconditional llvm_unreachable inside it. New decoder looks like: ```C++ tmp = fieldFromInstruction(insn, 0, 3); if (!Check(S, DecodeDR16RegisterClass(MI, tmp, Address, Decoder))) { return MCDisassembler::Fail; } return S; ``` We're still not disassembling this instruction right, but at least we no longer have to provide a weird operand decoder method that accepts instruction bits instead of operand bits. See #154477 for the origins of the FIXME.
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lldbgdbclient.py')
0 files changed, 0 insertions, 0 deletions