Messages in this thread | | | Subject | Re: [PATCH] scripts: coccinelle: check for !(un)?likely usage | From | Denis Efremov <> | Date | Wed, 28 Aug 2019 15:41:43 +0300 |
| |
> > As a human I am confused. Is !likely(x) equivalent to x or !x? > > Julia >
As far as I could understand it:
# define likely(x) __builtin_expect(!!(x), 1)
!likely(x) !__builtin_expect(!!(x), 1) !((!!(x)) == 1) (!!(x)) != 1, since !! could result in 0 or 1 (!!(x)) == 0 !(!!(x)) !!!(x) !(x)
Thanks, Denis
| |