An approach to adapting x86 built-in functions for RISC-V development
The construction of the ecosystem for the emerging RISC-V architecture requires the adaptation and migration of functions or software packages from other architectures to RISC-V.In the study of migrating GCC-specific built-in functions to the RISC-V architecture,a method for converting x86 built-in functions to RISC-V was proposed.For non-extension instruction set built-in functions(which belong to non-vector types),functions with the same functionality in the RISC-V architecture or standard library functions were used as replacements.Concerning SSE extension instruction set built-in functions,the migration involves establishing data type mappings and vector function operation mappings to achieve the transition to RISC-V architecture's vector extension functions or standard library functions.Notably,the migration via RVV functions constitutes 67%of the overall approach.Experimental results demonstrate the correctness of program functionality and the efficacy of the proposed method.Additionally,this method provides guidance for the migration of built-in functions from other extension instruction sets,offering broader coverage and enhanced scalability compared to existing approaches.
function migrationbuilt-in functioninstruction set extensionRISC-V migra-tion