Skip to content

Commit

Permalink
move jit files under same structure as in Amiberry
Browse files Browse the repository at this point in the history
  • Loading branch information
midwan committed Jan 12, 2025
1 parent 18d3cfd commit 0772de4
Show file tree
Hide file tree
Showing 42 changed files with 193,514 additions and 68,397 deletions.
41 changes: 19 additions & 22 deletions cmake/SourceFiles.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -385,31 +385,13 @@ set(SOURCE_FILES
src/cpuemu_35.cpp
src/cpuemu_40.cpp
src/cpuemu_50.cpp
src/jit/compemu.cpp
src/jit/compstbl.cpp
src/jit/compemu_fpp.cpp
src/jit/compemu_support.cpp
)

add_executable(${PROJECT_NAME} MACOSX_BUNDLE ${SOURCE_FILES})

if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
target_compile_definitions(${PROJECT_NAME} PRIVATE CPU_AARCH64)
target_sources(${PROJECT_NAME} PRIVATE
src/osdep/aarch64_helper.s
src/jit/compemu.cpp
src/jit/compstbl.cpp
src/jit/compemu_fpp.cpp
src/jit/compemu_support.cpp
)
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "arm")
set(CMAKE_ASM_COMPILER_ARG1 "-mfpu=neon-fp-armv8")
target_compile_definitions(${PROJECT_NAME} PRIVATE CPU_arm ARMV6_ASSEMBLY ARMV6T2 USE_ARMNEON ARM_HAS_DIV)
target_sources(${PROJECT_NAME} PRIVATE
src/osdep/neon_helper.s
src/jit/compemu.cpp
src/jit/compstbl.cpp
src/jit/compemu_fpp.cpp
src/jit/compemu_support.cpp
)
endif ()

set_target_properties(${PROJECT_NAME} PROPERTIES
MACOSX_BUNDLE TRUE
MACOSX_BUNDLE_EXECUTABLE_NAME "Amiberry-Lite"
Expand All @@ -432,6 +414,21 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE
-DAMIBERRY_LIBDIR="${CMAKE_INSTALL_FULL_LIBDIR}/${PROJECT_NAME}"
)

if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
target_compile_definitions(${PROJECT_NAME} PRIVATE
CPU_AARCH64
)
target_sources(${PROJECT_NAME} PRIVATE
src/osdep/aarch64_helper.s
)
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "arm")
set(CMAKE_ASM_COMPILER_ARG1 "-mfpu=neon-fp-armv8")
target_compile_definitions(${PROJECT_NAME} PRIVATE CPU_arm ARMV6_ASSEMBLY ARMV6T2 USE_ARMNEON ARM_HAS_DIV)
target_sources(${PROJECT_NAME} PRIVATE
src/osdep/neon_helper.s
)
endif ()

target_compile_options(${PROJECT_NAME} PRIVATE -fno-pie)
target_link_options(${PROJECT_NAME} PRIVATE -no-pie)

Expand Down
3 changes: 1 addition & 2 deletions src/include/newcpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -877,8 +877,7 @@ extern cpuop_func_noret *cpufunctbl_noret[65536] ASM_SYM_FOR_FUNC("cpufunctbl_no
extern cpuop_func *cpufunctbl[65536] ASM_SYM_FOR_FUNC("cpufunctbl");

#ifdef JIT
extern void flush_icache(int);
extern void flush_icache_hard(int);
extern void (*flush_icache)(int);
extern void compemu_reset(void);
#else
#define flush_icache(int) do {} while (0)
Expand Down
1,482 changes: 738 additions & 744 deletions src/jit/aarch64.h → src/jit/arm/aarch64.h

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/jit/codegen_arm.cpp → src/jit/arm/codegen_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ STATIC_INLINE void raw_pop_preserved_regs(void) {

STATIC_INLINE void raw_flags_to_reg(int r)
{
uintptr idx = (uintptr) &(regs.ccrflags.nzcv) - (uintptr) &regs;
uintptr idx = (uintptr) &(regflags.nzcv) - (uintptr) &regs;
MRS_CPSR(r);
if(flags_carry_inverted) {
EOR_rri(r, r, ARM_C_FLAG);
Expand Down
File renamed without changes.
Loading

0 comments on commit 0772de4

Please sign in to comment.