This article is more than 1 year old
GNU Compiler Collection adds support for China's LoongArch CPU family
MIPS...ish is on the march in the Middle Kingdom
Version 12.1 of the GNU Compiler Collection (GCC) was released this month, and among its many changes is support for China's LoongArch processor architecture.
China's Academy of Sciences developed a family of MIPS-compatible microprocessors in the early 2000s. In 2010 the tech was spun out into a company called Loongson Technology which today markets silicon under the brand "Godson". The company bills itself as working to develop technology that secures China and underpins its ability to innovate, a reflection of Beijing's belief that home-grown CPU architectures are critical to the nation's future.
LoongArch emerged from Loongson around about last year, and was described as a new RISC ISA that comes in 32-bit and 64-bit flavours.
GCC 12.1 seemingly supports the 64-bit side (LA64), according to the release notes:
Support for the LoongArch architecture instruction set has been added. The Loongson CPU codename LA464 and LoongArch 64-bit generic CPU codename loongarch64 are supported through the -march= and -mtune= options (GCC identifiers in parentheses).
The ISA's designers have said LoongArch is similar to MIPS and RISC-V; at least one Linux kernel developer has complained it's basically MIPS all over again. MIPS isn't so trendy these days – RISC-V is the new open-source silicon hotness. Even MIPS the company is doing RISC-V chips. Although China made some bold claims about RISC-V, it can't quite seem to let go of MIPS for its Loongson line.
LoongArch is said to be the CPU architecture of Loongson's latest silicon, such as the 3A5000 processor. Previous chips, such as the 3A4000, are definitely 64-bit MIPS affairs. Loongson engineers tried to submit code to the Linux kernel in March this year to support an LS3A4000-powered motherboard made by Chinese computer-maker Lemote.
- Turing Pi 2 crowdfunding goal smashed within a day
- The sad state of Linux desktop diversity: 21 environments, just 2 designs
- Python is getting faster: Major performance tweaks on horizon
- Workstation, server, IoT? No worries. Fedora 36 is out – all 13 editions of it
This is why getting support into the upstream Linux kernel is important, and there is at least some Loongson support in the mainline kernel codebase (not so much for LoongArch so far). For anything that doesn't make or hasn't made it into the open-source project, Loongson and its customers must maintain their own branch of the kernel, such as Loongnix. If the source code on GitHub is any indication, this effort can lag considerably behind the current kernel.
Loongson is not the only Chinese processor line. The newer RISC-V architecture XiangShan processors look promising. There is, or was, also an x86-compatible joint venture with Taiwanese Via Technologies, the KaiXian range from Zhaoxin. Huawei has developed an Arm-based range of "Kunpeng" processors, and China's top clouds have developed silicon for servers and AO. However, it looks like Loongson is not going away just yet. ®