Skip to content

LoongArch Support

LoongArch is a new RISC ISA, which is a bit like MIPS or RISC-V. More information about LoongArch itself could be found on: Introduction to LoongArch and The unofficial yet comprehensive FAQ for LoongArch. This issue is about adding support for LoongArch.

Via the LLVM backend

Mostly refer to the RISCV port of GHC, due to the highly similarity of the LLVM backend implementation for these two architectures.

The LLVM Backend Patch: https://reviews.llvm.org/D137495

Initial LoongArch Support: !9292 (closed)

Noticing that the TableNextToCode support haven't been included yet.

Existing Issues

  1. The latest and oldest version of LLVM that provide LoongArch support will be LLVM 16 (Because it has not been released yet.). But currently, GHC itself has not support LLVM version 15 or higher, due to some changes in the way of how parameters are passing to the LLVM, both llvm-passes and -tbaa needs to be fixed.
  2. In-place tarballs of libffi and gmp needs to be updated to the version that support LoongArch.
  3. Trying bootstrap from a unregisterised compiler needs to add #undef UnregisterisedCompiler in genapply/Main.hs. This issue was mentioned in !4331 (closed).

Future Plans

  • Add TableNextToCode support.
  • There are currently no plans about writing a native code generator for LoongArch.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information