From: Paul Cercueil Date: Thu, 24 Feb 2022 18:47:59 +0000 (+0000) Subject: git subrepo pull --force deps/lightrec X-Git-Tag: r24l~503^2~2 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de742fa028c2db93dbf4cdda2cb2b8b7700e5c90;p=pcsx_rearmed.git git subrepo pull --force deps/lightrec subrepo: subdir: "deps/lightrec" merged: "d3329782" upstream: origin: "https://github.com/pcercuei/lightrec.git" branch: "master" commit: "d3329782" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" --- 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)))