File tree Expand file tree Collapse file tree 4 files changed +2869
-0
lines changed
Expand file tree Collapse file tree 4 files changed +2869
-0
lines changed Original file line number Diff line number Diff line change @@ -196,6 +196,16 @@ if(CPU_ARCH_RISCV64)
196196 target_link_libraries (core PRIVATE biscuit::biscuit riscv-disas)
197197 message (STATUS "Building RISC-V-64 recompiler." )
198198endif ()
199+ if (CPU_ARCH_LOONGARCH64)
200+ target_compile_definitions (core PUBLIC "ENABLE_RECOMPILER=1" "ENABLE_MMAP_FASTMEM=1" )
201+ target_sources (core PRIVATE
202+ ${RECOMPILER_SRCS}
203+ cpu_recompiler_loongarch64.cpp
204+ cpu_recompiler_loongarch64.h
205+ )
206+ target_link_libraries (core PRIVATE lagoon)
207+ message (STATUS "Building LoongArch64 recompiler." )
208+ endif ()
199209
200210function (add_core_resources target )
201211 add_util_resources(${target} )
Original file line number Diff line number Diff line change @@ -80,6 +80,19 @@ class Recompiler
8080 // Align functions to 16 bytes.
8181 static constexpr u32 FUNCTION_ALIGNMENT = 16 ;
8282
83+ #elif defined(CPU_ARCH_LOONGARCH64)
84+
85+ // Number of host registers.
86+ static constexpr u32 NUM_HOST_REGS = 32 ;
87+ static constexpr bool HAS_MEMORY_OPERANDS = false ;
88+
89+ // A reasonable "maximum" number of bytes per instruction.
90+ static constexpr u32 MAX_NEAR_HOST_BYTES_PER_INSTRUCTION = 64 ;
91+ static constexpr u32 MIN_CODE_RESERVE_FOR_BLOCK = 512 ;
92+
93+ // Align functions to 16 bytes.
94+ static constexpr u32 FUNCTION_ALIGNMENT = 16 ;
95+
8396#endif
8497
8598public:
You can’t perform that action at this time.
0 commit comments