X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=include%2Fwimlib%2Fcompiler.h;h=2b1923c263f6c054c642d0b7c9b518b4e769f736;hp=9f53e192fc52796e2837c016a2f20b479e05d1cf;hb=4a20aae0dd8469a352517a0b107416ffa99ccc55;hpb=908381d2809a48acd9490ec080e51087ae1529fd diff --git a/include/wimlib/compiler.h b/include/wimlib/compiler.h index 9f53e192..2b1923c2 100644 --- a/include/wimlib/compiler.h +++ b/include/wimlib/compiler.h @@ -50,10 +50,9 @@ # define WIMLIBAPI __attribute__((visibility("default"))) #endif -/* Declare that the annotated function should be inlined. Currently, we force - * the compiler to honor this because we use 'inline' in highly tuned code, e.g. - * compression codecs. */ -#define inline inline __attribute__((always_inline)) +/* Declare that the annotated function should always be inlined. This might be + * desirable in highly tuned code, e.g. compression codecs. */ +#define forceinline inline __attribute__((always_inline)) /* Declare that the annotated function should *not* be inlined. */ #define noinline __attribute__((noinline)) @@ -171,10 +170,10 @@ #endif /* (Optional) Find Last Set bit and Find First Set bit macros. */ -#define compiler_fls32(n) (31 - __builtin_clz(n)) -#define compiler_fls64(n) (63 - __builtin_clzll(n)) -#define compiler_ffs32(n) __builtin_ctz(n) -#define compiler_ffs64(n) __builtin_ctzll(n) +#define compiler_bsr32(n) (31 - __builtin_clz(n)) +#define compiler_bsr64(n) (63 - __builtin_clzll(n)) +#define compiler_bsf32(n) __builtin_ctz(n) +#define compiler_bsf64(n) __builtin_ctzll(n) /* Optional definitions for checking with 'sparse'. */ #ifdef __CHECKER__