Loongson
Loongson () is the name of a family of general-purpose, MIPS architecture-compatible, microprocessors, as well as the name of the Chinese fabless company (Loongson Technology) that develops them. The processors are alternately called Godson processors, which are described as its academic name.

History
The Godson processors, based on MIPS architecture, were initially developed at the Institute of Computing Technology (ICT), Chinese Academy of Sciences (CAS). The chief architect was Professor . The development of the first Loongson chip was started in 2001. The aim of the Godson project was to develop "high performance general-purpose microprocessors in China", and to become technologically self-sufficient as part of the Made in China 2025 plan. The development was supported by funding via the 10th and 11th Five-Year Plans.

In 2010 the company was commercialised as a separate entity, and in April 2010 Loongson Technology Corporation Limited was formally established and settled in Zhongguancun, Beijing, China. The company is a public–private partnership between ICT and Beijing-based chip designer BLX IC Design Corporation. BLX itself was a spin-off from ICT, and was founded in 2002 with Jiangsu Zhongyi Group. As Loongson is a fabless designer, STMicroelectronics fabricates and markets the processors.

The South China Morning Post reported that since 2020, Loongson has partnered with UnionTech and Sunway to develop and promote the Debian Linux-based Deepin operating system to reduce Chinese computers dependency on Microsoft Windows.

In 2021 Loongson filed for an initial public offering on the Shanghai Stock Exchange STAR Market. The company was seeking to raise c. 0.5 billion USD. Details from this time suggested Loongson needing  annual funding, for the first 10 years of its existence, and the company only broke even in 2015.

Instruction set architectures

MIPS
Loongson began by using the MIPS64 instruction set architecture (ISA). The internal microarchitecture was independently developed by ICT. Early implementations of the family lacked four instructions patented by MIPS Technologies (US4814976A, unaligned load-store) to avoid legal issues.

In 2007, a deal was reached by MIPS Technologies and ICT. STMicroelectronics bought a MIPS license for Loongson, and thus the processor can be promoted as MIPS-based or MIPS-compatible instead of MIPS-like.

In June 2009, ICT licensed the MIPS32 and MIPS64 architectures directly from MIPS Technologies.

In August 2011, Loongson Technology Corp. Ltd. licensed the MIPS32 and MIPS64 architectures from MIPS Technologies, Inc. for continued development of MIPS-based Loongson CPU cores.

LoongISA
The Loongson 3A2000 in 2015 saw the adoption of  1.0, an expanded instruction set that is a superset of MIPS64 release 2. It can be broken down into:

 LoongEXT, general-purpose extensions, 148 instructions
 LoongVZ, virtualisation extensions to the "VZ" system introduced in MIPS64 release 5, 5 instructions
 LoongBT, faster x86 and ARM binary translation, 213 instructions
 LoongSIMD, formerly LoongMMI (in Loongson 2E/F), for 128-bit SIMD, 1014 instructions
 MIPS SIMD Architecture (MSA), DSP, and VZ modules from MIPS Release 5

The LoongISA instructions were introduced as part of the GS464E cores. The binary translation instructions have the specific benefit of speeding up Intel x86 CPU emulation at a cost of 5% of the total die area. The new instructions help a QEMU hypervisor translate instructions from x86 to MIPS with only a reported 30% performance penalty.

LoongISA 2.0 was introduced for the GS464V R2 core, with the release of the Loongson 3 4000 series. Compared to LoongISA 1.0, the DSP module is removed, and a few sets are added:
 LoongSX
 LoongASX
 LoongEXT3 (updated)
 LoongAMU

Loongson SIMD instructions are semi-classified and are unavailable in publicly available compilers and assemblers, Loongson 2F's LoongMMI being the sole exception. A similar status applies to other LoongISA extensions.

LoongArch
Loongson moved to their own processor instruction set architecture (ISA) in 2021 with the release of the Loongson 3 5000 series. A Loongson developer described it as "...a new RISC ISA, which is a bit like MIPS or RISC-V. LoongArch includes a reduced 32-bit version (LA32R), a standard 32-bit version (LA32S) and a 64-bit version (LA64)". The stated rationale was to make Loongson and China not dependent on foreign technology or authorisation to develop their processor capability, whilst not infringing on any technology patents.

The ISA has been referred to as "a fork of MIPS64r6" due to a perceived lack of changes judging from instruction listings. In August 2021, Linux maintainers complained that submitted LoongArch code is "...a blind copy of the MIPS code...", however "only with a different name".

The LoongArch ISA manual has been made partially available in August 2021 with the publication of its first volume documenting the basic architecture. According to the LoongArch manual, the ISA uses MIPS's privilege model and IRQ mechanism, with other parts mostly following RISC-V's practice: the delay slot is removed and the instruction encoding is changed. Similar to LoongISA, the instruction-set extensions (SIMD and binary translation) are not yet documented, making this functionality unusable.

The Register reported in November 2021 the suspicion that LoongArch combines the best parts of MIPS and RISC-V, along with custom instructions. Commentary from Tom's Hardware re-states the issue that the Linux kernel code for LoongArch is the "same code it used for its MIPS-based chips"; they further note that Loongson "fails to demonstrate advantages of its architecture even on paper to software developers".

Cores
Loongson has three main families of processor cores, some of which are available as IP cores:
 GS1xx: basic embedded MIPS32 cores with hardware divider. 3- (GS132) or 5- (GS132E) stage pipeline.
 GS2xx: high-end embedded MIPS32 (GS232/GS232E) or MIPS64 (GS264) cores.
 GS232 has a 5-stage pipeline at max. 500 MHz. L1 = 16KB. The GS 232 is mainly used for Godson-1 products.
 GS232E/GS264 has a 10-stage pipeline at max. 1000 MHz. L1 = 16 KB, L2 = 4 MB shared. Out-of-order issue.
 GS464 series: MIPS64 core with four-way superscalar out-of-order issue. The design originated from the Loongson 2F processor. It was first widely used in the Loongson 3A processor, before also being used in the Loongson 2 series.
 GS464 has support for MIPS64 R2 + LoongMMI (two different versions in 2E and 2F)
 GS464V was first introduced in 2010 with the Godson 3B, and is a GS464 with vector capabilities.
 GS464E is an improved version of the GS464. Development had started in 2012 after shortcomings were found in the GS464 processor. The core has multiple improvements, including larger caches and better branch prediction amongst others, and was better optimised. The core was extended to support LoongISA (in addition to the in addition to MIPS64 R2 architecture).
 GS464EV is a development of the GS464 series, first used by the 3A4000 processor

All Loongson cores are little-endian.

Processor families
Loongson has built 3 processor families from their architectural cores. These are the:
 Godson-1, for consumer electronics and embedded applications
 Godson-2, single core processors for embedded applications and low performance personal computers
 Godson-3, multi-core processors for higher performance computers, high-performance computing and servers

Godson-1
The first Loongson processor, the Godson-1, was designed in 2001, released in 2002, and is a 32-bit CPU running at a clock speed of 266 MHz. It is fabricated with 0.18 micron CMOS process, has 8 KB of data cache, 8 KB of instruction cache and a 64-bit floating-point unit, capable of 200 double-precision MFLOPS. Godson-1 series chips either use the GS132 or GS232 cores.

Loongson X is a radiation hardened version of the GS232 core used in the Godson-1.

Godson-2 / Loongson 2
The Loongson 2 is a family of MIPS III compatible processors. It adds 64-bit ability to the Loongson architecture. Later Loongson 2 processors migrated to being MIPS64 compatible, due to sharing the GS464 core with the Loongson 3 series. Whilst early 2 series processors were single core, they developed to become multicore.

The development plan for the Godson-2 was to develop it from a CPU to a SOC. The 2E (2006) was a CPU, the 2F (2007) integrated the north bridge, the 2G (2008) had a hyper transport link between the CPU/north bridge and an integrated GPU/south bridge, and the 2H (2009) integrated all these functions into a SOC. The design of the 2F was the basis of the GS464 core. The 2G uses a single GS464 core; the 2H uses the GS464V core, as a single-core version of the initial Godson 3B.

Godson-3 / Loongson 3

The Loongson 3 family of processors are "...multi-core CPU[s] designed for high performance desktops, servers and clusters". They were designed as the first Loongson processors that had multiple cores. The processors were designed to use LoongISA - i.e. the MIPS64 ISA with additional extensions. The designers also attempted to optimise x86 translation on the chip.

Initial versions
The first production processor was the Loongson 3A, which used 4 GS464 cores. The 65 nm Loongson 3A1000 is able to run at a clock speed near 1 GHz, with 4 CPU cores (~15 W) first and 8 cores later (40 W). In April 2010, Loongson 3A1000 was released with DDR2/3 DRAM support.

The designers noted that they would produce a 3B chip with enhanced processing and vector capabilities, with 8 cores, and a 3C for server applications with up to 16 cores. The 8-core Loongson 3B was noted to use the upgraded GS464V core, with extended vector capabilities. This was followed by the Loonson 3C which used 16 GS464V cores.

The 3B1000, and related 2I, both failed as processors due to design errors. In May 2013 development of the 3C was suspended, in favour of developing the 3A2000 processor.

Later versions
In 2015, the 3A1500 and 3B2000 were released using the enhanced GS464E cores. The improved microarchitecture core allowed better performance, reportedly 3 times as fast as the 3A1000, as well as introducing the LoongISA enhanced instruction set. The 3A1500 was for embedded applications, whilst the 3B2000 was for servers and PCs.

