[all-commits] [llvm/llvm-project] 522d90: Revert "Fix a misuse of `cast`"

Sheng via All-commits all-commits at lists.llvm.org
Mon May 2 12:37:37 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 522d90528e5a49393b7293204e20b311e789a913
      https://github.com/llvm/llvm-project/commit/522d90528e5a49393b7293204e20b311e789a913
  Author: Sheng <ox59616e at gmail.com>
  Date:   2022-05-03 (Tue, 03 May 2022)

  Changed paths:
    M llvm/utils/TableGen/FixedLenDecoderEmitter.cpp

  Log Message:
  -----------
  Revert "Fix a misuse of `cast`"

This reverts commit ba59ec2843f99f19d55d7cd9f9ac536fb038fdab.


  Commit: 28e850a8da51336bb85343e7c106953b5dbe5b15
      https://github.com/llvm/llvm-project/commit/28e850a8da51336bb85343e7c106953b5dbe5b15
  Author: Sheng <ox59616e at gmail.com>
  Date:   2022-05-03 (Tue, 03 May 2022)

  Changed paths:
    A llvm/test/TableGen/VarLenDecoder.td
    M llvm/utils/TableGen/FixedLenDecoderEmitter.cpp
    M llvm/utils/TableGen/VarLenCodeEmitterGen.cpp
    M llvm/utils/TableGen/VarLenCodeEmitterGen.h

  Log Message:
  -----------
  [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


  Commit: df3765bfdc13ab01bbdd3ffe3711b1d13e368249
      https://github.com/llvm/llvm-project/commit/df3765bfdc13ab01bbdd3ffe3711b1d13e368249
  Author: Sheng <ox59616e at gmail.com>
  Date:   2022-05-03 (Tue, 03 May 2022)

  Changed paths:
    M llvm/utils/TableGen/CMakeLists.txt
    A llvm/utils/TableGen/DecoderEmitter.cpp
    M llvm/utils/TableGen/DisassemblerEmitter.cpp
    R llvm/utils/TableGen/FixedLenDecoderEmitter.cpp
    M llvm/utils/gn/secondary/llvm/utils/TableGen/BUILD.gn

  Log Message:
  -----------
  [NFC] Rename `FixedLenDecoderEmitter` as `DecoderEmitter`

Since now we are able to handle both fixed length & variable
length instructions.

Reviewed By: myhsu

Differential Revision: https://reviews.llvm.org/D123451


Compare: https://github.com/llvm/llvm-project/compare/a0b5af46a2a0...df3765bfdc13


More information about the All-commits mailing list