Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lightning+Lightrec updates and other optimizations #862

Draft
wants to merge 25 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e328824
lightrec: update include files and folder
ZachCook May 31, 2022
05f51c2
lightrec: Adjust to lightrec API changes and HAVE_MMAP for lightning
ZachCook May 31, 2022
39f5b8a
Change GTE to allow using lightrec's registers
ZachCook Aug 9, 2022
3f7d110
lightrec: attempt memfd and hugepages for ram mmap
ZachCook May 31, 2022
b801cba
Lightrec: enable codebuffer option, fix Windows, move/cleanup headers
ZachCook Aug 12, 2022
ba5d04a
add cpu_timestamp hack to so lightrec tracks more cycles
ZachCook Aug 16, 2022
778c1b6
improve lightrec debugging by allowing threaded recompiler in debug b…
ZachCook Aug 17, 2022
d34dea9
clean and optimize loop around lightrec's execution functions
ZachCook Aug 31, 2022
8a86773
support MainRAM at 0x0, use INVALID_PTR instead of NULL
ZachCook Sep 4, 2022
dd59b7e
Remove "Cycle Timing Check" (execute_one) dynarec option, use new lig…
ZachCook Sep 10, 2022
9a38b02
Fix Windows and cleanup error handling in init_mmap
ZachCook Sep 25, 2022
85f2354
git subrepo commit (merge) deps/lightning
ZachCook Sep 17, 2024
3bf5fa5
git subrepo pull deps/lightrec
ZachCook Nov 17, 2022
3541cf9
Update lightning and lightrec include files
ZachCook Jul 15, 2023
fd88631
Makefile.common: Add missing files for lightning lightrec update
ZachCook Sep 17, 2024
59a2e9e
Extraction of lightrec specific code to cpu_lightrec.cpp
ZachCook Jul 16, 2023
972b562
Fix build with lightrec update
ZachCook Jul 15, 2023
75d2a4b
Add Dynarec SP GP hit RAM optimization option
ZachCook Sep 3, 2024
7b88a39
Fix GTE bugs due to uninitialized lightrec_regs
ZachCook Sep 3, 2024
472493e
Make cpu_lightrec friend class to cpu
ZachCook Sep 4, 2024
98d42a5
Add Parrel Port Mirror support for PS2/PS3 BIOS
ZachCook Sep 5, 2024
b1e476e
Fix PGXP for LWU/SWU meta-opcodes in lightrec
ZachCook Sep 5, 2024
2bf0f5e
Remove kunseg for pgxp rw, since lightrec_rw does that now
ZachCook Sep 14, 2024
272fb20
lightrec_init_mmap: Clean and rewrite io_base mmap code
ZachCook Sep 17, 2024
a38d0ae
Fix libretro.cpp with HAVE_LIGHTREC=0
ZachCook Sep 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,8 @@ else

ifeq ($(HAVE_LIGHTREC), 1)
FLAGS += -DHAVE_WIN_SHM
#For lightrec to get number of cpus, mingw should provide pthread_num_processors_np like pthread-win32
FLAGS += -DPTW32_VERSION
endif
endif

Expand Down
24 changes: 12 additions & 12 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,7 @@ ifeq ($(HAVE_LIGHTREC), 1)
ifeq ($(THREADED_RECOMPILER), 0)
FLAGS += -DENABLE_THREADED_COMPILER=0
else
ifeq ($(DEBUG), 0)
FLAGS += -DENABLE_THREADED_COMPILER=1
else
FLAGS += -DENABLE_THREADED_COMPILER=0
endif
FLAGS += -DENABLE_THREADED_COMPILER=1
endif

ifneq (,$(findstring win,$(platform)))
Expand All @@ -197,8 +193,10 @@ ifeq ($(HAVE_LIGHTREC), 1)

INCFLAGS += -I$(DEPS_DIR)/lightning/include \
-I$(DEPS_DIR)/lightrec \
-I$(CORE_DIR)/lightning-lightrec-include \
-include $(CORE_DIR)/lightning-lightrec-include/debug.h
-I$(CORE_DIR)/include \
-include $(CORE_DIR)/include/debug.h

SOURCES_CXX += $(CORE_EMU_DIR)/cpu_lightrec.cpp
endif

ifneq ($(HAVE_GRIFFIN), 1)
Expand Down Expand Up @@ -364,24 +362,26 @@ ifeq ($(HAVE_CHD), 1)
endif ## ifeq ($(HAVE_CHD), 1)

ifeq ($(HAVE_LIGHTREC), 1)
SOURCES_C += $(DEPS_DIR)/lightning/lib/jit_memory.c \
SOURCES_C += $(DEPS_DIR)/lightning/lib/jit_disasm.c \
$(DEPS_DIR)/lightning/lib/jit_memory.c \
$(DEPS_DIR)/lightning/lib/jit_names.c \
$(DEPS_DIR)/lightning/lib/jit_note.c \
$(DEPS_DIR)/lightning/lib/jit_print.c \
$(DEPS_DIR)/lightning/lib/jit_size.c \
$(DEPS_DIR)/lightning/lib/lightning.c \
$(DEPS_DIR)/lightrec/blockcache.c \
$(DEPS_DIR)/lightrec/constprop.c \
$(DEPS_DIR)/lightrec/emitter.c \
$(DEPS_DIR)/lightrec/interpreter.c \
$(DEPS_DIR)/lightrec/lightrec.c \
$(DEPS_DIR)/lightrec/memmanager.c \
$(DEPS_DIR)/lightrec/optimizer.c \
$(DEPS_DIR)/lightrec/reaper.c \
$(DEPS_DIR)/lightrec/regcache.c
$(DEPS_DIR)/lightrec/regcache.c \
$(DEPS_DIR)/lightrec/tlsf/tlsf.c
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't have to compile TLSF since you disabled the code buffer support (ENABLE_CODE_BUFFER=0)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ENABLE_CODE_BUFFER=1 was set in 3012b97 of this PR, there were many changes squashed together, and it could maybe use even more to make this more clear maybe?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I saw it after my message. I guess this change should be squashed into 3012b97 then.


ifeq ($(THREADED_RECOMPILER), 1)
ifeq ($(DEBUG), 0)
SOURCES_C += $(DEPS_DIR)/lightrec/recompiler.c
endif
SOURCES_C += $(DEPS_DIR)/lightrec/recompiler.c
endif

ifeq ($(LIGHTREC_LOG_LEVEL), 4)
Expand Down
21 changes: 16 additions & 5 deletions deps/lightning/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
/build-aux
+*

*.o
*.lo
*.la

.libs/
.deps/
*/.libs/
*/.deps/

autom4te.cache
aclocal.m4
depcomp
Expand All @@ -20,14 +31,14 @@ missing
size
stamp-h1
test-driver
check/.deps
doc/.deps
lib/.deps

m4/libtool.m4
m4/lt~obsolete.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
doc/mdate-sh
doc/texinfo.tex

lightning.pc
include/lightning.h

build-aux/
4 changes: 2 additions & 2 deletions deps/lightning/.gitrepo
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[subrepo]
remote = https://git.savannah.gnu.org/git/lightning.git
branch = master
commit = 876c1043bec5bfd594482b40700c84693e40d0eb
commit = bfd695a94668861a9447b29d2666f8b9c5dcd5bf
parent = 9f797430963d9cf0fcef7d963466f9cac7026de2
method = merge
cmdver = 0.4.3
cmdver = 0.4.9
Loading