13 Commits

Author SHA1 Message Date
Min-Yih Hsu
d2672a5501 [M68k][MC] Add fmove.l from / to fp control registers
Including splitting up the FPCR register class into classes with finer
granularities.
Right now we only support address / data registers as source /
destinations.
2023-12-11 23:02:07 -08:00
Min-Yih Hsu
7486b7b6ba [M68k] Basic FP register files and FMOVE implementations
- FP registers and register classes definitions
  - MC support for FP registers
  - MC support for the FPDR -> FPDR variant of FMOVE/FSMOVE/FDSMOVE

Note that we don't implement 32/64-bit FP registers with subregisters since
f32/f64 values will be converted to f80 upon storing into a register,
rather than occupying part of the register.
So we only use register classes with different value types to distinguish
them.

Differential Revision: https://reviews.llvm.org/D147480
2023-04-08 10:42:47 -07:00
Min-Yih Hsu
c40b158ea0 [M68k][Disassembler] Use custom decoder for 32-bit immediates
32-bit immediates require special cares because they go across the
normal word (16 bits) boundaries.
This patch also fixes some incorrect disassembler test cases.

Differential Revision: https://reviews.llvm.org/D142080
2023-01-24 21:59:24 -08:00
Min-Yih Hsu
52d509f38b [M68k][Disassembler] Cleanup unused variables. NFC
- Remove `MaxInstrWord` in M68kDisassembler.cpp.
  - Remove `MCII` field in `M68kDisassembler` class.

NFC.
2022-05-21 17:23:51 -07:00
Sheng
df25f0d520 [M68k] Fix a bug in disassembler
Sorry for my reckless patch. In some cases `RoundUp` is less than
the bit width of APInt. We need to check this before we do zext.
2022-05-19 21:19:44 +08:00
Sheng
017c98276b [NFC][M68k] Replace APInt::zextOrSelf with APInt::zext
This is a follow up to D125558
2022-05-19 20:43:56 +08:00
Sheng
a5d618b393 [M68k][Disassembler] Fix decoding conflict
This diff fixes decoding conflict between these pair of instructions:

ADD(16|32)dd / ADD(16|32)dr
SUB(16|32)dd / SUB(16|32)dr
AND(16|32)dd / AND(16|32)dr
OR(16|32)dd  / OR(16|32)dr

Reviewed By: ricky26

Differential Revision: https://reviews.llvm.org/D125861
2022-05-19 09:10:50 +08:00
Sheng
cf0b6df6db [M68k][Disassembler] Adopt the new variable length decoder
This is an example usage of D120958.

After these patches are landed, we can strip off the codebeads officially.

Reviewed By: myhsu

Differential Revision: https://reviews.llvm.org/D120960
2022-05-15 08:44:58 +08:00
Jim Lin
6bf22ae4d3 [M68k][NFC] Fix file header
Let all file header have the same style. NFC.
2022-01-04 10:14:01 +08:00
Reid Kleckner
89b57061f7 Move TargetRegistry.(h|cpp) from Support to MC
This moves the registry higher in the LLVM library dependency stack.
Every client of the target registry needs to link against MC anyway to
actually use the target, so we might as well move this out of Support.

This allows us to ensure that Support doesn't have includes from MC/*.

Differential Revision: https://reviews.llvm.org/D111454
2021-10-08 14:51:48 -07:00
Ricky Taylor
e1e3b6ee72 [M68k] Avoid UB in disassembler
When reading 32 bits a 32-bit shift would be executed.

This is undefined behaviour, but in this case we can just replace the
entire scratch value to avoid it.

Differential Revision: https://reviews.llvm.org/D110769
2021-09-29 22:07:14 +01:00
Min-Yih Hsu
6f4ed8c0bd [M68k][Disassembler][NFC] Decorate dump methods with LLVM_DUMP_METHOD
And guard them with proper macro conditions. NFC.
2021-04-22 12:02:07 -07:00
Ricky Taylor
2221185776 [M68k] Implement Disassembler
This is an implementation of a disassembler for M68k.

Differential Revision: https://reviews.llvm.org/D98540
2021-04-19 22:24:12 +01:00