1. LoongArch intro
LoongArch is a RISC style ISA which is independently designed by Loongson
Technology in China. It is divided into two versions, the 32-bit version (LA32)
and the 64-bit version (LA64). LA64 applications have application-level
backward binary compatibility with LA32 applications. LoongArch is composed of
a basic part (Loongson Base) and an expanded part. The expansion part includes
Loongson Binary Translation (LBT), Loongson VirtualiZation (LVZ), Loongson SIMD
EXtension (LSX) and Loongson Advanced SIMD EXtension(LASX).
2. Conform to the policy
According to https://llvm.org/docs/DeveloperPolicy.html#adding-a-new-target
a) Of couse it will be an experimental target at first.
b) I'd like to be the code owner of this target.
c) There is an active community behind the target: https://github.com/loongson
And we will provide builbot support.
d) Documentations:
- ISA:
https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html
- ABI:
https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html
- More docs can be found at:
https://loongson.github.io/LoongArch-Documentation/README-EN.html
3. Status
We started to implement an out-of-tree LoongArch LLVM port since last year
based on llvm-8/11 and posted it to https://github.com/loongson/llvm-project
last month. This port also adds supports to clang front-end and we finally pass
100% llvm-test-suite in O0/1/2/3 optimization levels.
But in this port there
are a few issues we must handle to get it upstreamed.
- The codebase is too old that means we may use some out-of-date interfaces.
- The test coverage is not broad enough.
- Coding standard is not met.
The current status is that we have completed a series of 5 patches adding
triple, ELF machine, basic interger instructions and registers definition. We
will submit them for review later. Any comments are welcome and please do let
me know if you'd like to be added as a reviewer to future patches.
Thanks for your comments. Renato
Per your questions:
1. Loongson Binary Translation (LBT) is targeting binary translation from other architectures(like X86, ARM) to LoongArch.
2. Right, currently the documents for binary translation and vector extension are TBD. But those will be available before we bringing these extensions to LLVM.
3. Hardware or emulator: AFAIK there are some PC based on 3A5000 can be bought at https://www.jd.com/ (a Chinese online shopping website. I'm not sure if there is an English version ).
Searching "3A5000" will show several products, like https://item.jd.com/100015866577.html and https://item.jd.com/100023656622.html
Beside this, qemu and CLFS are available at https://github.com/loongson/build-tools which are convenient to try on.
4. The 5 initial patches are
https://reviews.llvm.org/D115857
https://reviews.llvm.org/D115859
https://reviews.llvm.org/D115860
https://reviews.llvm.org/D115861
https://reviews.llvm.org/D115862
Please help to reivew them or recommend other reviewers. Any comments are appreciate.
Thanks,
Weining
-----原始邮件-----
发件人:"Renato Golin" <reng...@gmail.com>
发送时间:2021-12-17 04:06:45 (星期五)
收件人: "陆伟宁" <luwe...@loongson.cn>
抄送: llvm-dev <llvm...@lists.llvm.org>, "余银" <yuyi...@loongson.cn>, "翟小娟" <zhaixi...@loongson.cn>
主题: Re: [llvm-dev] [RFC] Add a new backend called LoongArch
Thanks!
Weining
-----Original Messages-----
From:"Renato Golin" <reng...@gmail.com>
Sent Time:2021-12-17 18:07:15 (Friday)
To: "Weining Lu" <luwe...@loongson.cn>
Cc: llvm-dev <llvm...@lists.llvm.org>, "余银" <yuyi...@loongson.cn>, "翟小娟" <zhaixi...@loongson.cn>
Subject: Re: Re: [llvm-dev] [RFC] Add a new backend called LoongArch
Hi all,
The initial patches for upstraming LoongArch backend to LLVM are under review. Some of them have been approved and we'd like to get more inputs from you if interested. Comments are very appreciated.
Thanks,
Weining
-----Original Messages-----
From:"Weining Lu" <luwe...@loongson.cn>
Sent Time:2021-12-17 15:23:33 (Friday)
To: "Renato Golin" <reng...@gmail.com>
Cc: llvm-dev <llvm...@lists.llvm.org>, "余银" <yuyi...@loongson.cn>, "翟小娟" <zhaixi...@loongson.cn>
Subject: Re: Re: [llvm-dev] [RFC] Add a new backend called LoongArch