期刊文献+

RISC-V基础数学库性能优化

Performance optimization of RISC-V basic math library
下载PDF
导出
摘要 基础数学库作为计算机系统最基础的软件库之一,其性能是影响上层应用执行效率的主要因素之一。现有的RISC-V基础数学库虽然可以实现正确计算,但其源码中存在大量访存指令和冗余指令,导致函数性能不高;同时RISC-V数学函数的汇编代码量大,分支判断复杂,增加了直接优化的难度。针对上述问题,遵循从局部到整体的优化思路,提出了RISC-V数学函数的关键路径自动检测方法,重点解决对关键分支进行优化时其他分支寄存器依赖易被改变的问题。依据队列式寄存器分配策略,对同一路径内寄存器进行再分配,提高了寄存器利用率,最大限度地减少了访存指令数。此外,还对冗余指令进行了组合功能重构。实验结果表明,67个RISC-V数学函数由平均144个时钟周期优化为85个时钟周期,性能平均提升了29.61%。 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%.
作者 李飞 郭绍忠 周蓓 宋广辉 郝江伟 许瑾晨 LI Fei;GUO Shao-zhong;ZHOU Bei;SONG Guang-hui;HAO Jiang-wei;XU Jin-chen(School of Cyberspace Security,University of Information Engineering,Zhengzhou 450001,China)
出处 《计算机工程与科学》 CSCD 北大核心 2023年第9期1532-1543,共12页 Computer Engineering & Science
基金 数学工程与先进计算国家重点实验室开放基金(2023B02)。
关键词 RISC-V 数学库 关键路径 寄存器分配 性能优化 RISC-V math library critical path register scheduling performance optimization
  • 相关文献

参考文献5

二级参考文献63

  • 1Ping T P T. A Portable Generic Elementary Function Package in Aria and an Accurate Test Suite[J]. ACM SIGAda Ada Letters, 1991, 11(7): 180-216.
  • 2Geogre P M. Should the Elementary Function Library Be Incorporated into Computer Instruction Sets?[J]. ACM Trans. on Mathematical Software, 1994, 2(2): 132-142.
  • 3Ivan D B. Techniques for Region-based Register Allocation[C]// Proc. of International Symposium on Code Generation and Optimization. Washington D. C., USA: IEEE Press, 2009.
  • 4裘巍.编译器设计之路[M].北京:机械工业出版社,2010.
  • 5Jongeun L S. A Compiler Optimization to Reduce Soft Errors in Register Files[J]. ACM SIGPLAN Notices, 2009, 44(7): 41-49.
  • 6Anjali M. Hybrid Evolutionary Algorithm for the Graph Coloring.Register Allocation Problem for Embedded Systems[C]//Proc. of International Compiler Construction Conference. Bellingham, USA: Springer-Verlag, 2009.
  • 7Chaitin G J. Register Allocation and Spilling via Graph Coloring[J]. ACM SIGPLAN Notices, 1982, 17(6): 98-101.
  • 8Rideau S, Xavier L. Validating Register Allocation and Spilling[C]//Proc. of the 19th International Conference on Compiler Construction. [S. 1.]: Springer-Verlag, 2010.
  • 9Poletto M. Linear Scan Register Allocation[J]. ACM Transactions on Programming Languages and Systems, 1999, 21(5): 895-913.
  • 10Braun M, Hack S, Register Spilling and Live-range Splitting for SSA-form Programs[C]//Proc. of International Conference on Compiler Construction. York, UK: Springer-Verlag, 2009.

共引文献48

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部