From: Autechre Date: Thu, 24 Feb 2022 20:20:18 +0000 (+0100) Subject: Merge pull request #618 from pcercuei/update-lightrec-20220224 X-Git-Tag: r24l~503 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8633a2e14027e4552940ef3e1c27c40b94c4870;hp=e68dc4d6acd30112bf175243291e4198ce8003ca;p=pcsx_rearmed.git Merge pull request #618 from pcercuei/update-lightrec-20220224 Attempt to fix CI build issues, try #2 --- diff --git a/Makefile b/Makefile index a1d63365..6a83f46b 100644 --- a/Makefile +++ b/Makefile @@ -109,7 +109,7 @@ OBJS += deps/lightning/lib/jit_disasm.o \ deps/lightrec/recompiler.o \ deps/lightrec/reaper.o ifeq ($(MMAP_WIN32),1) -CFLAGS += -Ideps/mman +CFLAGS += -Iinclude/mman OBJS += deps/mman/mman.o endif else ifeq "$(DYNAREC)" "ari64" diff --git a/deps/lightrec/.gitrepo b/deps/lightrec/.gitrepo index 770ee660..fb3c6d23 100644 --- a/deps/lightrec/.gitrepo +++ b/deps/lightrec/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/pcercuei/lightrec.git branch = master - commit = d90de68429bf9c2d67c5f5051d495d1e3131e636 - parent = a9725dc07f40b39a5533d546b59e45377d1f9b66 + commit = d3329782e806b9643239832f59e09d48ebc03d01 + parent = fc75c5470b8d931ad59d66b27203f02c1d1e674d method = merge cmdver = 0.4.3 diff --git a/deps/lightrec/lightrec.c b/deps/lightrec/lightrec.c index 3d4e1a25..e83f0e7d 100644 --- a/deps/lightrec/lightrec.c +++ b/deps/lightrec/lightrec.c @@ -454,11 +454,14 @@ static void lightrec_mtc0(struct lightrec_state *state, u8 reg, u32 data) static u32 count_leading_bits(s32 data) { -#if defined(__has_builtin) && __has_builtin(__builtin_clrsb) - return 1 + __builtin_clrsb(data); -#else u32 cnt = 33; +#ifdef __has_builtin +#if __has_builtin(__builtin_clrsb) + return 1 + __builtin_clrsb(data); +#endif +#endif + data = (data ^ (data >> 31)) << 1; do { @@ -467,7 +470,6 @@ static u32 count_leading_bits(s32 data) } while (data); return cnt; -#endif } static void lightrec_mtc2(struct lightrec_state *state, u8 reg, u32 data) diff --git a/deps/lightrec/slist.h b/deps/lightrec/slist.h index ae7e5d3e..37557e64 100644 --- a/deps/lightrec/slist.h +++ b/deps/lightrec/slist.h @@ -6,6 +6,8 @@ #ifndef __LIGHTREC_SLIST_H__ #define __LIGHTREC_SLIST_H__ +#include + #define container_of(ptr, type, member) \ ((type *)((void *)(ptr) - offsetof(type, member))) diff --git a/include/mman/sys/mman.h b/include/mman/sys/mman.h new file mode 120000 index 00000000..1c111c30 --- /dev/null +++ b/include/mman/sys/mman.h @@ -0,0 +1 @@ +../../../deps/mman/mman.h \ No newline at end of file diff --git a/jni/Android.mk b/jni/Android.mk index d8fdd42e..ce9762ad 100644 --- a/jni/Android.mk +++ b/jni/Android.mk @@ -141,7 +141,9 @@ endif ifeq ($(HAVE_LIGHTREC),1) COREFLAGS += -DLIGHTREC -DLIGHTREC_STATIC EXTRA_INCLUDES += $(DEPS_DIR)/lightning/include \ - $(DEPS_DIR)/lightrec + $(DEPS_DIR)/lightrec \ + $(ROOT_DIR)/include/lightning \ + $(ROOT_DIR)/include/lightrec SOURCES_C += $(DEPS_DIR)/lightrec/blockcache.c \ $(DEPS_DIR)/lightrec/disassembler.c \ $(DEPS_DIR)/lightrec/emitter.c \