mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-08 12:18:31 +00:00
Fold LIBC_BITS into LIBC_INTRIN
This commit is contained in:
parent
625aa365f1
commit
05b8f82371
603 changed files with 1071 additions and 1211 deletions
21
libc/intrin/likely.h
Normal file
21
libc/intrin/likely.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_BITS_LIKELY_H_
|
||||
#define COSMOPOLITAN_LIBC_BITS_LIKELY_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
||||
#define LIKELY(x) __builtin_expect(!!(x), 1)
|
||||
#define UNLIKELY(x) __builtin_expect(!!(x), 0)
|
||||
|
||||
#if __GNUC__ + 0 >= 9 && !defined(__chibicc__)
|
||||
#define VERY_LIKELY(x) __builtin_expect_with_probability(!!(x), 1, 0.999)
|
||||
#else
|
||||
#define VERY_LIKELY(x) LIKELY(x)
|
||||
#endif
|
||||
|
||||
#if __GNUC__ + 0 >= 9 && !defined(__chibicc__)
|
||||
#define VERY_UNLIKELY(x) __builtin_expect_with_probability(!!(x), 0, 0.999)
|
||||
#else
|
||||
#define VERY_UNLIKELY(x) UNLIKELY(x)
|
||||
#endif
|
||||
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_BITS_LIKELY_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue