X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/2236410f4582ab45ae8c384dd6eeeef5d10aab15..1375eb51603466b723ab7dd1ca4194ee5d662f75:/lunaix-os/includes/lunaix/compiler.h diff --git a/lunaix-os/includes/lunaix/compiler.h b/lunaix-os/includes/lunaix/compiler.h index f011a0b..68a43ea 100644 --- a/lunaix-os/includes/lunaix/compiler.h +++ b/lunaix-os/includes/lunaix/compiler.h @@ -7,6 +7,16 @@ #define weak_alias(name) __attribute__((weak, alias(name))) #define weak __attribute__((weak)) #define noret __attribute__((noreturn)) +#define optimize(opt) __attribute__((optimize(opt))) +#define must_inline __attribute__((always_inline)) + +#define clz(bits) __builtin_clz(bits) +#define sadd_overflow(a, b, of) __builtin_sadd_overflow(a, b, of) +#define umul_overflow(a, b, of) __builtin_umul_overflow(a, b, of) +#define offsetof(f, m) __builtin_offsetof(f, m) + +#define prefetch_rd(ptr, ll) __builtin_prefetch((ptr), 0, ll) +#define prefetch_wr(ptr, ll) __builtin_prefetch((ptr), 1, ll) #define stringify(v) #v #define stringify__(v) stringify(v)