电子学报2024,Vol.52Issue(5):1633-1647,15.DOI:10.12263/DZXB.20220375
面向RISC-V的基础数学库实现
Basic Math Library Implementation for RISC-V
李飞 1郭绍忠 1郝江伟 1侯明 1宋广辉 1许瑾晨1
作者信息
- 1. 信息工程大学,河南郑州 450002||数学工程与先进计算国家重点实验室,河南郑州 450002
- 折叠
摘要
Abstract
RISC-V instruction set architecture(ISA),as a new streamlined ISA,has developed rapidly due to its char-acteristics of free,open source,and freedom.Since the research on RISC-V at home and abroad mainly focuses on hard-ware 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.关键词
RISC-V/申威/汇编/向量/数学库/自动化移植Key words
RISC-V/Sunway/assembly/vector/math library/automatic porting分类
计算机与自动化引用本文复制引用
李飞,郭绍忠,郝江伟,侯明,宋广辉,许瑾晨..面向RISC-V的基础数学库实现[J].电子学报,2024,52(5):1633-1647,15.