10 Commits

Author SHA1 Message Date
Kazu Hirata
358513f662
[llvm] Replace LLVM_ATTRIBUTE_UNUSED with [[maybe_unused]] (NFC) (#163330)
This patch replaces LLVM_ATTRIBUTE_UNUSED with [[maybe_unused]] where
we do not need to move the position of [[maybe_unused]] within
declarations.

Notes:

- [[maybe_unused]] is a standard feature of C++17.

- The compiler is far more lenient about the placement of
  __attribute__((unused)) than that of [[maybe_unused]].

I'll follow up with another patch to finish up the rest.
2025-10-14 07:15:44 -07:00
Rahul Joshi
7b6db769c3
[NFC][DecoderEmitter] Code cleanup in DecoderEmitter::emitTable (#158014)
Several code cleanup changes in code to emit decoder tables:
- Start comments on each line at a fixed column for readibility.
- Combine repeated code to decode and emit ULEB128 into a single
function.
- Add helper `getDecoderOpName` to print decoder op.
- Print Filter/CheckField/predicate index values with those opcodes.
2025-09-15 17:51:29 -07:00
Sergei Barannikov
fa59e61e65
[CSKY] Decode CARRY / GPRSP operands not encoded into instruction (NFCI) (#157338)
The generated decoder can now decode these operands. All we need to do
is to add `bits<0>` for these operands to instruction records and
provide operand decoders.

While here, reformat adjacent lines.
2025-09-07 13:47:23 +00:00
Rahul Joshi
22f8693248
[NFC][MC][Decoder] Extract fixed pieces of decoder code into new header file (#154802)
Extract fixed functions generated by decoder emitter into a new
MCDecoder.h header.
2025-08-21 15:06:43 -07:00
Fangrui Song
432caca39a Simplify with hasFeature. NFC 2023-02-17 18:22:24 -08:00
Zi Xuan Wu (Zeson)
162131257f [CSKY] Fix the compiling error about missing Log2 function with Log2_64 2022-09-07 14:49:40 +08:00
Sheng
c644488a8b Rename MCFixedLenDisassembler.h as MCDecoderOps.h
The name `MCFixedLenDisassembler.h` is out of date after D120958.

Rename it as `MCDecoderOps.h` to reflect the change.

Reviewed By: myhsu

Differential Revision: https://reviews.llvm.org/D124987
2022-05-15 08:44:58 +08:00
Fangrui Song
ef437a7d3f [CSKY] Fix some Clang warnings. NFC
Reviewed By: zixuan-wu

Differential Revision: https://reviews.llvm.org/D122872
2022-04-06 20:09:32 -07:00
Maksim Panchenko
4ae9745af1 [Disassember][NFCI] Use strong type for instruction decoder
All LLVM backends use MCDisassembler as a base class for their
instruction decoders. Use "const MCDisassembler *" for the decoder
instead of "const void *". Remove unnecessary static casts.

Reviewed By: skan

Differential Revision: https://reviews.llvm.org/D122245
2022-03-25 18:53:59 -07:00
Zi Xuan Wu
ec642ceebc [CSKY] Add CSKYDisassembler.cpp to construct objdump
CSKYDisassembler tries to disassemble register MC operand from register num for different register class, and
also handles immediate num and carry flag operand which is not encoded in instruction binary.

Also enhance the printer of instruction to accept sub-option to control the print format. Sometimes, it prefers to
print number in hex, especially when immediate number represents symbol address.
2022-02-08 16:02:59 +08:00