X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=deps%2Flightrec%2Flightrec-private.h;h=56032f50001d12112b7814aeaf6ef8b66b5f948a;hb=5b6b627e20e2009e230d3813b2e24d9e892adaaa;hp=1b120db1094e238d206a21cbedea96dbc3647470;hpb=ba3814c189d3bd2332b66fb6c633a7d028e618fe;p=pcsx_rearmed.git diff --git a/deps/lightrec/lightrec-private.h b/deps/lightrec/lightrec-private.h index 1b120db1..56032f50 100644 --- a/deps/lightrec/lightrec-private.h +++ b/deps/lightrec/lightrec-private.h @@ -16,8 +16,15 @@ #include #endif +#ifdef _MSC_BUILD +#include +#endif + #define ARRAY_SIZE(x) (sizeof(x) ? sizeof(x) / sizeof((x)[0]) : 0) +#define GENMASK(h, l) \ + (((uintptr_t)-1 << (l)) & ((uintptr_t)-1 >> (__WORDSIZE - 1 - (h)))) + #ifdef __GNUC__ # define likely(x) __builtin_expect(!!(x),1) # define unlikely(x) __builtin_expect(!!(x),0) @@ -51,10 +58,12 @@ #ifdef _MSC_BUILD # define popcount32(x) __popcnt(x) -# define ffs32(x) (31 - __lzcnt(x)) +# define clz32(x) _lzcnt_u32(x) +# define ctz32(x) _tzcnt_u32(x) #else # define popcount32(x) __builtin_popcount(x) -# define ffs32(x) (__builtin_ffs(x) - 1) +# define clz32(x) __builtin_clz(x) +# define ctz32(x) __builtin_ctz(x) #endif /* Flags for (struct block *)->flags */ @@ -123,6 +132,7 @@ struct lightrec_branch_target { enum c_wrappers { C_WRAPPER_RW, C_WRAPPER_RW_GENERIC, + C_WRAPPER_MFC, C_WRAPPER_MTC, C_WRAPPER_CP, C_WRAPPERS_COUNT,