Glibc Hot Spot Function Assembly Optimization for LoongArch
Lulu Cai, Yagang Wang, Xiaolong Chen · 2022 41st Chinese Control Conference (CCC) · 2022
LoongArch is a new architecture featuring RISC instruction architecture characteristics. This paper studies the optimization of commonly used functions in the Glibc library of LoongArch in order to take full advantage of the architecture and improve the responsiveness of the program. The CPU optimization features regarding caching, branch prediction, and out-of-order execution are analyzed Based on the Loongson 3A5000. Combined with optimization features, a series of methods such as loop expansion and instruction rearrangement are adopted for assembly optimization of string and memory handling functions. The experimental results show that the performance of these functions has been improved to varying degrees in the Loongson 3A5000, and some functions can reach an optimization ratio of up to 80%, which is of great significance to the overall improvement of the Loongson system performance.