%0 Conference Proceedings %T Porting a JIT Compiler to RISC-V: Challenges and Opportunities %+ Equipe Hardware ARchitectures and CAD tools (Lab-STICC_ARCAD) %+ École Nationale Supérieure de Techniques Avancées Bretagne (ENSTA Bretagne) %+ Analyses and Languages Constructs for Object-Oriented Application Evolution (RMOD) %A Ducasse, Quentin %A Polito, Guillermo %A Tesone, Pablo %A Cotret, Pascal %A Lagadec, Loïc %< avec comité de lecture %B Proceedings of the 19th International Conference on Managed Programming Languages and Runtimes (MPLR '22) %C Brussels, Belgium %8 2022-09-14 %D 2022 %K JIT %K RISC-V %Z Computer Science [cs]/Programming Languages [cs.PL] %Z Computer Science [cs]/Software Engineering [cs.SE] %Z Computer Science [cs]/Hardware Architecture [cs.AR]Conference papers %X The RISC-V Instruction Set Architecture (ISA) is an open-source, modular and extensible ISA. The ability to add new instructions into a dedicated core opens up perspectives to accelerate VM components or provide dedicated hardware IPs to applications running on top. However, the RISC-V ISA design is clashing on several aspects with other ISAs and therefore software historically built around them. Among them, the lack of condition codes and instruction expansion through simple instruction combination. In this paper we present the challenges of porting Cogit, the Pharo's JIT compiler tightly linked to the x86 ISA, on RISC-V. We present concrete examples of them and the rationale behind their inclusion in the RISC-V ISA. We show how those mismatches are solved through design choices of the compilation process or through tools helping development: a VM simulation framework to keep the development in a high-level environment for the most part, an ISA-agnostic test harness covering main VM functionalities and a machine code debugger to explore and execute generated machine code. We also present a way to prototype custom instructions and execute them in the Pharo environment. %G English %2 https://hal.science/hal-03725841/document %2 https://hal.science/hal-03725841/file/default.pdf %L hal-03725841 %U https://hal.science/hal-03725841 %~ UNIV-BREST %~ INSTITUT-TELECOM %~ ENSTA-BRETAGNE %~ CNRS %~ INRIA %~ UNIV-UBS %~ INRIA-LILLE %~ ENSTA-BRETAGNE-STIC %~ INRIA_TEST %~ TESTALAIN1 %~ ENIB %~ LAB-STICC %~ CRISTAL %~ INRIA2 %~ CRISTAL-RMOD %~ UNIV-LILLE %~ INSTITUTS-TELECOM %~ LAB-STICC_ARCAD %~ LAB-STICC_SHARP