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
- 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. - In-place tarballs of
libffi
andgmp
needs to be updated to the version that support LoongArch. - Trying bootstrap from a unregisterised compiler needs to add
#undef UnregisterisedCompiler
ingenapply/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.