Computer Engineering & Science ›› 2023, Vol. 45 ›› Issue (09): 1532-1543.
• High Performance Computing • Previous Articles Next Articles
LI Fei,GUO Shao-zhong,ZHOU Bei,SONG Guang-hui,HAO Jiang-wei,XU Jin-chen
Received:
Revised:
Accepted:
Online:
Published:
Abstract: The basic mathematical library is one of the fundamental software libraries in a computer system, and its performance is one of the key factors affecting the efficiency of higher-level applications. The existing RISC-V basic mathematical library can achieve correct calculations, but it contains a large number of memory access instructions and redundant instructions in its source code, which leads to suboptimal function performance. Additionally, the assembly code for RISC-V mathematical functions is large and involves complex branch conditions, which increases the difficulty of direct optimization. To address these issues, this paper follows a local-to-global optimization approach from and proposes a method for automatically detecting critical paths in RISC-V mathematical functions. This method focuses on solving the problem of other branch registers being easily modified when optimizing critical branches. By using a queue-based register allocation strategy, the registers within the same path are reallocated, which improves register utilization and minimizes the number of memory access instructions. Furthermore, redundant instructions are also combined and functionally refactored. Experimental results show that the average execution cycles for 67 RISC-V mathematical functions have been optimized from 144 cycles to 85 cycles, resulting in an average performance improvement of 29.61%.
Key words: RISC-V, math library, critical path, register scheduling, performance optimization
LI Fei, GUO Shao-zhong, ZHOU Bei, SONG Guang-hui, HAO Jiang-wei, XU Jin-chen. Performance optimization of RISC-V basic math library[J]. Computer Engineering & Science, 2023, 45(09): 1532-1543.
0 / / Recommend
Add to citation manager EndNote|Ris|BibTeX
URL: http://joces.nudt.edu.cn/EN/
http://joces.nudt.edu.cn/EN/Y2023/V45/I09/1532