diff options
author | Sheng <ox59616e@gmail.com> | 2022-05-03 03:26:55 +0800 |
---|---|---|
committer | Sheng <ox59616e@gmail.com> | 2022-05-03 03:37:13 +0800 |
commit | 28e850a8da51336bb85343e7c106953b5dbe5b15 (patch) | |
tree | d46734d095d655f3fa030d30bdc2d172bdd29530 /llvm/lib/Object/Binary.cpp | |
parent | 522d90528e5a49393b7293204e20b311e789a913 (diff) | |
download | llvm-28e850a8da51336bb85343e7c106953b5dbe5b15.zip llvm-28e850a8da51336bb85343e7c106953b5dbe5b15.tar.gz llvm-28e850a8da51336bb85343e7c106953b5dbe5b15.tar.bz2 |
[TableGen] Add support for variable length instruction in decoder generator
To support variable length instructions, I think of them as fixed length instructions with the "maximum length". For example, if there're three instructions with 2, 6 and 9 bytes, we can fit them into the algorithm by treating them all as 9 bytes.
Also, since we can't know the length of the instruction in advance, there is a function object with type `void(APInt &, uint64_t)` added in the parameter list of `decodeInstruction` and `fieldFromInstruction`. We can use this to supply the additional bits the decoder needs after we know the opcode of the instruction.
Finally, `InstrLenTable` is added to let the decoder know the length of the instructions.
See D120960 for its usage.
Reviewed By: myhsu
Differential Revision: https://reviews.llvm.org/D120958
Diffstat (limited to 'llvm/lib/Object/Binary.cpp')
0 files changed, 0 insertions, 0 deletions