Computer Science ›› 2021, Vol. 48 ›› Issue (6): 41-47.doi: 10.11896/jsjkx.201200058

• Computer Architecture • Previous Articles     Next Articles

Automatic Porting of Basic Mathematics Library for 64-bit RISC-V

CAO Hao, GUO Shao-zhong, LIU Dan, XU Jin-chen   

  1. State Key Laboratory of Mathematical Engineering and Advanced Computing,PLA Information Engineering University,Zhengzhou 450002,China
  • Received:2020-12-07 Revised:2021-03-22 Online:2021-06-15 Published:2021-06-03
  • About author:CAO Hao,born in 1991,postgraduate.His main research interests include high performance computing and so on.(2227078931@qq.com)
    XU Jin-chen,born in 1987,Ph.D,lecturer,is a member of China Computer Fe-deration.His main research interests include high performance computing.
  • Supported by:
    National Natural Science Foundation of China(61802434).

Abstract: Subject to the core technology and intellectual property rights and other objective conditions,the research and development of domestic independent chip is highly restricted.RISC-V has the advantages of simplicity and modularity as an open source instruction set architecture(ISA),and it will become a new choice of domestic processor.As one of the most basic core software libraries of computer system,basic mathematics library is particularly important to the software ecological construction and healthy development of domestic processors.However,RISC-V has no relevant basic mathematics library at present.Therefore,this paper aims at porting basic mathematics library based on domestic Shenwei processor to the 64-bit RISC-V platform.In order to solve the problem of efficient transportation of the library,an automatic porting framework is designed at first,which can achieve high scalability through loose coupling between functional modules.Secondly,based on the characteristics of 64-bit RISC-V ISA,a global active register allocation method and a hierarchical instruction selection strategy are proposed.Finally,the framework is applied to bring about the transportation of some typical functions in the Shenwei basic mathematics library.Test results show that the ported functions are working correctly and the performance is improved compared with GLIBC.

Key words: Assembler, Automatic porting, Basic mathematic library, RISC-V

CLC Number: 

  • TP313
[1]ISEN C,JOHN L K,JOHN E.A Tale of Two Processors:Revisiting the RISC-CISC Debate[C]//Computer Performance Evaluation and Benchmarking.Berlin,Heidelberg:Springer,2009.
[2]The RISC-V Instruction Set Manual.Volume I:User-LevelISA;Volume II:Privileged Architecture[EB/OL].https//riscv.org/specifications/.238 pages.2019.
[3]CHAITIN G.Register allocation and spilling via graph coloring[C]//ACM.2004:66-74.
[4]DAS D,AHMAD S A,VENKATARAMANAN K.Deep Lear-ning-based Hybrid Graph-Coloring Algorithm for Register Allocation [EB/OL].[2020-01-16] https//www.researchgate.net.
[5]POLETTO M,SARKAR V.Linear scan register allocation [J].ACM Transactions on Programming Languages and Systems,1999,21(5):895-913.
[6]CAO H Y,ZHANG Y.Highly Portable Light-Weight x86 Emulator [J].Computer Systems & Applications,2011,20(5):101-104,143.
[7]BLINDELL G H,CARLSSON M,LOZANO R C,et al.Complete and Practical Universal Instruction Selection[J].Acm Transactions on Embedded Computing Systems,2017,16(5s):1-18.
[8]COOPER K D,TORCZON L.Engineering a Compiler,Second Edition[M].USA:Morgan Kaufmann,2003.
[9]SURHONE L M,TENNOE M T,HENSSONOW S F.Instruction Selection[M].Switzerland:Springer International Publi-shing,2016.
[10]GUO Z H,GUO S Z.Register Allocation Strategy for Hierarchy Structure in Base Mathematics Library[J].Computer Enginee-ring,2012,38(24):266-268.
[11]PATTERSON D,WATERMAN A.The RISC-V Reader[M].USA:Strawberry Canyon,2017.
[12]XU J C,HUANG Y Z,GUO S Z.Testing Platform for Floating Mathematical Function Libraries [J].Journal of Software,2015,26(6):1306-1321.
[13]QEMU.A generic and open source machine emulator and virtua-lizer[CP/OL].[2020-01-16],https//www.qemu.org/.
[14]FEDORA/RISC-V,a complete Fedora experience on the RISC-V(64bit,RV64GC) architecture[CP/OL].[2020-01-16],https//fedoraproject.org/wiki/Architectures/RISC-V.
[15]Spike,the RISC-V ISA Simulator[CP/OL].[2020-01-16].https//github.com/riscv/riscv-isa-sim.
[16]MPFR,the Multiple Precision Floating-Point Reliable Library[CP/OL].[2020-01-16],https//www.mpfr.org/.
[17]QI H Y,XU J N,GUO S Z.Detection of the maximum error of mathematical functions[J].Supercomput,2018,74:6275-6290.
[18]GLIBC.The GNU C Library [CP/OL].[2020-01-16].http//www.gnu.org/software/libc/.
[1] LIU Dan, GUO Shao-zhong, HAO Jiang-wei, XU Jin-chen. Implementation of Transcendental Functions on Vectors Based on SIMD Extensions [J]. Computer Science, 2021, 48(6): 26-33.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!