In 2017 Loongson released the 3A3000. The 3A3000 is designed with quad-core 64-bit and clocked at 1.5 GHz, power consumption is only 30 W. The performance of the 3A3000 is reported to be equivalent to the Intel J1900 processor (released in 2013).

In late-2019 the 3A and 3B 4000 series were released. They used the upgraded GS464EV microarchitecture. The processors are designed with four cores, 8MB of L3 cache and operating clocks between 1.8 GHz to 2 GHz.

Loongson 3 5000 series
In July 2021 the Loongson 3 5000 series was released. The processor series is Loongson's first with their own developed ISA, "LoongArch". The processors announced include the 3A5000, a four-core desktop CPU, and the 3C5000L, a sixteen-core server CPU based on four 3A5000 in a single package. Both CPUs are reported to be fabricated on a 12 nm process.

It has been reported that the 3A5000 is "50 per cent faster and 30 per cent more power efficient" than the preceding 3A4000.

Phoronix reports that the 3A5000 CPU is "roughly on a par with the likes of the Intel Core i3 8109U / Core 2 Quad Q9500 / Core i5 750, or Armv8-based Phytium FT-2000".

Supported software

Operating systems

The Loongson processors are mainly designed around using the Linux operating system. Any operating system supporting the MIPS architecture should theoretically work. Windows CE was ported to a Loongson-based system with minimal effort. In 2010, Lemote ported an Android distribution to the Loongson platform.

Loongson machines are used in the package-building and CI infrastructure of Debian and Golang, respectively. This is partially because of Loongson's status as the only vendor producing application-grade MIPS CPUs for retail.

Compiler support
The GNU Compiler Collection (GCC) is the main compiler for software development on the Loongson platform. LLVM is still inadequate due to missing workarounds for loongson's CPU errata.

ICT also ported Open64 to the Loongson II platform.

Loongson microprocessor specifications

Loongson-based systems

In 2012 it was reported that Loongson processors had found itself into very few computing systems. The processors are mainly used in Chinese computers; in 2021 it was reported that Loongson supplies CPUs for most desktop computers procured by the Chinese government, and 80% of the Chinese government's servers. The release of the 3A3000 processor in 2015 was noted as turning point for the company's fortunes. In 2017 it was noted that the company's processors were being used in the Beidou satellite.

Personal computers
In March 2006, a €100 Loongson II computer design called Longmeng (Dragon Dream) was announced by Lemote.

In June 2006 at Computex'2006, YellowSheepRiver announced the Municator YSR-639, a small form factor computer based on the 400 MHz Loongson 2.

 the new 8.9" netbook from the Chinese manufacturer Lemote that replaced mengloong, Yeeloong (Portable Dragon), running Debian, is available in Europe from the Dutch company Tekmote Electronics.

In January 2010, Jiangsu province planned to buy 1.5 million Loongson PCs.

In September 2011, Lemote announced the Yeeloong-8133 13.3" laptop featuring 900 MHz, quad-core Loongson-3A/2GQ CPU.

Supercomputers
On 26 December 2007, China revealed its first Loongson based supercomputer in Hefei. The KD-50-I has a reported peak performance of 1 TFLOPS, and about 350 GFLOPS measured by LINPACK. This supercomputer was designed by a joint team led by Chen Guoliang at the computer science technology department of the University of Science and Technology of China (USCT) and ICT (the secondary contractor).  KD-50-I is the first Chinese built supercomputer to utilize domestic Chinese CPUs, with a total of more than 336 Loongson-2F CPUs, and nodes interconnected by ethernet.  The size of the computer was roughly equivalent to a household refrigerator and the cost was less than RMB800,000 (approximately 120,000, 80,000).

On 20 April 2010, USTC announced the successful development of the Loongson 3A based KD-60-1. The supercomputer is a cluster of standard blade servers with a total of over 80 quad-core Loongson processors, providing theoretical peak performance of 1 TFLOPS and reduces power consumption by 56% compared to the KD-50-I system, with similar performance.

On 26 December 2012, USTC announced the Loongson 3B based KD-90-1. Based around blade servers, like the KD-60-1, the supercomputer has over 10 octo-core Loongson processors, providing theoretical peak performance of 1 TFLOPS, and reduces power consumption by 62% compared to the KD-60 system that has similar performance.

In 2012 it was reported that Loongson processors were to be found in the Sunway BlueLight MPP and Dawning 6000 supercomputers.

See also
 863 Program
 Sinomanic
 Ingenic XBurst, a Chinese MIPS64 compatible processor.
 SW26010 a Chinese manycore processor.

Notes

References

External links

 Loongson Technology Co., Ltd.
 Efficient Binary Translation System with Low Hardware Cost
 LoongArch documentation

Science and technology in the People's Republic of China
Supercomputing in China
Microprocessors made in China
MIPS implementations
Zhongguancun
Chinese brands