[PATCH] D115862: [LoongArch][test] (5/n) Add encoding and mnemonics tests

Lu Weining via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 16 00:53:09 PST 2021


SixWeining created this revision.
SixWeining requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

With the benefit of D88392 <https://reviews.llvm.org/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`.

As https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#table-of-instruction-encoding
describes, LoongArch instructions are encoded as bits[0] to bits[31] from right
to left. For easy comparison we add a '--little-endian' option to
llvm/utils/extract-section.py with which we can print the instruction encoding
as it is.

Depends on D115861 <https://reviews.llvm.org/D115861>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D115862

Files:
  llvm/test/CodeGen/LoongArch/1ri.mir
  llvm/test/CodeGen/LoongArch/2r.mir
  llvm/test/CodeGen/LoongArch/2ri.mir
  llvm/test/CodeGen/LoongArch/3r.mir
  llvm/test/CodeGen/LoongArch/3ri.mir
  llvm/test/CodeGen/LoongArch/lit.local.cfg
  llvm/test/CodeGen/LoongArch/misc.mir
  llvm/utils/extract-section.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115862.394779.patch
Type: text/x-patch
Size: 62163 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211216/415b07ec/attachment.bin>


More information about the llvm-commits mailing list