This is a split patch of D120476 and thanks to myhsu.
'Transformed' means the encoding of an immediate is not the same as
its binary representation. For example, the `bl` instruction
requires a signed 28-bits integer as its operand and the low 2 bits
must be 0. So only the upper 26 bits are needed to get encoded into
the instruction.
Based on the above reason this kind of immediate needs a customed
`EncoderMethod` to get the real value getting encoded into the
instruction.
Currently these immediate includes:
```
uimm2_plus1
simm14_lsl2
simm16_lsl2
simm21_lsl2
simm26_lsl2
```
This patch adds those `EncoderMethod`s and revises related .mir test
in previous patch.
Reviewed By: xen0n, MaskRay
Differential Revision: https://reviews.llvm.org/D120545
This patch corrects some instruction definitions that I incorrectly wrote
in initial patches including bstr{ins/pick}.{w/d}, ll.{w/d} and sc.{w/d}.
Reviewed By: xen0n
Differential Revision: https://reviews.llvm.org/D119817
This patch adds a '$' prefix to register name in InstPrinter that I missed in initial patches.
Reviewed By: xen0n
Differential Revision: https://reviews.llvm.org/D119813
With the benefit of D88392, instruction encoding and mnemonic testing can be
achieved within MIR files before AsmParser is ready. This patch adds such
tests which cover all basic integer instructions we defined in previous patch.
Similarly those tests will be rewrote by .s and moved to test/MC/LoongArch.
Differential revision: https://reviews.llvm.org/D115862