摘要
RISC-V指令集架构(Instruction Set Architecture,ISA)作为一种新兴的精简ISA,因免费、开源、自由等特点而得到快速发展.由于国内外对RISC-V的研究主要集中在硬件开发,软件生态相较于成熟ISA还很薄弱,实现一套RISC-V指令集高性能基础数学库可以进一步丰富RISC-V软件生态.本文基于自动化移植技术实现申威数学库到RISC-V的移植,为RISC-V指令架构提供首个使用向量指令优化的基础数学库系统.本文提出向量寄存器自动分支查表法与路径标记插入法,重点解决不同架构间寄存器映射过程中的寄存器复用问题,实现寄存器正确高效映射,并依据不同指令等价转换策略自动化移植数学函数69个.测试结果表明,RISC-V基础数学库函数可实现正确计算,最大误差为1.90ULP,函数性能平均为157.03节拍.
RISC-V instruction set architecture(ISA),as a new streamlined ISA,has developed rapidly due to its characteristics of free,open source,and freedom.Since the research on RISC-V at home and abroad mainly focuses on hardware development,the software ecosystem is still weak compared to mature ISAs.Implementing a set of high-performance basic math libraries for the RISC-V instruction set can further enrich the RISC-V software ecosystem.This paper realizes the transplantation of Sunway math library to RISC-V based on automatic transplantation technology,and provides the first basic math library system using vector instruction optimization for RISC-V instruction architecture.This paper proposes an automatic branch look-up table method and a path marker insertion method for vector registers,focusing on solving the problem of register multiplexing in the process of register mapping between different architectures,realizing the correct and efficient mapping of registers,and automatically transplanting 69 mathematical functions according to different instruction equivalence conversion strategies.The test results show that the RISC-V basic math library function can achieve correct calculation,the maximum error is 1.90ULP,and the average performance of functions is 157.03 beats.
作者
李飞
郭绍忠
郝江伟
侯明
宋广辉
许瑾晨
LI Fei;GUO Shao-zhong;HAO Jiang-wei;HOU Ming;SONG Guang-hui;XU Jin-chen(PLA Information Engineering University,Zhengzhou,Henan 450002,China;State Key Laboratory of Mathematical Engineering and Advanced Computing,Zhengzhou,Henan 450002,China)
出处
《电子学报》
EI
CAS
CSCD
北大核心
2024年第5期1633-1647,共15页
Acta Electronica Sinica