9 Commits

Author SHA1 Message Date
wanglei
d6675b6a61 [LoongArch] Add definition for LVZ/LBT instructions
This patch defines the `LVZ` and `LBT` extension instructions, which
provide enough definitions for llvm-mc and llvm-objdump to correctly
handle these instructions.

It also defines the `SCR` (Scratchpad Register) register class, which
are used by the `LBT` extension instructions.

Reviewed By: SixWeining, xen0n

Differential Revision: https://reviews.llvm.org/D155917
2023-07-24 13:11:02 +08:00
wanglei
f3d18b9dc6 [LoongArch] Add definition for LASX instructions
This patch adds the definition of the LASX instructions, providing
support only for assembly and disassembly, similar to D154183.

Depends on D154183

Reviewed By: SixWeining

Differential Revision: https://reviews.llvm.org/D154195
2023-07-07 11:21:53 +08:00
wanglei
1aa3b64ed2 [LoongArch] Add definition for LSX instructions
This patch adds the definition for the `LSX` registers and instructions.
It also adds handling for new immediate operands in the AsmParser. This
patch ensures that llvm-mc and llvm-objdump correctly handle the `LSX`
instructions.

We expand those pseudo-instructions `vrepli.{b,h,w,d}` in the
MCCodeEmitter. This increases the readability of the output when
generating assembly files.

Reviewed By: SixWeining

Differential Revision: https://reviews.llvm.org/D154183
2023-07-07 11:21:53 +08:00
wanglei
f292d53c70 [LoongArch] Fix undefined behavior: left shift of negative value
Fix undefined behavior in `decodeSImmOperand` where we were left shifting
a signed value.
2023-01-11 21:16:38 +08:00
Weining Lu
904a87ace3 [LoongArch] Use end namespace xxx style comment. NFC 2022-07-26 15:01:29 +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
Weining Lu
3a49ad717c [LoongArch] Add basic floating-point instructions definition
These instructions are added by following the `LoongArch Reference
Manual Volume 1: Basic Architecture Version 1.00`.

Differential Revision: https://reviews.llvm.org/D123988
2022-04-21 10:04:20 +08: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
Weining Lu
7898587e94 [LoongArch] Add basic support to Disassembler
With the addition of disassembler now we can do instructions 'round-trip' test
that assembles `.s` to obj with `llvm-mc` and disassembles it with `llvm-objdump`
to check instruction mnemonics.

Reviewed By: xen0n, MaskRay

Differential Revision: https://reviews.llvm.org/D120477
2022-03-10 17:08:31 +08:00