X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=deps%2Flightrec%2Flightrec-private.h;h=56032f50001d12112b7814aeaf6ef8b66b5f948a;hb=13b02197fcb7575646408094d5583ed7391b1153;hp=6b6f7217288d7f9b1abb22877ce8fb3f9f6c1616;hpb=8622c9dcd0abc62601ff6c64f93f9294c520ed58;p=pcsx_rearmed.git diff --git a/deps/lightrec/lightrec-private.h b/deps/lightrec/lightrec-private.h index 6b6f7217..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 */