1. RISC-V 基础数学库性能优化.
- Author
-
李 飞, 郭绍忠, 周 蓓, 宋广辉, 郝江伟, and 许瑾晨
- 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%.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%. [ABSTRACT FROM AUTHOR]
- Published
- 2023
- Full Text
- View/download PDF